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