Add clippy to lint rust code#186
Merged
seddonym merged 4 commits intopython-grimp:masterfrom Feb 8, 2025
Merged
Conversation
We don't need to run the rust tests for every single python version in the matrix.
Clippy is a very popular linter for rust code. The default condifuration is good. Clippy can help us to catch issues related to code correctness, style and performance. https://doc.rust-lang.org/clippy/index.html
Most of the time clippy warnings are there for a reason and it's best to restructure the code to avoid them. Clippy can often apply automatic fixes with the `--fix` option. In the rare case that clippy is wrong, lints can be ignored at the module/function level.
Peter554
commented
Feb 8, 2025
Comment on lines
+12
to
+13
| check_python: | ||
| name: Check Python ${{ matrix.python-version }}, ${{ matrix.os }} |
Collaborator
Author
There was a problem hiding this comment.
I've gone for the name "check" here rather than "test", since we're also running black, mypy, flake8 etc.
Peter554
commented
Feb 8, 2025
| working-directory: ./rust | ||
| - name: Run linter (clippy) | ||
| run: cargo clippy --all-targets --all-features | ||
| run: cargo clippy --all-targets --all-features -- -D warnings |
Collaborator
Author
There was a problem hiding this comment.
There are currently no violations - mainly because I've been using clippy when developing the rust graph on my branch.
fdd53c2 to
fa9e0c4
Compare
CodSpeed Performance ReportMerging #186 will not alter performanceComparing Summary
|
seddonym
approved these changes
Feb 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clippy is a very popular linter for rust code. The default configuration is good. Clippy can help us to catch issues related to code correctness, style and performance. It's often possible to apply automatic fixes via the
--fixflag.