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

change literal_string_with_formatting_args lint category to nursery #14014

Conversation

anatawa12
Copy link
Contributor

@anatawa12 anatawa12 commented Jan 17, 2025

This PR changes literal_string_with_formatting_args category from suspicious to nursery since there are thousands of false positive on GitHub.

Closes #13989 since it's no longer problematic with such false positive with pedantic nursery category.

changelog: [literal_string_with_formatting_args ] change category to nursery from suspicious

@rustbot
Copy link
Collaborator

rustbot commented Jan 17, 2025

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Alexendoo (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 17, 2025
@samueltardieu
Copy link
Contributor

Note that most of those false positives should be fixed by #13953.

@GuillaumeGomez
Copy link
Member

Let's check what false positives remain once #13953 is merged indeed. The remaining ones might still be bugs.

@anatawa12
Copy link
Contributor Author

I tried #13953 (277bf08) and I can see false positive cause I showed in #13989 is not fixed by #13953

@y21
Copy link
Member

y21 commented Jan 18, 2025

I'm of the same opinion that we should probably change this lint's category for the time being even if the PR fixes some of them. It's already in beta and some of the bugs don't seem to have an obvious fix and probably require some "design work" (e.g. the ones involving .replace("{var}", var) -- it's not technically wrong that it looks like a format string but thousands of false positives is too much IMO). I don't know about pedantic though - typically the category for buggy lints is nursery. People do use #![warn(clippy::pedantic)].

There's nothing wrong with having it in nursery temporarily, but having it warn-by-default while it's buggy means lots of people will allow the lint and will later not catch potential errors.

@Alexendoo
Copy link
Member

I agree, let's put it in nursery until we're confident the true positives significantly outweigh the false ones

@GuillaumeGomez
Copy link
Member

Didn't think about moving it to nursery. Good idea.

@anatawa12 anatawa12 changed the title change literal_string_with_formatting_args lint category to pedantic change literal_string_with_formatting_args lint category to nursery Jan 19, 2025
@anatawa12
Copy link
Contributor Author

I thought pedantic lints have many false positives, but I checked existing lints now and I saw those are much less possibility for false positives than this so I agree with change to nursery. I made this PR to change to nursery.

@Alexendoo Alexendoo added this pull request to the merge queue Jan 19, 2025
@Alexendoo Alexendoo added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 19, 2025
Merged via the queue into rust-lang:master with commit e692cd4 Jan 19, 2025
14 of 15 checks passed
@anatawa12 anatawa12 deleted the literal_string_with_formatting_args-pedantic branch January 19, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-nominated Nominated for backporting to the compiler in the beta channel. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive literal_string_with_formatting_args for non-static templete string expansion with replace.
6 participants