Skip to content

Commit eb92bf2

Browse files
feat: Add pre-commit hooks for formatting and linting
pre-commit hooks run right before the commit is created to prevent common mistakes and streamline development. To make `patch-hub` more robust as a project, add two hooks: one for formatting (`cargo fmt`) and linting (`cargo clippy`). Thanks-to: OJarrisonn <[email protected]> Thanks-to: Lorenzo Bertin Salvador <[email protected]> Signed-off-by: David Tadokoro <[email protected]>
1 parent 5744650 commit eb92bf2

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.pre-commit-config.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
# Formatter
5+
- id: rustfmt
6+
name: rustfmt
7+
language: rust
8+
entry: cargo fmt
9+
args: ["--all"]
10+
types: [rust]
11+
pass_filenames: false
12+
# Linter
13+
- id: clippy
14+
name: clippy
15+
language: rust
16+
entry: cargo clippy
17+
args: [
18+
"--all-features", "--all-targets", "--tests",
19+
"--", "--allow=clippy::too-many-arguments", "--deny=warnings",
20+
"--deny=clippy::map_unwrap_or", "--deny=unconditional_recursion"
21+
]
22+
types: [rust]
23+
pass_filenames: false

0 commit comments

Comments
 (0)