]> git.lizzy.rs Git - rust.git/commit
Auto merge of #6105 - bugadani:sus-char, r=ebroto
authorbors <bors@rust-lang.org>
Fri, 2 Oct 2020 22:22:37 +0000 (22:22 +0000)
committerbors <bors@rust-lang.org>
Fri, 2 Oct 2020 22:22:37 +0000 (22:22 +0000)
commit9408c68c1da55f8a47cb21e761953db30aea3d39
tree16d6b2bc1de296ef13e000c7cf79cc8956aa8e58
parenta1a7f20b4c5edff108a7c46e8641580bbf862362
parent572e4c4837e5f955cdc3751b9ad63f0bfb86beac
Auto merge of #6105 - bugadani:sus-char, r=ebroto

Lint for invisible Unicode characters other than ZWSP

This PR extends the existing `zero_width_space` lint to look for other invisible characters as well (in this case, `\\u{ad}` soft hyphen.

I feel like this lint is the logical place to add the check, but I also realize the lint name is not particularly flexible, but I also understand that it shouldn't be renamed for compatibility reasons.

Open questions:
 - What other characters should trigger the lint?
 - What should be done with the lint name?
 - How to indicate the change in functionality?

Motivation behind this PR: https://github.com/rust-lang/rust/issues/77417 - I managed to shoot myself in the foot by an invisible character pasted into my test case.

changelog: rename [`zero_width_space`] to [`invisible_characters`] and add SHY and WJ to the list.
clippy_lints/src/lib.rs
src/lintlist/mod.rs