Skip to content

Commit

Permalink
🔧 Add commitlint
Browse files Browse the repository at this point in the history
Use commitlint to verify commits are following conventional commits.
  • Loading branch information
perdy committed May 12, 2020
1 parent 8789a98 commit 7768329
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci_branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
image: python:${{ matrix.python }}
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v1
- id: install
name: Install requirements
run: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci_master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
image: python:${{ matrix.python }}
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v1
- id: install
name: Install requirements
run: |
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
args:
- --autofix
- --indent=2
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v2.2.0
hooks:
- id: commitlint
stages: [commit-msg]
- repo: local
hooks:
- id: flake8
Expand Down
99 changes: 99 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
module.exports = {
rules: {
"type-enum": [
2,
"always",
[
":art:",
":newspaper:",
":pencil:",
":memo:",
":zap:",
":fire:",
":books:",
":bug:",
":ambulance:",
":penguin:",
":apple:",
":checkered_flag:",
":robot:",
":green_ale:",
":tractor:",
":recycle:",
":white_check_mark:",
":microscope:",
":green_heart:",
":lock:",
":arrow_up:",
":arrow_down:",
":fast_forward:",
":rewind:",
":rotating_light:",
":lipstick:",
":wheelchair:",
":globe_with_meridians:",
":construction:",
":gem:",
":bookmark:",
":tada:",
":loud_sound:",
":mute:",
":sparkles:",
":speech_balloon:",
":bulb:",
":construction_worker:",
":chart_with_upwards_trend:",
":ribbon:",
":rocket:",
":heavy_minus_sign:",
":heavy_plus_sign:",
":wrench:",
":hankey:",
":leaves:",
":bank:",
":whale:",
":twisted_rightwards_arrows:",
":pushpin:",
":busts_in_silhouette:",
":children_crossing:",
":building_construction:",
":iphone:",
":clown_face:",
":ok_hand:",
":boom:",
":bento:",
":pencil2:",
":package:",
":alien:",
":truck:",
":page_facing_up:",
":busts_in_silhouette:",
":card_file_box:",
":loud_sound:",
":mute:",
":egg:",
":see_no_evil:",
":camera_flash:",
":alembic:",
":mag:",
":wheel_of_dharma:",
":label:"
]
],
"body-leading-blank": [2, "always"],
"footer-leading-blank": [2, "always"],
"header-max-length": [2, "always", 72],
"scope-case": [2, "always", "lower-case"],
"subject-case": [2, "always", ["sentence-case"]],
"subject-empty": [2, "never"],
"subject-full-stop": [2, "never", ["."]],
"type-case": [2, "always", "lower-case"],
"type-empty": [2, "never"]
},
parserPreset: {
parserOpts: {
headerPattern: /^(:\w*:)(?:\((.*?)\))?\s((?:.*(?=\())|.*)(?:\(#(\d*)\))?/,
headerCorrespondence: ["type", "scope", "subject", "ticket"]
}
}
};

0 comments on commit 7768329

Please sign in to comment.