-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure clippy
to error on warnings
#692
Configure clippy
to error on warnings
#692
Conversation
@@ -24,7 +24,7 @@ repos: | |||
- id: cargo-check | |||
args: ['--manifest-path', './dask_planner/Cargo.toml', '--verbose', '--'] | |||
- id: clippy | |||
args: ['--manifest-path', './dask_planner/Cargo.toml', '--verbose', '--'] | |||
args: ['--manifest-path', './dask_planner/Cargo.toml', '--verbose', '--', '-D', 'warnings'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to note that we can also configure clippy
to automatically fix some of the more easily corrected warnings with
args: ['--manifest-path', './dask_planner/Cargo.toml', '--verbose', '--', '-D', 'warnings'] | |
args: ['--manifest-path', './dask_planner/Cargo.toml', '--fix', '--allow-dirty', '--verbose', '--', '-D', 'warnings'] |
Was just hesitant to do this by default as the error message when leaving out --allow-dirty
seemed to imply that this could result in destructive changes; @andygrove @jdye64 do you have any preferences here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer that we fix any warnings ourselves, even if we are often just copying & pasting Clippy's suggestions. I think this is an excellent way to learn more about writing idiomatic Rust code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with Andy's comments here
For clarity is the plan to manually fix all the clippy warnings in this PR or a subsequent one? |
@jdye64 plan is to manually fix all the clippy warnings in this PR, I've managed to narrow it down to only two:
|
Codecov Report
@@ Coverage Diff @@
## datafusion-sql-planner #692 +/- ##
=========================================================
Coverage ? 66.97%
=========================================================
Files ? 73
Lines ? 3637
Branches ? 753
=========================================================
Hits ? 2436
Misses ? 1055
Partials ? 146 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adds
-D warnings
to theclippy
entrypoint in our pre-commit config so that warnings will now cause our linting to fail. Will also attempt to fix the existing warnings in this PR.