Skip to content

Commit 655eb77

Browse files
OJarrisonndavidbtadokoro
authored andcommitted
feat: make cargo lint run linting CI workflow locally
Add the [`lints`] section to `Cargo.toml` and reinforce the same linting options as the ones in the `format_and_lint` CI workflow. Also, add an alias `cargo lint` for `cargo clippy --all-targets --all-features --tests` to the `.cargo/config.toml` file. The alias for `cargo fmt --all` ain't required yet since `patch-hub` is a single crate project. [Maintainer edits] - Squash both commits into one - Change commit message subject to fit "feat/fix/refactor" pattern - Added comments to `Cargo.toml` and `.cargo/config.toml` Signed-off-by: OJarrisonn <[email protected]> Reviewed-by: David Tadokoro <[email protected]> Signed-off-by: David Tadokoro <[email protected]>
1 parent b768691 commit 655eb77

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.cargo/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Alias for `cargo clippy`
2+
[alias]
3+
lint = "clippy --all-targets --all-features"

Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,12 @@ installers = []
3333
targets = ["x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl"]
3434
# Publish jobs to run in CI
3535
pr-run-mode = "plan"
36+
37+
# Linter configurations
38+
[lints.rust]
39+
warnings = "deny"
40+
unconditional_recursion = "deny"
41+
42+
[lints.clippy]
43+
too-many-arguments = "allow"
44+
map_unwrap_or = "deny"

0 commit comments

Comments
 (0)