2023-07-27 06:40:22 -05:00
|
|
|
#![warn(clippy::upper_case_acronyms)]
|
|
|
|
|
|
|
|
struct HTTPResponse; // not linted by default, but with cfg option
|
|
|
|
|
|
|
|
struct CString; // not linted
|
|
|
|
|
|
|
|
enum Flags {
|
|
|
|
NS, // not linted
|
|
|
|
Cwr,
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: name `CWR` contains a capitalized acronym
|
|
|
|
//~| NOTE: `-D clippy::upper-case-acronyms` implied by `-D warnings`
|
2023-07-27 06:40:22 -05:00
|
|
|
Ece,
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: name `ECE` contains a capitalized acronym
|
2023-07-27 06:40:22 -05:00
|
|
|
Urg,
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: name `URG` contains a capitalized acronym
|
2023-07-27 06:40:22 -05:00
|
|
|
Ack,
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: name `ACK` contains a capitalized acronym
|
2023-07-27 06:40:22 -05:00
|
|
|
Psh,
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: name `PSH` contains a capitalized acronym
|
2023-07-27 06:40:22 -05:00
|
|
|
Rst,
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: name `RST` contains a capitalized acronym
|
2023-07-27 06:40:22 -05:00
|
|
|
Syn,
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: name `SYN` contains a capitalized acronym
|
2023-07-27 06:40:22 -05:00
|
|
|
Fin,
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: name `FIN` contains a capitalized acronym
|
2023-07-27 06:40:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// linted with cfg option, beware that lint suggests `GccllvmSomething` instead of
|
|
|
|
// `GccLlvmSomething`
|
|
|
|
struct GCCLLVMSomething;
|
|
|
|
|
|
|
|
// public items must not be linted
|
|
|
|
pub struct NOWARNINGHERE;
|
|
|
|
pub struct ALSONoWarningHERE;
|
|
|
|
|
|
|
|
// enum variants should not be linted if the num is pub
|
|
|
|
pub enum ParseError<T> {
|
|
|
|
YDB(u8),
|
|
|
|
Utf8(std::string::FromUtf8Error),
|
|
|
|
Parse(T, String),
|
|
|
|
}
|
|
|
|
|
|
|
|
// private, do lint here
|
|
|
|
enum ParseErrorPrivate<T> {
|
|
|
|
Wasd(u8),
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: name `WASD` contains a capitalized acronym
|
2023-07-27 06:40:22 -05:00
|
|
|
Utf8(std::string::FromUtf8Error),
|
|
|
|
Parse(T, String),
|
|
|
|
}
|
|
|
|
|
|
|
|
// do lint here
|
|
|
|
struct Json;
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: name `JSON` contains a capitalized acronym
|
2023-07-27 06:40:22 -05:00
|
|
|
|
|
|
|
// do lint here
|
|
|
|
enum Yaml {
|
2023-07-28 14:35:48 -05:00
|
|
|
//~^ ERROR: name `YAML` contains a capitalized acronym
|
2023-07-27 06:40:22 -05:00
|
|
|
Num(u32),
|
|
|
|
Str(String),
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|