rust-lang / rust-clippy

A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/
https://rust-lang.github.io/rust-clippy/
Other
10.89k stars 1.46k forks source link

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

Closed roddyrap closed 4 days ago

roddyrap commented 2 weeks ago

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

Version

No response

Additional Labels

No response