diff options
| author | bors <bors@rust-lang.org> | 2022-04-07 17:11:26 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-04-07 17:11:26 +0000 |
| commit | 984330a6ee3c4d15626685d6dc8b7b759ff630bd (patch) | |
| tree | 009eda145dc08dc192be4f93f53c48a513a84c49 | |
| parent | abc59bb9144a97ec23d187dcb2cb28dd88271297 (diff) | |
| parent | 6ab4508350add2549b2f4b7b052057992a804128 (diff) | |
| download | rust-984330a6ee3c4d15626685d6dc8b7b759ff630bd.tar.gz rust-984330a6ee3c4d15626685d6dc8b7b759ff630bd.zip | |
Auto merge of #8657 - flip1995:raw_lint_desc, r=flip1995
Allow raw lint descriptions update_lints now understands raw strings in declare_clippy_lint descriptions. Supersedes #8655 cc `@Alexendoo` thanks for addressing this so quickly. I build a little bit simpler version of your patch. I don't think it really matters what `Literal` we're trying to tokenize, since we assume later, that it is some sort of `str`. changelog: none
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | clippy_dev/src/update_lints.rs | 5 | ||||
| -rw-r--r-- | clippy_lints/src/lib.register_all.rs | 1 | ||||
| -rw-r--r-- | clippy_lints/src/lib.register_lints.rs | 1 | ||||
| -rw-r--r-- | clippy_lints/src/lib.register_style.rs | 1 |
5 files changed, 8 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 918f0b48e50..b4097ea86a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3272,6 +3272,7 @@ Released 2018-09-13 [`eq_op`]: https://rust-lang.github.io/rust-clippy/master/index.html#eq_op [`equatable_if_let`]: https://rust-lang.github.io/rust-clippy/master/index.html#equatable_if_let [`erasing_op`]: https://rust-lang.github.io/rust-clippy/master/index.html#erasing_op +[`err_expect`]: https://rust-lang.github.io/rust-clippy/master/index.html#err_expect [`eval_order_dependence`]: https://rust-lang.github.io/rust-clippy/master/index.html#eval_order_dependence [`excessive_precision`]: https://rust-lang.github.io/rust-clippy/master/index.html#excessive_precision [`exhaustive_enums`]: https://rust-lang.github.io/rust-clippy/master/index.html#exhaustive_enums diff --git a/clippy_dev/src/update_lints.rs b/clippy_dev/src/update_lints.rs index 4e48b670457..59db51fbfac 100644 --- a/clippy_dev/src/update_lints.rs +++ b/clippy_dev/src/update_lints.rs @@ -359,7 +359,7 @@ fn parse_contents(contents: &str, module: &str, lints: &mut Vec<Lint>) { // group, Ident(group) Comma // "description" } - Literal{kind: LiteralKind::Str{..}, ..}(desc) CloseBrace + Literal{..}(desc) CloseBrace ); lints.push(Lint::new(name, group, desc, module)); } @@ -397,6 +397,9 @@ fn parse_deprecated_contents(contents: &str, lints: &mut Vec<DeprecatedLint>) { /// Removes the line splices and surrounding quotes from a string literal fn remove_line_splices(s: &str) -> String { let s = s + .strip_prefix('r') + .unwrap_or(s) + .trim_matches('#') .strip_prefix('"') .and_then(|s| s.strip_suffix('"')) .unwrap_or_else(|| panic!("expected quoted string, found `{}`", s)); diff --git a/clippy_lints/src/lib.register_all.rs b/clippy_lints/src/lib.register_all.rs index c95b791f43e..14ca93b5f3c 100644 --- a/clippy_lints/src/lib.register_all.rs +++ b/clippy_lints/src/lib.register_all.rs @@ -157,6 +157,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec