-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Clippy Analysis to CI #2979
base: master
Are you sure you want to change the base?
Clippy Analysis to CI #2979
Conversation
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
|
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 was thinking we could add an args: -- -Aclippy::all -Wclippy::specific_lint_name
, and thus not need to change the actual source code (like the fmt job above).
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.
Right that's an option but might not be 100% intuitive to someone why their CI Build is failing when locally it isn't?
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.
@seanmonstar ^^ My concern is something will fail in CI and not locally .
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 have reverted the change to the main lib file , verified the build is green ! -> https://github.com/mastrzyz/hyperclip/actions/runs/3110424028/jobs/5041594746
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.
My concern is something will fail in CI and not locally .
I agree that changing the top level module would prevent this, but since we're allowing everything except self_named_module_files
, this should be fine.
Although now that I think about it, changing the top level module might not be a bad idea at all 😄
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.
Hm, I wonder, does this actually need to be -D
and not -W
? I suppose just a warning won't stop the CI job from exiting successfully. (I believe there's one instance in the repo that should be failing this lint, hence why I wrote the issue, but seems like the job is happy.)
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.
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.
Shouldn't we make it -D
? We want the CI job to fail, not just yell and then get forgotten.
(I would expect this to trigger a complaint about the ext.rs
module.)
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.
src/lib.rs
Outdated
#![allow( | ||
clippy::needless_borrow, | ||
clippy::module_inception, | ||
clippy::useless_format, | ||
clippy::redundant_clone, | ||
clippy::manual_non_exhaustive | ||
)] |
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.
We can avoid adding these lines directly into src/lib.rs
with an argument when we call clippy in CI, as in seanmonstar's comment
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.
Done!
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
|
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.
Right that's an option but might not be 100% intuitive to someone why their CI Build is failing when locally it isn't?
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
|
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.
@seanmonstar ^^ My concern is something will fail in CI and not locally .
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
|
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 have reverted the change to the main lib file , verified the build is green ! -> https://github.com/mastrzyz/hyperclip/actions/runs/3110424028/jobs/5041594746
Enables
Clippy
in the CI as a need of the top-levelci-pass
job.Resolution for #2977
Disabled the current violations :
And explicitly enabled the one requested one :
Result :
If we have a violation , we would see :