|
53 | 53 | # |
54 | 54 | # To disable a check put `false` as second element: |
55 | 55 | # |
56 | | - # {Credo.Check.Design.DuplicatedCode, false} |
57 | | - # |
58 | | - checks: [ |
59 | | - # |
60 | | - ## Consistency Checks |
61 | | - # |
62 | | - {Credo.Check.Consistency.ExceptionNames, []}, |
63 | | - {Credo.Check.Consistency.LineEndings, []}, |
64 | | - {Credo.Check.Consistency.ParameterPatternMatching, []}, |
65 | | - {Credo.Check.Consistency.SpaceAroundOperators, []}, |
66 | | - {Credo.Check.Consistency.SpaceInParentheses, []}, |
67 | | - {Credo.Check.Consistency.TabsOrSpaces, []}, |
| 56 | + # {Credo.Check.Design.DuplicatedCode,[]} |
| 57 | + # |
| 58 | + checks: %{ |
| 59 | + enabled: [ |
| 60 | + # |
| 61 | + ## Consistency Checks |
| 62 | + # |
| 63 | + {Credo.Check.Consistency.ExceptionNames, []}, |
| 64 | + {Credo.Check.Consistency.LineEndings, []}, |
| 65 | + {Credo.Check.Consistency.ParameterPatternMatching, []}, |
| 66 | + {Credo.Check.Consistency.SpaceAroundOperators, []}, |
| 67 | + {Credo.Check.Consistency.SpaceInParentheses, []}, |
| 68 | + {Credo.Check.Consistency.TabsOrSpaces, []}, |
68 | 69 |
|
69 | | - # |
70 | | - ## Design Checks |
71 | | - # |
72 | | - # You can customize the priority of any check |
73 | | - # Priority values are: `low, normal, high, higher` |
74 | | - # |
75 | | - {Credo.Check.Design.AliasUsage, |
76 | | - [priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 0]}, |
77 | | - # You can also customize the exit_status of each check. |
78 | | - # If you don't want TODO comments to cause `mix credo` to fail, just |
79 | | - # set this value to 0 (zero). |
80 | | - # |
81 | | - {Credo.Check.Design.TagTODO, [exit_status: 0]}, |
82 | | - {Credo.Check.Design.TagFIXME, []}, |
| 70 | + # |
| 71 | + ## Design Checks |
| 72 | + # |
| 73 | + # You can customize the priority of any check |
| 74 | + # Priority values are: `low, normal, high, higher` |
| 75 | + # |
| 76 | + {Credo.Check.Design.AliasUsage, |
| 77 | + [priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 0]}, |
| 78 | + # You can also customize the exit_status of each check. |
| 79 | + # If you don't want TODO comments to cause `mix credo` to fail, just |
| 80 | + # set this value to 0 (zero). |
| 81 | + # |
| 82 | + {Credo.Check.Design.TagTODO, [exit_status: 0]}, |
| 83 | + {Credo.Check.Design.TagFIXME, []}, |
83 | 84 |
|
84 | | - # |
85 | | - ## Readability Checks |
86 | | - # |
87 | | - {Credo.Check.Readability.AliasOrder, []}, |
88 | | - {Credo.Check.Readability.FunctionNames, []}, |
89 | | - {Credo.Check.Readability.LargeNumbers, []}, |
90 | | - {Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]}, |
91 | | - {Credo.Check.Readability.ModuleAttributeNames, []}, |
92 | | - {Credo.Check.Readability.ModuleDoc, []}, |
93 | | - {Credo.Check.Readability.ModuleNames, []}, |
94 | | - {Credo.Check.Readability.ParenthesesInCondition, []}, |
95 | | - {Credo.Check.Readability.ParenthesesOnZeroArityDefs, []}, |
96 | | - {Credo.Check.Readability.PredicateFunctionNames, []}, |
97 | | - {Credo.Check.Readability.PreferImplicitTry, []}, |
98 | | - {Credo.Check.Readability.RedundantBlankLines, []}, |
99 | | - {Credo.Check.Readability.Semicolons, []}, |
100 | | - {Credo.Check.Readability.SpaceAfterCommas, []}, |
101 | | - {Credo.Check.Readability.StringSigils, []}, |
102 | | - {Credo.Check.Readability.TrailingBlankLine, []}, |
103 | | - {Credo.Check.Readability.TrailingWhiteSpace, []}, |
104 | | - {Credo.Check.Readability.UnnecessaryAliasExpansion, []}, |
105 | | - {Credo.Check.Readability.VariableNames, []}, |
| 85 | + # |
| 86 | + ## Readability Checks |
| 87 | + # |
| 88 | + {Credo.Check.Readability.AliasOrder, []}, |
| 89 | + {Credo.Check.Readability.FunctionNames, []}, |
| 90 | + {Credo.Check.Readability.LargeNumbers, []}, |
| 91 | + {Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]}, |
| 92 | + {Credo.Check.Readability.ModuleAttributeNames, []}, |
| 93 | + {Credo.Check.Readability.ModuleDoc, []}, |
| 94 | + {Credo.Check.Readability.ModuleNames, []}, |
| 95 | + {Credo.Check.Readability.ParenthesesInCondition, []}, |
| 96 | + {Credo.Check.Readability.ParenthesesOnZeroArityDefs, []}, |
| 97 | + {Credo.Check.Readability.PredicateFunctionNames, []}, |
| 98 | + {Credo.Check.Readability.PreferImplicitTry, []}, |
| 99 | + {Credo.Check.Readability.RedundantBlankLines, []}, |
| 100 | + {Credo.Check.Readability.Semicolons, []}, |
| 101 | + {Credo.Check.Readability.SpaceAfterCommas, []}, |
| 102 | + {Credo.Check.Readability.StringSigils, []}, |
| 103 | + {Credo.Check.Readability.TrailingBlankLine, []}, |
| 104 | + {Credo.Check.Readability.TrailingWhiteSpace, []}, |
| 105 | + {Credo.Check.Readability.UnnecessaryAliasExpansion, []}, |
| 106 | + {Credo.Check.Readability.VariableNames, []}, |
106 | 107 |
|
107 | | - # |
108 | | - ## Refactoring Opportunities |
109 | | - # |
110 | | - {Credo.Check.Refactor.CondStatements, []}, |
111 | | - {Credo.Check.Refactor.CyclomaticComplexity, []}, |
112 | | - {Credo.Check.Refactor.FunctionArity, []}, |
113 | | - {Credo.Check.Refactor.LongQuoteBlocks, []}, |
114 | | - # {Credo.Check.Refactor.MapInto, []}, |
115 | | - {Credo.Check.Refactor.MatchInCondition, []}, |
116 | | - {Credo.Check.Refactor.NegatedConditionsInUnless, []}, |
117 | | - {Credo.Check.Refactor.NegatedConditionsWithElse, []}, |
118 | | - {Credo.Check.Refactor.Nesting, []}, |
119 | | - {Credo.Check.Refactor.UnlessWithElse, []}, |
120 | | - {Credo.Check.Refactor.WithClauses, []}, |
| 108 | + # |
| 109 | + ## Refactoring Opportunities |
| 110 | + # |
| 111 | + {Credo.Check.Refactor.CondStatements, []}, |
| 112 | + {Credo.Check.Refactor.CyclomaticComplexity, []}, |
| 113 | + {Credo.Check.Refactor.FunctionArity, []}, |
| 114 | + {Credo.Check.Refactor.LongQuoteBlocks, []}, |
| 115 | + # {Credo.Check.Refactor.MapInto, []}, |
| 116 | + {Credo.Check.Refactor.MatchInCondition, []}, |
| 117 | + {Credo.Check.Refactor.NegatedConditionsInUnless, []}, |
| 118 | + {Credo.Check.Refactor.NegatedConditionsWithElse, []}, |
| 119 | + {Credo.Check.Refactor.Nesting, []}, |
| 120 | + {Credo.Check.Refactor.UnlessWithElse, []}, |
| 121 | + {Credo.Check.Refactor.WithClauses, []}, |
121 | 122 |
|
122 | | - # |
123 | | - ## Warnings |
124 | | - # |
125 | | - {Credo.Check.Warning.ApplicationConfigInModuleAttribute, []}, |
126 | | - {Credo.Check.Warning.BoolOperationOnSameValues, []}, |
127 | | - {Credo.Check.Warning.ExpensiveEmptyEnumCheck, []}, |
128 | | - {Credo.Check.Warning.IExPry, []}, |
129 | | - {Credo.Check.Warning.IoInspect, []}, |
130 | | - # {Credo.Check.Warning.LazyLogging, []}, |
131 | | - {Credo.Check.Warning.MixEnv, false}, |
132 | | - {Credo.Check.Warning.OperationOnSameValues, []}, |
133 | | - {Credo.Check.Warning.OperationWithConstantResult, []}, |
134 | | - {Credo.Check.Warning.RaiseInsideRescue, []}, |
135 | | - {Credo.Check.Warning.UnusedEnumOperation, []}, |
136 | | - {Credo.Check.Warning.UnusedFileOperation, []}, |
137 | | - {Credo.Check.Warning.UnusedKeywordOperation, []}, |
138 | | - {Credo.Check.Warning.UnusedListOperation, []}, |
139 | | - {Credo.Check.Warning.UnusedPathOperation, []}, |
140 | | - {Credo.Check.Warning.UnusedRegexOperation, []}, |
141 | | - {Credo.Check.Warning.UnusedStringOperation, []}, |
142 | | - {Credo.Check.Warning.UnusedTupleOperation, []}, |
143 | | - {Credo.Check.Warning.UnsafeExec, []}, |
| 123 | + # |
| 124 | + ## Warnings |
| 125 | + # |
| 126 | + {Credo.Check.Warning.ApplicationConfigInModuleAttribute, []}, |
| 127 | + {Credo.Check.Warning.BoolOperationOnSameValues, []}, |
| 128 | + {Credo.Check.Warning.ExpensiveEmptyEnumCheck, []}, |
| 129 | + {Credo.Check.Warning.IExPry, []}, |
| 130 | + {Credo.Check.Warning.IoInspect, []}, |
| 131 | + # {Credo.Check.Warning.LazyLogging, []}, |
| 132 | + {Credo.Check.Warning.OperationOnSameValues, []}, |
| 133 | + {Credo.Check.Warning.OperationWithConstantResult, []}, |
| 134 | + {Credo.Check.Warning.RaiseInsideRescue, []}, |
| 135 | + {Credo.Check.Warning.UnusedEnumOperation, []}, |
| 136 | + {Credo.Check.Warning.UnusedFileOperation, []}, |
| 137 | + {Credo.Check.Warning.UnusedKeywordOperation, []}, |
| 138 | + {Credo.Check.Warning.UnusedListOperation, []}, |
| 139 | + {Credo.Check.Warning.UnusedPathOperation, []}, |
| 140 | + {Credo.Check.Warning.UnusedRegexOperation, []}, |
| 141 | + {Credo.Check.Warning.UnusedStringOperation, []}, |
| 142 | + {Credo.Check.Warning.UnusedTupleOperation, []}, |
| 143 | + {Credo.Check.Warning.UnsafeExec, []} |
144 | 144 |
|
145 | | - # |
146 | | - # Checks scheduled for next check update (opt-in for now, just replace `false` with `[]`) |
| 145 | + # |
| 146 | + # Checks scheduled for next check update (opt-in for now, just replace `false` with `[]`) |
147 | 147 |
|
148 | | - # |
149 | | - # Controversial and experimental checks (opt-in, just replace `false` with `[]`) |
150 | | - # |
151 | | - {Credo.Check.Consistency.MultiAliasImportRequireUse, false}, |
152 | | - {Credo.Check.Consistency.UnusedVariableNames, false}, |
153 | | - {Credo.Check.Design.DuplicatedCode, false}, |
154 | | - {Credo.Check.Readability.AliasAs, false}, |
155 | | - {Credo.Check.Readability.BlockPipe, false}, |
156 | | - {Credo.Check.Readability.ImplTrue, false}, |
157 | | - {Credo.Check.Readability.MultiAlias, false}, |
158 | | - {Credo.Check.Readability.SeparateAliasRequire, false}, |
159 | | - {Credo.Check.Readability.SinglePipe, false}, |
160 | | - {Credo.Check.Readability.Specs, false}, |
161 | | - {Credo.Check.Readability.StrictModuleLayout, false}, |
162 | | - {Credo.Check.Readability.WithCustomTaggedTuple, false}, |
163 | | - {Credo.Check.Refactor.ABCSize, false}, |
164 | | - {Credo.Check.Refactor.AppendSingleItem, false}, |
165 | | - {Credo.Check.Refactor.DoubleBooleanNegation, false}, |
166 | | - {Credo.Check.Refactor.ModuleDependencies, false}, |
167 | | - {Credo.Check.Refactor.NegatedIsNil, false}, |
168 | | - {Credo.Check.Refactor.PipeChainStart, false}, |
169 | | - {Credo.Check.Refactor.VariableRebinding, false}, |
170 | | - {Credo.Check.Warning.LeakyEnvironment, false}, |
171 | | - {Credo.Check.Warning.MapGetUnsafePass, false}, |
172 | | - {Credo.Check.Warning.UnsafeToAtom, false} |
173 | | - |
174 | | - # |
175 | | - # Custom checks can be created using `mix credo.gen.check`. |
176 | | - # |
177 | | - ] |
| 148 | + # |
| 149 | + # Custom checks can be created using `mix credo.gen.check`. |
| 150 | + # |
| 151 | + ], |
| 152 | + disabled: [ |
| 153 | + {Credo.Check.Warning.MixEnv, []}, |
| 154 | + # |
| 155 | + # Controversial and experimental checks (opt-in, just replace `false` with `[]`) |
| 156 | + # |
| 157 | + {Credo.Check.Consistency.MultiAliasImportRequireUse, []}, |
| 158 | + {Credo.Check.Consistency.UnusedVariableNames, []}, |
| 159 | + {Credo.Check.Design.DuplicatedCode, []}, |
| 160 | + {Credo.Check.Readability.AliasAs, []}, |
| 161 | + {Credo.Check.Readability.BlockPipe, []}, |
| 162 | + {Credo.Check.Readability.ImplTrue, []}, |
| 163 | + {Credo.Check.Readability.MultiAlias, []}, |
| 164 | + {Credo.Check.Readability.SeparateAliasRequire, []}, |
| 165 | + {Credo.Check.Readability.SinglePipe, []}, |
| 166 | + {Credo.Check.Readability.Specs, []}, |
| 167 | + {Credo.Check.Readability.StrictModuleLayout, []}, |
| 168 | + {Credo.Check.Readability.WithCustomTaggedTuple, []}, |
| 169 | + {Credo.Check.Refactor.ABCSize, []}, |
| 170 | + {Credo.Check.Refactor.AppendSingleItem, []}, |
| 171 | + {Credo.Check.Refactor.DoubleBooleanNegation, []}, |
| 172 | + {Credo.Check.Refactor.ModuleDependencies, []}, |
| 173 | + {Credo.Check.Refactor.NegatedIsNil, []}, |
| 174 | + {Credo.Check.Refactor.PipeChainStart, []}, |
| 175 | + {Credo.Check.Refactor.VariableRebinding, []}, |
| 176 | + {Credo.Check.Warning.LeakyEnvironment, []}, |
| 177 | + {Credo.Check.Warning.MapGetUnsafePass, []}, |
| 178 | + {Credo.Check.Warning.UnsafeToAtom, []} |
| 179 | + ] |
| 180 | + } |
178 | 181 | } |
179 | 182 | ] |
180 | 183 | } |
0 commit comments