Skip to content

Commit

Permalink
Add lint-fix task to automatically fix some Clippy warnings. (sigp#…
Browse files Browse the repository at this point in the history
…4419)

## Issue Addressed

This PR adds a new `lint-fix` task to automatically fix simple Clippy warnings using `cargo clippy --fix`.

Usage:

```
make lint-fix
```
  • Loading branch information
jimmygchen authored and Woodpile37 committed Jan 6, 2024
1 parent 2d6df38 commit d7dab42
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ test-full: cargo-fmt test-release test-debug test-ef test-exec-engine
# Lints the code for bad style and potentially unsafe arithmetic using Clippy.
# Clippy lints are opt-in per-crate for now. By default, everything is allowed except for performance and correctness lints.
lint:
cargo clippy --workspace --tests -- \
cargo clippy --workspace --tests $(EXTRA_CLIPPY_OPTS) -- \
-D clippy::fn_to_numeric_cast_any \
-D warnings \
-A clippy::uninlined-format-args \
Expand All @@ -181,6 +181,10 @@ lint:
-A clippy::question-mark \
-A clippy::uninlined-format-args

# Lints the code using Clippy and automatically fix some simple compiler warnings.
lint-fix:
EXTRA_CLIPPY_OPTS="--fix --allow-staged --allow-dirty" $(MAKE) lint

nightly-lint:
cp .github/custom/clippy.toml .
cargo +$(CLIPPY_PINNED_NIGHTLY) clippy --workspace --tests --release -- \
Expand Down

0 comments on commit d7dab42

Please sign in to comment.