Skip to content
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

CI: Make clippy warnings trigger warnings instead of failures #338

Closed
Techcable opened this issue Sep 23, 2024 · 2 comments
Closed

CI: Make clippy warnings trigger warnings instead of failures #338

Techcable opened this issue Sep 23, 2024 · 2 comments
Assignees

Comments

@Techcable
Copy link
Member

Techcable commented Sep 23, 2024

For example, while working on PR #337 I triggered the clippy lint #[warn(clippy::std-instead-of-alloc)]

CI error log
error: used import from `std` instead of `alloc`
    --> src/lib.rs:2423:8
     |
2423 |     T: std::string::ToString + FromStr + PartialEq + fmt::Debug,
     |        ^^^^^^^^^^^^^^^^^^^^^
     |
     = help: consider importing the item from `alloc`
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_alloc
     = note: `-D clippy::std-instead-of-alloc` implied by `-D warnings`

error: used import from `std` instead of `core`
  --> src/tests.rs:37:14
   |
37 |         ) -> std::result::Result<Self::Ok, Self::Err> {
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider importing the item from `core`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core
   = note: `-D clippy::std-instead-of-core` implied by `-D warnings`

error: used import from `std` instead of `alloc`
  --> src/tests.rs:69:26
   |
69 |     struct TestError<E = std::string::ParseError>(&'static str, Option<E>);
   |                          ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider importing the item from `alloc`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_alloc

error: used import from `std` instead of `core`
   --> src/tests.rs:115:18
    |
115 |             ) -> std::result::Result<Self::Ok, Self::Err> {
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider importing the item from `core`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core

Ideally this would have triggered a github actions "warnings::" annotation instead of a hard failure.
This would still flag the issue without completely failing the build.

@Techcable Techcable self-assigned this Sep 23, 2024
Techcable added a commit to Techcable/slog that referenced this issue Sep 23, 2024
Makes clippy warnings trigger warnings instead of hard errors,
fixing issue slog-rs#338
Techcable added a commit to Techcable/slog that referenced this issue Sep 23, 2024
Makes clippy warnings trigger warnings instead of hard errors,
fixing issue slog-rs#338

HACK: Use my fork of auguwu/clippy-action to support "features" input.
Techcable added a commit to Techcable/slog that referenced this issue Sep 23, 2024
Makes clippy warnings trigger warnings instead of hard errors,
fixing issue slog-rs#338

HACK: Use my fork of auguwu/clippy-action to support "features" input.
Techcable added a commit to Techcable/slog that referenced this issue Sep 23, 2024
Makes clippy warnings trigger warnings instead of hard errors,
fixing issue slog-rs#338

HACK: Use my fork of auguwu/clippy-action to support "features" input.
Techcable added a commit to Techcable/slog that referenced this issue Sep 23, 2024
Makes clippy warnings trigger warnings instead of hard errors,
fixing issue slog-rs#338

HACK: Use my fork of auguwu/clippy-action to support "features" input.
@Techcable
Copy link
Member Author

This would be fixed by #339 but seems to have some downsides.

@Techcable
Copy link
Member Author

I realized that since we only fail on the "hardcoded recent version" triggering hard errors shouldn't happen unexpectedly due to clippy changes.

The only reason my changes triggered #[warn(clippy::std-instead-of-alloc)] was because I explicitly enabled that warning.

@Techcable Techcable closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant