|
10 | 10 | configs: [ |
11 | 11 | %{ |
12 | 12 | # |
13 | | - # Run any exec using `mix credo -C <name>`. If no exec name is given |
| 13 | + # Run any config using `mix credo -C <name>`. If no config name is given |
14 | 14 | # "default" is used. |
15 | 15 | # |
16 | 16 | name: "default", |
|
21 | 21 | # You can give explicit globs or simply directories. |
22 | 22 | # In the latter case `**/*.{ex,exs}` will be used. |
23 | 23 | # |
24 | | - included: ["lib/", "src/", "test/", "web/", "apps/"], |
| 24 | + included: [ |
| 25 | + "lib/", |
| 26 | + "src/", |
| 27 | + "test/", |
| 28 | + "web/", |
| 29 | + "apps/*/lib/", |
| 30 | + "apps/*/src/", |
| 31 | + "apps/*/test/", |
| 32 | + "apps/*/web/" |
| 33 | + ], |
25 | 34 | excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"] |
26 | 35 | }, |
27 | 36 | # |
| 37 | + # Load and configure plugins here: |
| 38 | + # |
| 39 | + plugins: [], |
| 40 | + # |
28 | 41 | # If you create your own checks, you must specify the source files for |
29 | 42 | # them here, so they can be loaded by Credo before running the analysis. |
30 | 43 | # |
|
35 | 48 | # |
36 | 49 | strict: true, |
37 | 50 | # |
| 51 | + # To modify the timeout for parsing files, change this value: |
| 52 | + # |
| 53 | + parse_timeout: 5000, |
| 54 | + # |
38 | 55 | # If you want to use uncolored output by default, you can change `color` |
39 | 56 | # to `false` below: |
40 | 57 | # |
|
51 | 68 | # |
52 | 69 | ## Consistency Checks |
53 | 70 | # |
54 | | - {Credo.Check.Consistency.ExceptionNames}, |
55 | | - {Credo.Check.Consistency.LineEndings}, |
56 | | - {Credo.Check.Consistency.ParameterPatternMatching}, |
57 | | - {Credo.Check.Consistency.SpaceAroundOperators}, |
58 | | - {Credo.Check.Consistency.SpaceInParentheses}, |
59 | | - {Credo.Check.Consistency.TabsOrSpaces}, |
| 71 | + {Credo.Check.Consistency.ExceptionNames, []}, |
| 72 | + {Credo.Check.Consistency.LineEndings, []}, |
| 73 | + {Credo.Check.Consistency.ParameterPatternMatching, []}, |
| 74 | + {Credo.Check.Consistency.SpaceAroundOperators, []}, |
| 75 | + {Credo.Check.Consistency.SpaceInParentheses, []}, |
| 76 | + {Credo.Check.Consistency.TabsOrSpaces, []}, |
60 | 77 |
|
61 | 78 | # |
62 | 79 | ## Design Checks |
63 | 80 | # |
64 | 81 | # You can customize the priority of any check |
65 | 82 | # Priority values are: `low, normal, high, higher` |
66 | 83 | # |
67 | | - {Credo.Check.Design.AliasUsage, priority: :low}, |
68 | | - # For some checks, you can also set other parameters |
69 | | - # |
70 | | - # If you don't want the `setup` and `test` macro calls in ExUnit tests |
71 | | - # or the `schema` macro in Ecto schemas to trigger DuplicatedCode, just |
72 | | - # set the `excluded_macros` parameter to `[:schema, :setup, :test]`. |
73 | | - # |
74 | | - {Credo.Check.Design.DuplicatedCode, excluded_macros: []}, |
| 84 | + {Credo.Check.Design.AliasUsage, |
| 85 | + [ |
| 86 | + priority: :low, |
| 87 | + if_nested_deeper_than: 2, |
| 88 | + if_called_more_often_than: 0 |
| 89 | + ]}, |
75 | 90 | # You can also customize the exit_status of each check. |
76 | 91 | # If you don't want TODO comments to cause `mix credo` to fail, just |
77 | 92 | # set this value to 0 (zero). |
78 | 93 | # |
79 | | - {Credo.Check.Design.TagTODO, exit_status: 0}, |
80 | | - {Credo.Check.Design.TagFIXME}, |
| 94 | + {Credo.Check.Design.TagTODO, [exit_status: 0]}, |
| 95 | + {Credo.Check.Design.TagFIXME, []}, |
81 | 96 |
|
82 | 97 | # |
83 | 98 | ## Readability Checks |
84 | 99 | # |
85 | | - {Credo.Check.Readability.AliasOrder}, |
86 | | - {Credo.Check.Readability.FunctionNames}, |
87 | | - {Credo.Check.Readability.LargeNumbers}, |
88 | | - {Credo.Check.Readability.MaxLineLength, priority: :low, max_length: 80}, |
89 | | - {Credo.Check.Readability.ModuleAttributeNames}, |
90 | | - {Credo.Check.Readability.ModuleDoc}, |
91 | | - {Credo.Check.Readability.ModuleNames}, |
92 | | - {Credo.Check.Readability.ParenthesesOnZeroArityDefs}, |
93 | | - {Credo.Check.Readability.ParenthesesInCondition}, |
94 | | - {Credo.Check.Readability.PredicateFunctionNames}, |
95 | | - {Credo.Check.Readability.PreferImplicitTry}, |
96 | | - {Credo.Check.Readability.RedundantBlankLines}, |
97 | | - {Credo.Check.Readability.StringSigils}, |
98 | | - {Credo.Check.Readability.TrailingBlankLine}, |
99 | | - {Credo.Check.Readability.TrailingWhiteSpace}, |
100 | | - {Credo.Check.Readability.VariableNames}, |
101 | | - {Credo.Check.Readability.Semicolons}, |
102 | | - {Credo.Check.Readability.SpaceAfterCommas}, |
| 100 | + {Credo.Check.Readability.AliasOrder, []}, |
| 101 | + {Credo.Check.Readability.FunctionNames, []}, |
| 102 | + {Credo.Check.Readability.LargeNumbers, []}, |
| 103 | + {Credo.Check.Readability.MaxLineLength, |
| 104 | + [priority: :low, max_length: 80]}, |
| 105 | + {Credo.Check.Readability.ModuleAttributeNames, []}, |
| 106 | + {Credo.Check.Readability.ModuleDoc, []}, |
| 107 | + {Credo.Check.Readability.ModuleNames, []}, |
| 108 | + {Credo.Check.Readability.ParenthesesInCondition, []}, |
| 109 | + {Credo.Check.Readability.ParenthesesOnZeroArityDefs, []}, |
| 110 | + {Credo.Check.Readability.PredicateFunctionNames, []}, |
| 111 | + {Credo.Check.Readability.PreferImplicitTry, []}, |
| 112 | + {Credo.Check.Readability.RedundantBlankLines, []}, |
| 113 | + {Credo.Check.Readability.Semicolons, []}, |
| 114 | + {Credo.Check.Readability.SpaceAfterCommas, []}, |
| 115 | + {Credo.Check.Readability.StringSigils, []}, |
| 116 | + {Credo.Check.Readability.TrailingBlankLine, []}, |
| 117 | + {Credo.Check.Readability.TrailingWhiteSpace, []}, |
| 118 | + {Credo.Check.Readability.UnnecessaryAliasExpansion, []}, |
| 119 | + {Credo.Check.Readability.VariableNames, []}, |
103 | 120 |
|
104 | 121 | # |
105 | 122 | ## Refactoring Opportunities |
106 | 123 | # |
107 | | - {Credo.Check.Refactor.DoubleBooleanNegation, false}, |
108 | | - {Credo.Check.Refactor.CondStatements}, |
109 | | - {Credo.Check.Refactor.CyclomaticComplexity}, |
110 | | - {Credo.Check.Refactor.FunctionArity}, |
111 | | - {Credo.Check.Refactor.LongQuoteBlocks}, |
112 | | - {Credo.Check.Refactor.MapInto}, |
113 | | - {Credo.Check.Refactor.MatchInCondition}, |
114 | | - {Credo.Check.Refactor.NegatedConditionsInUnless}, |
115 | | - {Credo.Check.Refactor.NegatedConditionsWithElse}, |
116 | | - {Credo.Check.Refactor.Nesting}, |
117 | | - {Credo.Check.Refactor.PipeChainStart, |
118 | | - excluded_argument_types: [:atom, :binary, :fn, :keyword], |
119 | | - excluded_functions: []}, |
120 | | - {Credo.Check.Refactor.UnlessWithElse}, |
| 124 | + {Credo.Check.Refactor.CondStatements, []}, |
| 125 | + {Credo.Check.Refactor.CyclomaticComplexity, []}, |
| 126 | + {Credo.Check.Refactor.FunctionArity, []}, |
| 127 | + {Credo.Check.Refactor.LongQuoteBlocks, []}, |
| 128 | + {Credo.Check.Refactor.MapInto, false}, |
| 129 | + {Credo.Check.Refactor.MatchInCondition, []}, |
| 130 | + {Credo.Check.Refactor.NegatedConditionsInUnless, []}, |
| 131 | + {Credo.Check.Refactor.NegatedConditionsWithElse, []}, |
| 132 | + {Credo.Check.Refactor.Nesting, []}, |
| 133 | + {Credo.Check.Refactor.UnlessWithElse, []}, |
| 134 | + {Credo.Check.Refactor.WithClauses, []}, |
121 | 135 |
|
122 | 136 | # |
123 | 137 | ## Warnings |
124 | 138 | # |
125 | | - {Credo.Check.Warning.BoolOperationOnSameValues}, |
126 | | - {Credo.Check.Warning.ExpensiveEmptyEnumCheck}, |
127 | | - {Credo.Check.Warning.IExPry}, |
128 | | - {Credo.Check.Warning.IoInspect}, |
129 | | - {Credo.Check.Warning.LazyLogging}, |
130 | | - {Credo.Check.Warning.OperationOnSameValues}, |
131 | | - {Credo.Check.Warning.OperationWithConstantResult}, |
132 | | - {Credo.Check.Warning.UnusedEnumOperation}, |
133 | | - {Credo.Check.Warning.UnusedFileOperation}, |
134 | | - {Credo.Check.Warning.UnusedKeywordOperation}, |
135 | | - {Credo.Check.Warning.UnusedListOperation}, |
136 | | - {Credo.Check.Warning.UnusedPathOperation}, |
137 | | - {Credo.Check.Warning.UnusedRegexOperation}, |
138 | | - {Credo.Check.Warning.UnusedStringOperation}, |
139 | | - {Credo.Check.Warning.UnusedTupleOperation}, |
140 | | - {Credo.Check.Warning.RaiseInsideRescue}, |
| 139 | + {Credo.Check.Warning.BoolOperationOnSameValues, []}, |
| 140 | + {Credo.Check.Warning.ExpensiveEmptyEnumCheck, []}, |
| 141 | + {Credo.Check.Warning.IExPry, []}, |
| 142 | + {Credo.Check.Warning.IoInspect, []}, |
| 143 | + {Credo.Check.Warning.LazyLogging, false}, |
| 144 | + {Credo.Check.Warning.MixEnv, false}, |
| 145 | + {Credo.Check.Warning.OperationOnSameValues, []}, |
| 146 | + {Credo.Check.Warning.OperationWithConstantResult, []}, |
| 147 | + {Credo.Check.Warning.RaiseInsideRescue, []}, |
| 148 | + {Credo.Check.Warning.UnusedEnumOperation, []}, |
| 149 | + {Credo.Check.Warning.UnusedFileOperation, []}, |
| 150 | + {Credo.Check.Warning.UnusedKeywordOperation, []}, |
| 151 | + {Credo.Check.Warning.UnusedListOperation, []}, |
| 152 | + {Credo.Check.Warning.UnusedPathOperation, []}, |
| 153 | + {Credo.Check.Warning.UnusedRegexOperation, []}, |
| 154 | + {Credo.Check.Warning.UnusedStringOperation, []}, |
| 155 | + {Credo.Check.Warning.UnusedTupleOperation, []}, |
| 156 | + {Credo.Check.Warning.UnsafeExec, []}, |
| 157 | + |
| 158 | + # |
| 159 | + # Checks scheduled for next check update (opt-in for now, just replace `false` with `[]`) |
141 | 160 |
|
142 | 161 | # |
143 | | - # Controversial and experimental checks (opt-in, just remove `, false`) |
| 162 | + # Controversial and experimental checks (opt-in, just replace `false` with `[]`) |
| 163 | + # |
| 164 | + {Credo.Check.Readability.StrictModuleLayout, false}, |
| 165 | + {Credo.Check.Consistency.MultiAliasImportRequireUse, false}, |
| 166 | + {Credo.Check.Consistency.UnusedVariableNames, false}, |
| 167 | + # If you don't want the `setup` and `test` macro calls in ExUnit tests |
| 168 | + # or the `schema` macro in Ecto schemas to trigger DuplicatedCode, just |
| 169 | + # set the `excluded_macros` parameter to `[:schema, :setup, :test]`. |
144 | 170 | # |
| 171 | + {Credo.Check.Design.DuplicatedCode, [excluded_macros: []]}, |
| 172 | + {Credo.Check.Readability.AliasAs, false}, |
| 173 | + {Credo.Check.Readability.MultiAlias, false}, |
| 174 | + {Credo.Check.Readability.Specs, false}, |
| 175 | + {Credo.Check.Readability.SinglePipe, false}, |
| 176 | + {Credo.Check.Readability.WithCustomTaggedTuple, false}, |
145 | 177 | {Credo.Check.Refactor.ABCSize, false}, |
146 | 178 | {Credo.Check.Refactor.AppendSingleItem, false}, |
| 179 | + {Credo.Check.Refactor.DoubleBooleanNegation, false}, |
| 180 | + {Credo.Check.Refactor.ModuleDependencies, false}, |
| 181 | + {Credo.Check.Refactor.NegatedIsNil, false}, |
| 182 | + {Credo.Check.Refactor.PipeChainStart, |
| 183 | + [ |
| 184 | + excluded_argument_types: [:atom, :binary, :fn, :keyword], |
| 185 | + excluded_functions: [] |
| 186 | + ]}, |
147 | 187 | {Credo.Check.Refactor.VariableRebinding, false}, |
| 188 | + {Credo.Check.Warning.LeakyEnvironment, false}, |
148 | 189 | {Credo.Check.Warning.MapGetUnsafePass, false}, |
149 | | - {Credo.Check.Consistency.MultiAliasImportRequireUse, false}, |
150 | | - |
151 | | - # |
152 | | - # Deprecated checks (these will be deleted after a grace period) |
153 | | - # |
154 | | - {Credo.Check.Readability.Specs, false} |
| 190 | + {Credo.Check.Warning.UnsafeToAtom, false} |
155 | 191 |
|
156 | 192 | # |
157 | 193 | # Custom checks can be created using `mix credo.gen.check`. |
|
0 commit comments