Skip to main content

forge_lint/sol/info/
mod.rs

1use crate::sol::SolLint;
2
3mod mixed_case;
4use mixed_case::{
5    MIXED_CASE_FUNCTION, MIXED_CASE_VARIABLE, MixedCaseFunctionPass, MixedCaseVariablePass,
6};
7
8mod boolean_cst;
9use boolean_cst::BOOLEAN_CST;
10
11mod boolean_equal;
12use boolean_equal::BOOLEAN_EQUAL;
13
14mod pascal_case;
15use pascal_case::PASCAL_CASE_STRUCT;
16
17mod screaming_snake_case;
18use screaming_snake_case::{SCREAMING_SNAKE_CASE_CONSTANT, SCREAMING_SNAKE_CASE_IMMUTABLE};
19
20mod imports;
21use imports::{UNALIASED_PLAIN_IMPORT, UNUSED_IMPORT};
22
23mod named_struct_fields;
24use named_struct_fields::NAMED_STRUCT_FIELDS;
25
26mod unsafe_cheatcodes;
27use unsafe_cheatcodes::UNSAFE_CHEATCODE_USAGE;
28
29mod multi_contract_file;
30use multi_contract_file::{MULTI_CONTRACT_FILE, MultiContractFilePass};
31
32mod interface_naming;
33use interface_naming::{INTERFACE_FILE_NAMING, INTERFACE_NAMING};
34
35mod too_many_digits;
36use too_many_digits::TOO_MANY_DIGITS;
37
38mod pragma_directive;
39use pragma_directive::PRAGMA_INCONSISTENT;
40
41mod inline_assembly;
42use inline_assembly::INLINE_ASSEMBLY;
43
44mod low_level_calls;
45use low_level_calls::LOW_LEVEL_CALLS;
46
47mod redundant_base_constructor_call;
48use redundant_base_constructor_call::REDUNDANT_BASE_CONSTRUCTOR_CALL;
49
50mod missing_inheritance;
51use missing_inheritance::MISSING_INHERITANCE;
52
53mod event_fields;
54use event_fields::EVENT_FIELDS;
55
56mod todo;
57use todo::TODO_COMMENT;
58
59mod unused_error;
60use unused_error::UNUSED_ERROR;
61
62mod literal_instead_of_constant;
63use literal_instead_of_constant::LITERAL_INSTEAD_OF_CONSTANT;
64
65mod function_init_state;
66use function_init_state::FUNCTION_INIT_STATE;
67
68mod internal_function_used_once;
69use internal_function_used_once::INTERNAL_FUNCTION_USED_ONCE;
70
71mod cyclomatic_complexity;
72use cyclomatic_complexity::CYCLOMATIC_COMPLEXITY;
73
74mod incorrect_using_for;
75use incorrect_using_for::INCORRECT_USING_FOR;
76
77mod modifier_used_only_once;
78use modifier_used_only_once::MODIFIER_USED_ONLY_ONCE;
79
80register_lints!(
81    (BooleanCst, early, (BOOLEAN_CST)),
82    (BooleanEqual, early, (BOOLEAN_EQUAL)),
83    (PascalCaseStruct, early, (PASCAL_CASE_STRUCT)),
84    (MixedCaseVariable, early, (MIXED_CASE_VARIABLE), MixedCaseVariablePass::new),
85    (MixedCaseFunction, early, (MIXED_CASE_FUNCTION), MixedCaseFunctionPass::new),
86    (ScreamingSnakeCase, early, (SCREAMING_SNAKE_CASE_CONSTANT, SCREAMING_SNAKE_CASE_IMMUTABLE)),
87    (Imports, early, (UNALIASED_PLAIN_IMPORT, UNUSED_IMPORT)),
88    (NamedStructFields, late, (NAMED_STRUCT_FIELDS)),
89    (UnsafeCheatcodes, early, (UNSAFE_CHEATCODE_USAGE)),
90    (MultiContractFile, early, (MULTI_CONTRACT_FILE), MultiContractFilePass::new),
91    (InterfaceFileNaming, early, (INTERFACE_FILE_NAMING, INTERFACE_NAMING)),
92    (TooManyDigits, early, (TOO_MANY_DIGITS)),
93    (PragmaDirective, project, (PRAGMA_INCONSISTENT)),
94    (InlineAssembly, early, (INLINE_ASSEMBLY)),
95    (LowLevelCalls, early, (LOW_LEVEL_CALLS)),
96    (RedundantBaseConstructorCall, late, (REDUNDANT_BASE_CONSTRUCTOR_CALL)),
97    (MissingInheritance, project, (MISSING_INHERITANCE)),
98    (EventFields, early, (EVENT_FIELDS)),
99    (TodoComment, early, (TODO_COMMENT)),
100    (UnusedError, project, (UNUSED_ERROR)),
101    (LiteralInsteadOfConstant, late, (LITERAL_INSTEAD_OF_CONSTANT)),
102    (FunctionInitState, late, (FUNCTION_INIT_STATE)),
103    (InternalFunctionUsedOnce, project, (INTERNAL_FUNCTION_USED_ONCE)),
104    (CyclomaticComplexity, late, (CYCLOMATIC_COMPLEXITY)),
105    (IncorrectUsingFor, late, (INCORRECT_USING_FOR)),
106    (ModifierUsedOnlyOnce, project, (MODIFIER_USED_ONLY_ONCE)),
107);