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

Clippy lints website doesn't replace dashes with underscores more than once #12718

Closed
roddyrap opened this issue Apr 26, 2024 · 0 comments · Fixed by #12719
Closed

Clippy lints website doesn't replace dashes with underscores more than once #12718

roddyrap opened this issue Apr 26, 2024 · 0 comments · Fixed by #12719
Labels
C-bug Category: Clippy is not doing the correct thing

Comments

@roddyrap
Copy link
Contributor

Summary

The clippy lints website can search for lints. The search function knows to replace dashes with underscores (As the lints on the website are written with underscores, but in other tools and usages they may be written with dashes) but, due to a mistake in the Javascript website code, the replace operation happens only once.

This means that if the lint name is copied from another tool and has more than two words separated by dashes, the website will not find a matching lint even if it exists, because the replace method call is erroneous.

I have tried to fix the method call to replaceAll by modifying the JS source and can verify that the solution works, so I will submit a PR soon.

Reproducer

  • Open the clippy lints website (I specifically use the master reference but I suppose any other reference will work).
  • Search for a lint with more than two words. Separate the words with dashes and not underscores.

Version

No response

Additional Labels

No response

@roddyrap roddyrap added the C-bug Category: Clippy is not doing the correct thing label Apr 26, 2024
roddyrap added a commit to roddyrap/rust-clippy that referenced this issue Apr 26, 2024
Searching for a lint on the website will replace all of the dashes with
underscores instead of only the first one.
@bors bors closed this as completed in 9abaf91 May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant