2020-12-19 13:50:45 +00:00
|
|
|
#![warn(clippy::upper_case_acronyms)]
|
|
|
|
|
2021-02-24 22:41:32 +00:00
|
|
|
struct HTTPResponse; // not linted by default, but with cfg option
|
2020-12-19 13:50:45 +00:00
|
|
|
|
|
|
|
struct CString; // not linted
|
|
|
|
|
|
|
|
enum Flags {
|
2021-02-24 22:41:32 +00:00
|
|
|
NS, // not linted
|
2020-12-19 13:50:45 +00:00
|
|
|
CWR,
|
2023-07-28 19:35:48 +00:00
|
|
|
//~^ ERROR: name `CWR` contains a capitalized acronym
|
|
|
|
//~| NOTE: `-D clippy::upper-case-acronyms` implied by `-D warnings`
|
2020-12-19 13:50:45 +00:00
|
|
|
ECE,
|
2023-07-28 19:35:48 +00:00
|
|
|
//~^ ERROR: name `ECE` contains a capitalized acronym
|
2020-12-19 13:50:45 +00:00
|
|
|
URG,
|
2023-07-28 19:35:48 +00:00
|
|
|
//~^ ERROR: name `URG` contains a capitalized acronym
|
2020-12-19 13:50:45 +00:00
|
|
|
ACK,
|
2023-07-28 19:35:48 +00:00
|
|
|
//~^ ERROR: name `ACK` contains a capitalized acronym
|
2020-12-19 13:50:45 +00:00
|
|
|
PSH,
|
2023-07-28 19:35:48 +00:00
|
|
|
//~^ ERROR: name `PSH` contains a capitalized acronym
|
2020-12-19 13:50:45 +00:00
|
|
|
RST,
|
2023-07-28 19:35:48 +00:00
|
|
|
//~^ ERROR: name `RST` contains a capitalized acronym
|
2020-12-19 13:50:45 +00:00
|
|
|
SYN,
|
2023-07-28 19:35:48 +00:00
|
|
|
//~^ ERROR: name `SYN` contains a capitalized acronym
|
2020-12-19 13:50:45 +00:00
|
|
|
FIN,
|
2023-07-28 19:35:48 +00:00
|
|
|
//~^ ERROR: name `FIN` contains a capitalized acronym
|
2020-12-19 13:50:45 +00:00
|
|
|
}
|
|
|
|
|
2021-03-01 17:53:33 +00:00
|
|
|
// linted with cfg option, beware that lint suggests `GccllvmSomething` instead of
|
|
|
|
// `GccLlvmSomething`
|
|
|
|
struct GCCLLVMSomething;
|
2020-12-19 13:50:45 +00:00
|
|
|
|
2021-02-26 20:22:30 +00:00
|
|
|
// public items must not be linted
|
|
|
|
pub struct NOWARNINGHERE;
|
|
|
|
pub struct ALSONoWarningHERE;
|
|
|
|
|
2021-03-26 23:52:49 +00:00
|
|
|
// 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 19:35:48 +00:00
|
|
|
//~^ ERROR: name `WASD` contains a capitalized acronym
|
2021-03-26 23:52:49 +00:00
|
|
|
Utf8(std::string::FromUtf8Error),
|
|
|
|
Parse(T, String),
|
|
|
|
}
|
|
|
|
|
2022-10-03 02:11:57 +00:00
|
|
|
// do lint here
|
|
|
|
struct JSON;
|
2023-07-28 19:35:48 +00:00
|
|
|
//~^ ERROR: name `JSON` contains a capitalized acronym
|
2022-10-03 02:11:57 +00:00
|
|
|
|
|
|
|
// do lint here
|
|
|
|
enum YAML {
|
2023-07-28 19:35:48 +00:00
|
|
|
//~^ ERROR: name `YAML` contains a capitalized acronym
|
2022-10-03 02:11:57 +00:00
|
|
|
Num(u32),
|
|
|
|
Str(String),
|
|
|
|
}
|
|
|
|
|
2020-12-19 13:50:45 +00:00
|
|
|
fn main() {}
|