|
3 | 3 | # This configuration file specifies the rules and their strictness levels |
4 | 4 | # for static code analysis with Credo. |
5 | 5 | # |
6 | | -# Run with: mix credo --strict |
| 6 | +# Run with: mix credo |
7 | 7 | %{ |
8 | 8 | configs: [ |
| 9 | + # ========================================================================== |
| 10 | + # Strict checks for library source files only |
| 11 | + # ========================================================================== |
9 | 12 | %{ |
10 | 13 | name: "default", |
11 | 14 | files: %{ |
12 | 15 | included: [ |
13 | | - "lib/", |
14 | | - "test/" |
| 16 | + "lib/" |
15 | 17 | ], |
16 | 18 | excluded: [ |
17 | 19 | ~r"/_build/", |
|
21 | 23 | }, |
22 | 24 | plugins: [], |
23 | 25 | requires: [], |
24 | | - strict: true, |
| 26 | + strict: false, |
25 | 27 | parse_timeout: 5000, |
26 | 28 | color: true, |
27 | 29 | checks: %{ |
|
35 | 37 | {Credo.Check.Consistency.SpaceAroundOperators, []}, |
36 | 38 | {Credo.Check.Consistency.SpaceInParentheses, []}, |
37 | 39 | {Credo.Check.Consistency.TabsOrSpaces, []}, |
38 | | - {Credo.Check.Consistency.UnusedVariableNames, []}, |
| 40 | + {Credo.Check.Consistency.UnusedVariableNames, [priority: :low]}, |
39 | 41 |
|
40 | 42 | # ========================================================================== |
41 | 43 | # Design Checks |
|
56 | 58 | {Credo.Check.Readability.AliasOrder, []}, |
57 | 59 | {Credo.Check.Readability.BlockPipe, []}, |
58 | 60 | {Credo.Check.Readability.FunctionNames, []}, |
59 | | - {Credo.Check.Readability.ImplTrue, []}, |
60 | | - {Credo.Check.Readability.LargeNumbers, []}, |
| 61 | + {Credo.Check.Readability.ImplTrue, [priority: :low]}, |
| 62 | + {Credo.Check.Readability.LargeNumbers, [priority: :low]}, |
61 | 63 | {Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]}, |
62 | 64 | {Credo.Check.Readability.ModuleAttributeNames, []}, |
63 | 65 | {Credo.Check.Readability.ModuleDoc, []}, |
|
66 | 68 | {Credo.Check.Readability.ParenthesesInCondition, []}, |
67 | 69 | {Credo.Check.Readability.ParenthesesOnZeroArityDefs, []}, |
68 | 70 | {Credo.Check.Readability.PipeIntoAnonymousFunctions, []}, |
69 | | - {Credo.Check.Readability.PredicateFunctionNames, []}, |
| 71 | + {Credo.Check.Readability.PredicateFunctionNames, [priority: :low]}, |
70 | 72 | {Credo.Check.Readability.PreferImplicitTry, []}, |
71 | 73 | {Credo.Check.Readability.RedundantBlankLines, []}, |
72 | 74 | {Credo.Check.Readability.Semicolons, []}, |
73 | 75 | {Credo.Check.Readability.SeparateAliasRequire, []}, |
74 | 76 | {Credo.Check.Readability.SingleFunctionToBlockPipe, []}, |
75 | | - {Credo.Check.Readability.SinglePipe, []}, |
| 77 | + {Credo.Check.Readability.SinglePipe, [priority: :low]}, |
76 | 78 | {Credo.Check.Readability.SpaceAfterCommas, []}, |
77 | 79 | {Credo.Check.Readability.Specs, [priority: :low]}, |
78 | 80 | {Credo.Check.Readability.StrictModuleLayout, [priority: :low]}, |
|
90 | 92 | {Credo.Check.Refactor.CondStatements, []}, |
91 | 93 | {Credo.Check.Refactor.CyclomaticComplexity, [max_complexity: 15]}, |
92 | 94 | {Credo.Check.Refactor.DoubleBooleanNegation, []}, |
93 | | - {Credo.Check.Refactor.FilterCount, []}, |
| 95 | + {Credo.Check.Refactor.FilterCount, [priority: :low]}, |
94 | 96 | {Credo.Check.Refactor.FilterFilter, []}, |
95 | 97 | {Credo.Check.Refactor.FilterReject, []}, |
96 | 98 | {Credo.Check.Refactor.FunctionArity, [max_arity: 8]}, |
97 | 99 | {Credo.Check.Refactor.IoPuts, []}, |
98 | 100 | {Credo.Check.Refactor.LongQuoteBlocks, []}, |
99 | | - {Credo.Check.Refactor.MapJoin, []}, |
| 101 | + {Credo.Check.Refactor.MapJoin, [priority: :low]}, |
100 | 102 | {Credo.Check.Refactor.MapMap, []}, |
101 | 103 | {Credo.Check.Refactor.MatchInCondition, []}, |
102 | 104 | {Credo.Check.Refactor.ModuleDependencies, [priority: :low, max_deps: 25]}, |
103 | 105 | {Credo.Check.Refactor.NegatedConditionsInUnless, []}, |
104 | 106 | {Credo.Check.Refactor.NegatedConditionsWithElse, []}, |
105 | 107 | {Credo.Check.Refactor.Nesting, [max_nesting: 4]}, |
106 | 108 | {Credo.Check.Refactor.PassAsyncInTestCases, []}, |
107 | | - {Credo.Check.Refactor.PipeChainStart, []}, |
| 109 | + {Credo.Check.Refactor.PipeChainStart, [priority: :low]}, |
108 | 110 | {Credo.Check.Refactor.RedundantWithClauseResult, []}, |
109 | 111 | {Credo.Check.Refactor.RejectFilter, []}, |
110 | 112 | {Credo.Check.Refactor.RejectReject, []}, |
111 | 113 | {Credo.Check.Refactor.UnlessWithElse, []}, |
112 | 114 | {Credo.Check.Refactor.WithClauses, []}, |
113 | 115 |
|
114 | 116 | # ========================================================================== |
115 | | - # Warning Checks |
| 117 | + # Warning Checks (most important - these indicate real problems) |
116 | 118 | # ========================================================================== |
117 | 119 | {Credo.Check.Warning.ApplicationConfigInModuleAttribute, []}, |
118 | 120 | {Credo.Check.Warning.BoolOperationOnSameValues, []}, |
|
142 | 144 | {Credo.Check.Warning.WrongTestFileExtension, []} |
143 | 145 | ], |
144 | 146 | disabled: [ |
145 | | - # Disabled checks that may be too noisy for this project |
| 147 | + # Disabled globally - handled by formatter or too noisy |
146 | 148 | {Credo.Check.Readability.OnePipePerLine, []}, |
147 | 149 | {Credo.Check.Readability.NestedFunctionCalls, []}, |
148 | | - |
149 | | - # These are handled by the formatter |
150 | 150 | {Credo.Check.Consistency.MultiAliasImportRequireUse, []} |
151 | 151 | ] |
152 | 152 | } |
|
0 commit comments