Skip to main content

forge_lint/sol/info/
mod.rs

1use crate::sol::{EarlyLintPass, LateLintPass, SolLint};
2
3mod mixed_case;
4use mixed_case::{MIXED_CASE_FUNCTION, MIXED_CASE_VARIABLE};
5
6mod boolean_cst;
7use boolean_cst::BOOLEAN_CST;
8
9mod boolean_equal;
10use boolean_equal::BOOLEAN_EQUAL;
11
12mod pascal_case;
13use pascal_case::PASCAL_CASE_STRUCT;
14
15mod screaming_snake_case;
16use screaming_snake_case::{SCREAMING_SNAKE_CASE_CONSTANT, SCREAMING_SNAKE_CASE_IMMUTABLE};
17
18mod imports;
19use imports::{UNALIASED_PLAIN_IMPORT, UNUSED_IMPORT};
20
21mod named_struct_fields;
22use named_struct_fields::NAMED_STRUCT_FIELDS;
23
24mod unsafe_cheatcodes;
25use unsafe_cheatcodes::UNSAFE_CHEATCODE_USAGE;
26
27mod multi_contract_file;
28use multi_contract_file::MULTI_CONTRACT_FILE;
29
30mod interface_naming;
31use interface_naming::{INTERFACE_FILE_NAMING, INTERFACE_NAMING};
32
33mod too_many_digits;
34use too_many_digits::TOO_MANY_DIGITS;
35
36mod pragma_directive;
37use pragma_directive::PRAGMA_INCONSISTENT;
38
39mod inline_assembly;
40use inline_assembly::INLINE_ASSEMBLY;
41
42mod low_level_calls;
43use low_level_calls::LOW_LEVEL_CALLS;
44
45mod redundant_base_constructor_call;
46use redundant_base_constructor_call::REDUNDANT_BASE_CONSTRUCTOR_CALL;
47
48mod missing_inheritance;
49use missing_inheritance::MISSING_INHERITANCE;
50
51mod event_fields;
52use event_fields::EVENT_FIELDS;
53
54register_lints!(
55    (BooleanCst, early, (BOOLEAN_CST)),
56    (BooleanEqual, early, (BOOLEAN_EQUAL)),
57    (PascalCaseStruct, early, (PASCAL_CASE_STRUCT)),
58    (MixedCaseVariable, early, (MIXED_CASE_VARIABLE)),
59    (MixedCaseFunction, early, (MIXED_CASE_FUNCTION)),
60    (ScreamingSnakeCase, early, (SCREAMING_SNAKE_CASE_CONSTANT, SCREAMING_SNAKE_CASE_IMMUTABLE)),
61    (Imports, early, (UNALIASED_PLAIN_IMPORT, UNUSED_IMPORT)),
62    (NamedStructFields, late, (NAMED_STRUCT_FIELDS)),
63    (UnsafeCheatcodes, early, (UNSAFE_CHEATCODE_USAGE)),
64    (MultiContractFile, early, (MULTI_CONTRACT_FILE)),
65    (InterfaceFileNaming, early, (INTERFACE_FILE_NAMING, INTERFACE_NAMING)),
66    (TooManyDigits, early, (TOO_MANY_DIGITS)),
67    (PragmaDirective, project, (PRAGMA_INCONSISTENT)),
68    (InlineAssembly, early, (INLINE_ASSEMBLY)),
69    (LowLevelCalls, early, (LOW_LEVEL_CALLS)),
70    (RedundantBaseConstructorCall, late, (REDUNDANT_BASE_CONSTRUCTOR_CALL)),
71    (MissingInheritance, project, (MISSING_INHERITANCE)),
72    (EventFields, early, (EVENT_FIELDS)),
73);