Allow allowing upper_case_acronyms on enum variants

This commit is contained in:
clubby789 2023-11-30 15:48:17 +00:00
parent 646b28f5f6
commit 2cda044f8c
4 changed files with 41 additions and 14 deletions

View file

@ -59,4 +59,12 @@ enum Yaml {
Str(String),
}
// test for issue #7708
enum AllowOnField {
Disallow,
//~^ ERROR: name `DISALLOW` contains a capitalized acronym
#[allow(clippy::upper_case_acronyms)]
ALLOW,
}
fn main() {}

View file

@ -59,4 +59,12 @@ enum YAML {
Str(String),
}
// test for issue #7708
enum AllowOnField {
DISALLOW,
//~^ ERROR: name `DISALLOW` contains a capitalized acronym
#[allow(clippy::upper_case_acronyms)]
ALLOW,
}
fn main() {}

View file

@ -67,5 +67,11 @@ error: name `YAML` contains a capitalized acronym
LL | enum YAML {
| ^^^^ help: consider making the acronym lowercase, except the initial letter: `Yaml`
error: aborting due to 11 previous errors
error: name `DISALLOW` contains a capitalized acronym
--> $DIR/upper_case_acronyms.rs:64:5
|
LL | DISALLOW,
| ^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Disallow`
error: aborting due to 12 previous errors