Skip to content

Conversation

@nyurik
Copy link
Contributor

@nyurik nyurik commented Apr 9, 2025

Running this command showed a list of all lints across all crates:

cargo clippy --all-targets --workspace --message-format=json --quiet | jq -r '.message.code.code | select(. != null and startswith("clippy::"))' | sort | uniq -c | sort -h -r

This resulted in a list that I added to the [workspace.lints.clippy] in the root Cargo.toml. Afterwards, I commented out a few simpler lints. Subsequentely, I will go through this list, trying to address items in smaller batches.

Notes

  • This should result in faster string formatting - because now it uses write! instead of creating temp strings
  • I kept the commented out lints in the Cargo.toml list just for now, but it should be cleaned up in sunsequent PRs.
  • there is a minor bugfix in dd.rs - the non-linux cfg was incorrectly used. It was still a noop, so non-consequential
  • Turns out there is a bug in the toml parser when dealing with long lines - Long lines with comments crash the LSP tamasfe/taplo#741

@nyurik nyurik changed the title fix a low-count lints in all crates fix low-count lints in all crates Apr 9, 2025
@nyurik nyurik force-pushed the clippy-all branch 7 times, most recently from bc5fd3d to 0e600ba Compare April 9, 2025 19:48
@github-actions
Copy link

github-actions bot commented Apr 9, 2025

GNU testsuite comparison:

Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

github-actions bot commented Apr 9, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@nyurik nyurik force-pushed the clippy-all branch 2 times, most recently from 9a12867 to de38959 Compare April 11, 2025 04:41
@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/misc/tee is no longer failing!

Running this command showed a list of all lints across all crates:

```shell
cargo clippy --all-targets --workspace --message-format=json --quiet | jq -r '.message.code.code | select(. != null and startswith("clippy::"))' | sort | uniq -c | sort -h -r
```

This resulted in a list that I added to the `[workspace.lints.clippy]` in the root Cargo.toml. Afterwards, I commented out a few simpler lints. Subsequentely, I will go through this list, trying to address items in smaller batches.
@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)

all = { level = "warn", priority = -1 }
cargo = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
cargo_common_metadata = "allow" # 3240
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why keeping these numbers? They will be outdated tomorrow

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sylvestre I use these numbers to guide which one I fix next - at which point I remove the entire line, not just the comment

}));
}
#[cfg(target_os = "linux")]
#[cfg(not(target_os = "linux"))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it changed the behavior, no ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sylvestre correct - I am pretty certain this was a bug in the code. Note that the code block is actually a noop, so it didn't show up in any testing, but this change makes sure that when code is added, it will be correctly compiled

@sylvestre sylvestre merged commit a067b58 into uutils:main Apr 14, 2025
69 checks passed
@nyurik nyurik deleted the clippy-all branch April 14, 2025 20:09
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

Successfully merging this pull request may close these issues.

2 participants