Skip to main content

forge_lint/sol/info/
mod.rs

1use crate::sol::SolLint;
2
3mod boolean_cst;
4mod boolean_equal;
5mod cyclomatic_complexity;
6mod event_fields;
7mod function_init_state;
8mod imports;
9mod incorrect_using_for;
10mod inline_assembly;
11mod interface_naming;
12mod internal_function_used_once;
13mod literal_instead_of_constant;
14mod low_level_calls;
15mod missing_inheritance;
16mod mixed_case;
17mod modifier_used_only_once;
18mod multi_contract_file;
19mod named_struct_fields;
20mod pascal_case;
21mod pragma_directive;
22mod redundant_base_constructor_call;
23mod screaming_snake_case;
24mod todo;
25mod too_many_digits;
26mod unsafe_cheatcodes;
27mod unused_error;
28
29register_lints!(
30    boolean_cst: (BooleanCst, early, (BOOLEAN_CST));
31    boolean_equal: (BooleanEqual, early, (BOOLEAN_EQUAL));
32    pascal_case: (PascalCaseStruct, early, (PASCAL_CASE_STRUCT), PascalCaseStructPass::new);
33    screaming_snake_case: (
34        ScreamingSnakeCase,
35        early,
36        (SCREAMING_SNAKE_CASE_CONSTANT, SCREAMING_SNAKE_CASE_IMMUTABLE)
37    );
38    mixed_case:
39        (MixedCaseVariable, early, (MIXED_CASE_VARIABLE), MixedCaseVariablePass::new),
40        (MixedCaseFunction, early, (MIXED_CASE_FUNCTION), MixedCaseFunctionPass::new);
41    imports: (Imports, early, (UNALIASED_PLAIN_IMPORT, UNUSED_IMPORT));
42    named_struct_fields: (NamedStructFields, late, (NAMED_STRUCT_FIELDS));
43    unsafe_cheatcodes: (UnsafeCheatcodes, early, (UNSAFE_CHEATCODE_USAGE));
44    multi_contract_file:
45        (MultiContractFile, early, (MULTI_CONTRACT_FILE), MultiContractFilePass::new);
46    interface_naming: (InterfaceFileNaming, early, (INTERFACE_FILE_NAMING, INTERFACE_NAMING));
47    too_many_digits: (TooManyDigits, early, (TOO_MANY_DIGITS));
48    pragma_directive: (PragmaDirective, project, (PRAGMA_INCONSISTENT));
49    inline_assembly: (InlineAssembly, early, (INLINE_ASSEMBLY));
50    low_level_calls: (LowLevelCalls, early, (LOW_LEVEL_CALLS));
51    redundant_base_constructor_call:
52        (RedundantBaseConstructorCall, late, (REDUNDANT_BASE_CONSTRUCTOR_CALL));
53    missing_inheritance: (MissingInheritance, project, (MISSING_INHERITANCE));
54    event_fields: (EventFields, early, (EVENT_FIELDS));
55    todo: (TodoComment, early, (TODO_COMMENT));
56    unused_error: (UnusedError, project, (UNUSED_ERROR));
57    literal_instead_of_constant: (LiteralInsteadOfConstant, late, (LITERAL_INSTEAD_OF_CONSTANT));
58    function_init_state: (FunctionInitState, late, (FUNCTION_INIT_STATE));
59    internal_function_used_once: (InternalFunctionUsedOnce, project, (INTERNAL_FUNCTION_USED_ONCE));
60    cyclomatic_complexity: (CyclomaticComplexity, late, (CYCLOMATIC_COMPLEXITY));
61    incorrect_using_for: (IncorrectUsingFor, late, (INCORRECT_USING_FOR));
62    modifier_used_only_once: (ModifierUsedOnlyOnce, project, (MODIFIER_USED_ONLY_ONCE));
63);