Skip to content

Commit d3609f1

Browse files
committed
Add commitlint config and hook
1 parent 75a48c6 commit d3609f1

File tree

2 files changed

+89
-58
lines changed

2 files changed

+89
-58
lines changed

.commitlintrc.json

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"rules": {
3+
"header-min-length": [
4+
2,
5+
"always",
6+
8
7+
],
8+
"header-max-length": [
9+
2,
10+
"always",
11+
72
12+
],
13+
"header-case": [
14+
2,
15+
"always",
16+
"sentence-case"
17+
],
18+
"header-full-stop": [
19+
2,
20+
"never",
21+
"."
22+
],
23+
"body-leading-blank": [
24+
2,
25+
"always"
26+
],
27+
"body-max-line-length": [
28+
2,
29+
"always",
30+
72
31+
],
32+
"footer-leading-blank": [
33+
2,
34+
"always"
35+
]
36+
}
37+
}

.pre-commit-config.yaml

+52-58
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,53 @@
11
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.1.0
4-
hooks:
5-
- id: check-case-conflict
6-
- id: check-json
7-
- id: check-merge-conflict
8-
- id: check-symlinks
9-
- id: check-toml
10-
- id: check-xml
11-
- id: check-yaml
12-
- id: destroyed-symlinks
13-
- id: detect-private-key
14-
- id: end-of-file-fixer
15-
- id: fix-byte-order-marker
16-
- id: forbid-new-submodules
17-
- id: mixed-line-ending
18-
- id: trailing-whitespace
19-
- repo: https://github.com/DavidAnson/markdownlint-cli2
20-
rev: v0.4.0
21-
hooks:
22-
- id: markdownlint-cli2
23-
exclude: ^LICENSE\.md$
24-
- repo: https://github.com/shellcheck-py/shellcheck-py
25-
rev: v0.8.0.4
26-
hooks:
27-
- id: shellcheck
28-
- repo: https://github.com/codespell-project/codespell
29-
rev: v2.1.0
30-
hooks:
31-
- id: codespell
32-
args: [
33-
--ignore-words=.codespellignore,
34-
]
35-
- repo: https://github.com/doublify/pre-commit-rust
36-
rev: v1.0
37-
hooks:
38-
- id: fmt
39-
args: [
40-
--all,
41-
--,
42-
]
43-
- id: cargo-check
44-
args: [
45-
--locked,
46-
--workspace,
47-
--all-features,
48-
--all-targets,
49-
]
50-
- id: clippy
51-
args: [
52-
--locked,
53-
--workspace,
54-
--all-features,
55-
--all-targets,
56-
--,
57-
-D,
58-
warnings,
59-
]
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.2.0
4+
hooks:
5+
- id: check-case-conflict
6+
- id: check-json
7+
- id: check-merge-conflict
8+
- id: check-symlinks
9+
- id: check-toml
10+
- id: check-xml
11+
- id: check-yaml
12+
- id: destroyed-symlinks
13+
- id: detect-private-key
14+
- id: end-of-file-fixer
15+
- id: fix-byte-order-marker
16+
- id: forbid-new-submodules
17+
- id: mixed-line-ending
18+
- id: trailing-whitespace
19+
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
20+
rev: v8.0.0
21+
hooks:
22+
- id: commitlint
23+
stages: [commit-msg]
24+
- repo: https://github.com/DavidAnson/markdownlint-cli2
25+
rev: v0.4.0
26+
hooks:
27+
- id: markdownlint-cli2
28+
exclude: ^LICENSE\.md$
29+
- repo: https://github.com/shellcheck-py/shellcheck-py
30+
rev: v0.8.0.4
31+
hooks:
32+
- id: shellcheck
33+
- repo: https://github.com/codespell-project/codespell
34+
rev: v2.1.0
35+
hooks:
36+
- id: codespell
37+
args: [--ignore-words=.codespellignore]
38+
- repo: https://github.com/doublify/pre-commit-rust
39+
rev: v1.0
40+
hooks:
41+
- id: fmt
42+
args: [--all, --]
43+
- id: clippy
44+
args:
45+
[
46+
--locked,
47+
--workspace,
48+
--all-features,
49+
--all-targets,
50+
--,
51+
-D,
52+
warnings,
53+
]

0 commit comments

Comments
 (0)