Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

clippy: fix clippy::unnecessary_debug_formatting and clippy::io_other_error, adjusting cp tests to align with GNU #7941

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

Closed
wants to merge 2 commits into from

Conversation

Qelxiros
Copy link
Contributor

On my machine cp a returns the error message cp: missing destination file operand after 'a'. Prior to this PR, uutils double quoted the a. This PR uses Path::display instead of Debug output and quotes the file path with os_display. I also fixed an io::Error-related clippy warning in ln.

Copy link

GNU testsuite comparison:

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

@cakebaker
Copy link
Contributor

cakebaker commented May 16, 2025

Can you please split this PR into two PRs: one for fixing the clippy errors introduced with Rust 1.87 and one for adjusting the cp tests to align with GNU? Thanks!

@cakebaker
Copy link
Contributor

Please ignore my previous comment, I was wrong about this PR. I should have looked at the actual changes, not just the title :|

@Qelxiros
Copy link
Contributor Author

So the MSRV check here is failing because Path::display didn't get stabilized until 1.87.0, but the clippy checks in e.g. #7940 are failing because they use the latest rust version and deny warnings. @sylvestre do you have thoughts on how to fix this? Has it happened before? Could we change the clippy checks to use MSRV instead of latest? We'd get new checks more slowly, but we wouldn't end up with mutually exclusive checks like we have here.

Side note: I don't think I understand the clippy command. clippy::unnecessary_debug_formatting is in pedantic and allowed by default, and I didn't see anything in the workflow file that looked like it would enable it. So maybe there's another solution (at least for this case) involving the specific arguments we pass to clippy.

Copy link

GNU testsuite comparison:

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

@cakebaker
Copy link
Contributor

An alternative is to change the level for pedantic from warn to allow in Cargo.toml.

@Qelxiros
Copy link
Contributor Author

I thought about that, but according to #6720 (review), there are several pedantic lints that we (or at least @tertsdiepraam) would want to enforce across the board. (I checked, and the only one that fails on main is uninlined_format_args in one case.)

Looking at the top-level Cargo.toml, it looks like we might be able to add unnecessary_debug_formatting = "allow" to [workspace.lints.clippy] until MSRV is 1.87.0.

@tertsdiepraam
Copy link
Member

Just to be clear, in that issue, I would accept the changes suggested by the lint, not necessarily the enforcing of the lint.

@cakebaker
Copy link
Contributor

Closing this PR, some of its changes have been included in #7957. Thanks!

@cakebaker cakebaker closed this May 19, 2025
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.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.