|
64 | 64 | #
|
65 | 65 | # {Credo.Check.Design.DuplicatedCode, false}
|
66 | 66 | #
|
67 |
| - checks: [ |
68 |
| - # |
69 |
| - ## Consistency Checks |
70 |
| - # |
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, []}, |
| 67 | + checks: %{ |
| 68 | + enabled: [ |
| 69 | + # |
| 70 | + ## Consistency Checks |
| 71 | + # |
| 72 | + {Credo.Check.Consistency.ExceptionNames, []}, |
| 73 | + {Credo.Check.Consistency.LineEndings, []}, |
| 74 | + {Credo.Check.Consistency.ParameterPatternMatching, []}, |
| 75 | + {Credo.Check.Consistency.SpaceAroundOperators, []}, |
| 76 | + {Credo.Check.Consistency.SpaceInParentheses, []}, |
| 77 | + {Credo.Check.Consistency.TabsOrSpaces, []}, |
77 | 78 |
|
78 |
| - # |
79 |
| - ## Design Checks |
80 |
| - # |
81 |
| - # You can customize the priority of any check |
82 |
| - # Priority values are: `low, normal, high, higher` |
83 |
| - # |
84 |
| - {Credo.Check.Design.AliasUsage, |
85 |
| - [ |
86 |
| - priority: :low, |
87 |
| - if_nested_deeper_than: 2, |
88 |
| - if_called_more_often_than: 0 |
89 |
| - ]}, |
90 |
| - # You can also customize the exit_status of each check. |
91 |
| - # If you don't want TODO comments to cause `mix credo` to fail, just |
92 |
| - # set this value to 0 (zero). |
93 |
| - # |
94 |
| - {Credo.Check.Design.TagTODO, [exit_status: 0]}, |
95 |
| - {Credo.Check.Design.TagFIXME, []}, |
| 79 | + # |
| 80 | + ## Design Checks |
| 81 | + # |
| 82 | + # You can customize the priority of any check |
| 83 | + # Priority values are: `low, normal, high, higher` |
| 84 | + # |
| 85 | + {Credo.Check.Design.AliasUsage, |
| 86 | + [ |
| 87 | + priority: :low, |
| 88 | + if_nested_deeper_than: 2, |
| 89 | + if_called_more_often_than: 0 |
| 90 | + ]}, |
| 91 | + # You can also customize the exit_status of each check. |
| 92 | + # If you don't want TODO comments to cause `mix credo` to fail, just |
| 93 | + # set this value to 0 (zero). |
| 94 | + # |
| 95 | + {Credo.Check.Design.TagTODO, [exit_status: 0]}, |
| 96 | + {Credo.Check.Design.TagFIXME, []}, |
96 | 97 |
|
97 |
| - # |
98 |
| - ## Readability Checks |
99 |
| - # |
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, []}, |
| 98 | + # |
| 99 | + ## Readability Checks |
| 100 | + # |
| 101 | + {Credo.Check.Readability.AliasOrder, []}, |
| 102 | + {Credo.Check.Readability.FunctionNames, []}, |
| 103 | + {Credo.Check.Readability.LargeNumbers, []}, |
| 104 | + {Credo.Check.Readability.MaxLineLength, |
| 105 | + [priority: :low, max_length: 80]}, |
| 106 | + {Credo.Check.Readability.ModuleAttributeNames, []}, |
| 107 | + {Credo.Check.Readability.ModuleDoc, []}, |
| 108 | + {Credo.Check.Readability.ModuleNames, []}, |
| 109 | + {Credo.Check.Readability.ParenthesesInCondition, []}, |
| 110 | + {Credo.Check.Readability.ParenthesesOnZeroArityDefs, []}, |
| 111 | + {Credo.Check.Readability.PipeIntoAnonymousFunctions, []}, |
| 112 | + {Credo.Check.Readability.PredicateFunctionNames, []}, |
| 113 | + {Credo.Check.Readability.PreferImplicitTry, []}, |
| 114 | + {Credo.Check.Readability.RedundantBlankLines, []}, |
| 115 | + {Credo.Check.Readability.Semicolons, []}, |
| 116 | + {Credo.Check.Readability.SpaceAfterCommas, []}, |
| 117 | + {Credo.Check.Readability.StringSigils, []}, |
| 118 | + {Credo.Check.Readability.TrailingBlankLine, []}, |
| 119 | + {Credo.Check.Readability.TrailingWhiteSpace, []}, |
| 120 | + {Credo.Check.Readability.UnnecessaryAliasExpansion, []}, |
| 121 | + {Credo.Check.Readability.VariableNames, []}, |
| 122 | + {Credo.Check.Readability.WithSingleClause, []}, |
120 | 123 |
|
121 |
| - # |
122 |
| - ## Refactoring Opportunities |
123 |
| - # |
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, []}, |
| 124 | + # |
| 125 | + ## Refactoring Opportunities |
| 126 | + # |
| 127 | + {Credo.Check.Refactor.Apply, []}, |
| 128 | + {Credo.Check.Refactor.CondStatements, []}, |
| 129 | + {Credo.Check.Refactor.CyclomaticComplexity, []}, |
| 130 | + {Credo.Check.Refactor.FunctionArity, []}, |
| 131 | + {Credo.Check.Refactor.LongQuoteBlocks, []}, |
| 132 | + {Credo.Check.Refactor.MatchInCondition, []}, |
| 133 | + {Credo.Check.Refactor.MapJoin, []}, |
| 134 | + {Credo.Check.Refactor.NegatedConditionsInUnless, []}, |
| 135 | + {Credo.Check.Refactor.NegatedConditionsWithElse, []}, |
| 136 | + {Credo.Check.Refactor.Nesting, []}, |
| 137 | + {Credo.Check.Refactor.UnlessWithElse, []}, |
| 138 | + {Credo.Check.Refactor.WithClauses, []}, |
| 139 | + {Credo.Check.Refactor.FilterFilter, []}, |
| 140 | + {Credo.Check.Refactor.RejectReject, []}, |
| 141 | + {Credo.Check.Refactor.RedundantWithClauseResult, []}, |
135 | 142 |
|
136 |
| - # |
137 |
| - ## Warnings |
138 |
| - # |
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, []}, |
| 143 | + # |
| 144 | + ## Warnings |
| 145 | + # |
| 146 | + {Credo.Check.Warning.ApplicationConfigInModuleAttribute, []}, |
| 147 | + {Credo.Check.Warning.BoolOperationOnSameValues, []}, |
| 148 | + {Credo.Check.Warning.ExpensiveEmptyEnumCheck, []}, |
| 149 | + {Credo.Check.Warning.IExPry, []}, |
| 150 | + {Credo.Check.Warning.IoInspect, []}, |
| 151 | + {Credo.Check.Warning.OperationOnSameValues, []}, |
| 152 | + {Credo.Check.Warning.OperationWithConstantResult, []}, |
| 153 | + {Credo.Check.Warning.RaiseInsideRescue, []}, |
| 154 | + {Credo.Check.Warning.SpecWithStruct, []}, |
| 155 | + {Credo.Check.Warning.WrongTestFileExtension, []}, |
| 156 | + {Credo.Check.Warning.UnusedEnumOperation, []}, |
| 157 | + {Credo.Check.Warning.UnusedFileOperation, []}, |
| 158 | + {Credo.Check.Warning.UnusedKeywordOperation, []}, |
| 159 | + {Credo.Check.Warning.UnusedListOperation, []}, |
| 160 | + {Credo.Check.Warning.UnusedPathOperation, []}, |
| 161 | + {Credo.Check.Warning.UnusedRegexOperation, []}, |
| 162 | + {Credo.Check.Warning.UnusedStringOperation, []}, |
| 163 | + {Credo.Check.Warning.UnusedTupleOperation, []}, |
| 164 | + {Credo.Check.Warning.UnsafeExec, []} |
| 165 | + ], |
| 166 | + disabled: [ |
| 167 | + # |
| 168 | + # Checks scheduled for next check update (opt-in for now, just replace `false` with `[]`) |
157 | 169 |
|
158 |
| - # |
159 |
| - # Checks scheduled for next check update (opt-in for now, just replace `false` with `[]`) |
| 170 | + # |
| 171 | + # Controversial and experimental checks (opt-in, just move the check to `:enabled` |
| 172 | + # and be sure to use `mix credo --strict` to see low priority checks) |
| 173 | + # |
| 174 | + {Credo.Check.Consistency.MultiAliasImportRequireUse, []}, |
| 175 | + {Credo.Check.Consistency.UnusedVariableNames, []}, |
| 176 | + {Credo.Check.Design.DuplicatedCode, []}, |
| 177 | + {Credo.Check.Design.SkipTestWithoutComment, []}, |
| 178 | + {Credo.Check.Readability.AliasAs, []}, |
| 179 | + {Credo.Check.Readability.BlockPipe, []}, |
| 180 | + {Credo.Check.Readability.ImplTrue, []}, |
| 181 | + {Credo.Check.Readability.MultiAlias, []}, |
| 182 | + {Credo.Check.Readability.SeparateAliasRequire, []}, |
| 183 | + {Credo.Check.Readability.SingleFunctionToBlockPipe, []}, |
| 184 | + {Credo.Check.Readability.SinglePipe, []}, |
| 185 | + {Credo.Check.Readability.Specs, []}, |
| 186 | + {Credo.Check.Readability.StrictModuleLayout, []}, |
| 187 | + {Credo.Check.Readability.WithCustomTaggedTuple, []}, |
| 188 | + {Credo.Check.Refactor.ABCSize, []}, |
| 189 | + {Credo.Check.Refactor.AppendSingleItem, []}, |
| 190 | + {Credo.Check.Refactor.DoubleBooleanNegation, []}, |
| 191 | + {Credo.Check.Refactor.FilterReject, []}, |
| 192 | + {Credo.Check.Refactor.IoPuts, []}, |
| 193 | + {Credo.Check.Refactor.MapMap, []}, |
| 194 | + {Credo.Check.Refactor.ModuleDependencies, []}, |
| 195 | + {Credo.Check.Refactor.NegatedIsNil, []}, |
| 196 | + {Credo.Check.Refactor.PipeChainStart, []}, |
| 197 | + {Credo.Check.Refactor.RejectFilter, []}, |
| 198 | + {Credo.Check.Refactor.VariableRebinding, []}, |
| 199 | + {Credo.Check.Warning.LazyLogging, []}, |
| 200 | + {Credo.Check.Warning.LeakyEnvironment, []}, |
| 201 | + {Credo.Check.Warning.MapGetUnsafePass, []}, |
| 202 | + {Credo.Check.Warning.MixEnv, []}, |
| 203 | + {Credo.Check.Warning.UnsafeToAtom, []} |
160 | 204 |
|
161 |
| - # |
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]`. |
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}, |
177 |
| - {Credo.Check.Refactor.ABCSize, false}, |
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 |
| - ]}, |
187 |
| - {Credo.Check.Refactor.VariableRebinding, false}, |
188 |
| - {Credo.Check.Warning.LeakyEnvironment, false}, |
189 |
| - {Credo.Check.Warning.MapGetUnsafePass, false}, |
190 |
| - {Credo.Check.Warning.UnsafeToAtom, false} |
| 205 | + # {Credo.Check.Refactor.MapInto, []}, |
191 | 206 |
|
192 |
| - # |
193 |
| - # Custom checks can be created using `mix credo.gen.check`. |
194 |
| - # |
195 |
| - ] |
| 207 | + # |
| 208 | + # Custom checks can be created using `mix credo.gen.check`. |
| 209 | + # |
| 210 | + ] |
| 211 | + } |
196 | 212 | }
|
197 | 213 | ]
|
198 | 214 | }
|
0 commit comments