|
22 | 22 | # In the latter case `**/*.{ex,exs}` will be used.
|
23 | 23 | #
|
24 | 24 | included: [
|
| 25 | + "{.credo,.dialyzer_ignore,.formatter,mix}.exs", |
| 26 | + "config/", |
| 27 | + "bench/", |
25 | 28 | "lib/",
|
26 |
| - "src/", |
27 |
| - "test/", |
28 |
| - "web/", |
29 |
| - "apps/*/lib/", |
30 |
| - "apps/*/src/", |
31 |
| - "apps/*/test/", |
32 |
| - "apps/*/web/" |
| 29 | + "profile/", |
| 30 | + "test/" |
33 | 31 | ],
|
34 |
| - excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"] |
| 32 | + excluded: [~r"/_build/", ~r"/deps/"] |
35 | 33 | },
|
36 | 34 | #
|
37 | 35 | # Load and configure plugins here:
|
|
64 | 62 | #
|
65 | 63 | # {Credo.Check.Design.DuplicatedCode, false}
|
66 | 64 | #
|
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, []}, |
| 65 | + checks: %{ |
| 66 | + enabled: [ |
| 67 | + # |
| 68 | + ## Consistency Checks |
| 69 | + # |
| 70 | + {Credo.Check.Consistency.ExceptionNames, []}, |
| 71 | + {Credo.Check.Consistency.LineEndings, []}, |
| 72 | + {Credo.Check.Consistency.MultiAliasImportRequireUse, []}, |
| 73 | + {Credo.Check.Consistency.ParameterPatternMatching, []}, |
| 74 | + {Credo.Check.Consistency.SpaceAroundOperators, []}, |
| 75 | + {Credo.Check.Consistency.SpaceInParentheses, []}, |
| 76 | + {Credo.Check.Consistency.TabsOrSpaces, []}, |
77 | 77 |
|
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: 0]}, |
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, []}, |
| 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: 0]}, |
| 86 | + {Credo.Check.Design.DuplicatedCode, []}, |
| 87 | + {Credo.Check.Design.SkipTestWithoutComment, []}, |
| 88 | + {Credo.Check.Design.TagFIXME, []}, |
| 89 | + # You can also customize the exit_status of each check. |
| 90 | + # If you don't want TODO comments to cause `mix credo` to fail, just |
| 91 | + # set this value to 0 (zero). |
| 92 | + # |
| 93 | + {Credo.Check.Design.TagTODO, [exit_status: 2]}, |
92 | 94 |
|
93 |
| - # |
94 |
| - ## Readability Checks |
95 |
| - # |
96 |
| - {Credo.Check.Readability.AliasOrder, []}, |
97 |
| - {Credo.Check.Readability.FunctionNames, []}, |
98 |
| - {Credo.Check.Readability.LargeNumbers, []}, |
99 |
| - {Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]}, |
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, false}, |
111 |
| - {Credo.Check.Readability.TrailingBlankLine, []}, |
112 |
| - {Credo.Check.Readability.TrailingWhiteSpace, []}, |
113 |
| - {Credo.Check.Readability.UnnecessaryAliasExpansion, []}, |
114 |
| - {Credo.Check.Readability.VariableNames, []}, |
| 95 | + # |
| 96 | + ## Readability Checks |
| 97 | + # |
| 98 | + {Credo.Check.Readability.AliasAs, []}, |
| 99 | + {Credo.Check.Readability.AliasOrder, []}, |
| 100 | + {Credo.Check.Readability.BlockPipe, []}, |
| 101 | + {Credo.Check.Readability.FunctionNames, []}, |
| 102 | + {Credo.Check.Readability.ImplTrue, []}, |
| 103 | + {Credo.Check.Readability.LargeNumbers, []}, |
| 104 | + {Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]}, |
| 105 | + {Credo.Check.Readability.ModuleAttributeNames, []}, |
| 106 | + {Credo.Check.Readability.ModuleDoc, []}, |
| 107 | + {Credo.Check.Readability.ModuleNames, []}, |
| 108 | + {Credo.Check.Readability.OneArityFunctionInPipe, []}, |
| 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.SeparateAliasRequire, []}, |
| 117 | + {Credo.Check.Readability.SingleFunctionToBlockPipe, []}, |
| 118 | + {Credo.Check.Readability.SinglePipe, []}, |
| 119 | + {Credo.Check.Readability.SpaceAfterCommas, []}, |
| 120 | + {Credo.Check.Readability.StrictModuleLayout, []}, |
| 121 | + {Credo.Check.Readability.StringSigils, []}, |
| 122 | + {Credo.Check.Readability.TrailingBlankLine, []}, |
| 123 | + {Credo.Check.Readability.TrailingWhiteSpace, []}, |
| 124 | + {Credo.Check.Readability.UnnecessaryAliasExpansion, []}, |
| 125 | + {Credo.Check.Readability.VariableNames, []}, |
| 126 | + {Credo.Check.Readability.WithCustomTaggedTuple, []}, |
| 127 | + {Credo.Check.Readability.WithSingleClause, []}, |
115 | 128 |
|
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, false}, |
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, []}, |
| 129 | + # |
| 130 | + ## Refactoring Opportunities |
| 131 | + # |
| 132 | + {Credo.Check.Refactor.ABCSize, []}, |
| 133 | + {Credo.Check.Refactor.AppendSingleItem, []}, |
| 134 | + {Credo.Check.Refactor.Apply, []}, |
| 135 | + {Credo.Check.Refactor.CondStatements, []}, |
| 136 | + {Credo.Check.Refactor.CyclomaticComplexity, []}, |
| 137 | + {Credo.Check.Refactor.DoubleBooleanNegation, []}, |
| 138 | + {Credo.Check.Refactor.FilterCount, []}, |
| 139 | + {Credo.Check.Refactor.FilterFilter, []}, |
| 140 | + {Credo.Check.Refactor.FilterReject, []}, |
| 141 | + {Credo.Check.Refactor.FunctionArity, []}, |
| 142 | + {Credo.Check.Refactor.IoPuts, []}, |
| 143 | + {Credo.Check.Refactor.LongQuoteBlocks, []}, |
| 144 | + {Credo.Check.Refactor.MapJoin, []}, |
| 145 | + {Credo.Check.Refactor.MapMap, []}, |
| 146 | + {Credo.Check.Refactor.MatchInCondition, []}, |
| 147 | + {Credo.Check.Refactor.NegatedConditionsInUnless, []}, |
| 148 | + {Credo.Check.Refactor.NegatedConditionsWithElse, []}, |
| 149 | + {Credo.Check.Refactor.NegatedIsNil, []}, |
| 150 | + {Credo.Check.Refactor.Nesting, []}, |
| 151 | + {Credo.Check.Refactor.PassAsyncInTestCases, []}, |
| 152 | + {Credo.Check.Refactor.PipeChainStart, []}, |
| 153 | + {Credo.Check.Refactor.RedundantWithClauseResult, []}, |
| 154 | + {Credo.Check.Refactor.RejectFilter, []}, |
| 155 | + {Credo.Check.Refactor.RejectReject, []}, |
| 156 | + {Credo.Check.Refactor.UnlessWithElse, []}, |
| 157 | + {Credo.Check.Refactor.UtcNowTruncate, []}, |
| 158 | + {Credo.Check.Refactor.WithClauses, []}, |
130 | 159 |
|
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, false}, |
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, []}, |
| 160 | + # |
| 161 | + ## Warnings |
| 162 | + # |
| 163 | + {Credo.Check.Consistency.UnusedVariableNames, []}, |
| 164 | + {Credo.Check.Warning.ApplicationConfigInModuleAttribute, []}, |
| 165 | + {Credo.Check.Warning.BoolOperationOnSameValues, []}, |
| 166 | + {Credo.Check.Warning.Dbg, []}, |
| 167 | + {Credo.Check.Warning.ExpensiveEmptyEnumCheck, []}, |
| 168 | + {Credo.Check.Warning.IExPry, []}, |
| 169 | + {Credo.Check.Warning.IoInspect, []}, |
| 170 | + {Credo.Check.Warning.LazyLogging, false}, |
| 171 | + {Credo.Check.Warning.LeakyEnvironment, []}, |
| 172 | + {Credo.Check.Warning.MapGetUnsafePass, []}, |
| 173 | + {Credo.Check.Warning.MissedMetadataKeyInLoggerConfig, []}, |
| 174 | + {Credo.Check.Warning.MixEnv, []}, |
| 175 | + {Credo.Check.Warning.OperationOnSameValues, []}, |
| 176 | + {Credo.Check.Warning.OperationWithConstantResult, []}, |
| 177 | + {Credo.Check.Warning.RaiseInsideRescue, []}, |
| 178 | + {Credo.Check.Warning.SpecWithStruct, []}, |
| 179 | + {Credo.Check.Warning.UnsafeExec, []}, |
| 180 | + {Credo.Check.Warning.UnsafeToAtom, []}, |
| 181 | + {Credo.Check.Warning.UnusedEnumOperation, []}, |
| 182 | + {Credo.Check.Warning.UnusedFileOperation, []}, |
| 183 | + {Credo.Check.Warning.UnusedKeywordOperation, []}, |
| 184 | + {Credo.Check.Warning.UnusedListOperation, []}, |
| 185 | + {Credo.Check.Warning.UnusedPathOperation, []}, |
| 186 | + {Credo.Check.Warning.UnusedRegexOperation, []}, |
| 187 | + {Credo.Check.Warning.UnusedStringOperation, []}, |
| 188 | + {Credo.Check.Warning.UnusedTupleOperation, []}, |
| 189 | + {Credo.Check.Warning.WrongTestFileExtension, []} |
| 190 | + ], |
| 191 | + disabled: [ |
| 192 | + # |
| 193 | + # Controversial and experimental checks (opt-in, just move the check to `:enabled` |
| 194 | + # and be sure to use `mix credo --strict` to see low priority checks) |
| 195 | + # |
| 196 | + {Credo.Check.Readability.MultiAlias, []}, |
| 197 | + {Credo.Check.Readability.NestedFunctionCalls, []}, |
| 198 | + {Credo.Check.Readability.OnePipePerLine, []}, |
| 199 | + {Credo.Check.Readability.Specs, []}, |
| 200 | + {Credo.Check.Refactor.ModuleDependencies, []}, |
| 201 | + {Credo.Check.Refactor.VariableRebinding, []} |
153 | 202 |
|
154 |
| - # |
155 |
| - # Checks scheduled for next check update (opt-in for now, just replace `false` with `[]`) |
| 203 | + # {Credo.Check.Refactor.MapInto, []}, |
156 | 204 |
|
157 |
| - # |
158 |
| - # Controversial and experimental checks (opt-in, just replace `false` with `[]`) |
159 |
| - # |
160 |
| - {Credo.Check.Consistency.MultiAliasImportRequireUse, []}, |
161 |
| - {Credo.Check.Consistency.UnusedVariableNames, []}, |
162 |
| - {Credo.Check.Design.DuplicatedCode, []}, |
163 |
| - {Credo.Check.Readability.AliasAs, []}, |
164 |
| - {Credo.Check.Readability.BlockPipe, []}, |
165 |
| - {Credo.Check.Readability.ImplTrue, []}, |
166 |
| - {Credo.Check.Readability.MultiAlias, false}, |
167 |
| - {Credo.Check.Readability.SeparateAliasRequire, []}, |
168 |
| - {Credo.Check.Readability.SinglePipe, []}, |
169 |
| - {Credo.Check.Readability.Specs, false}, |
170 |
| - {Credo.Check.Readability.StrictModuleLayout, []}, |
171 |
| - {Credo.Check.Readability.WithCustomTaggedTuple, []}, |
172 |
| - {Credo.Check.Refactor.ABCSize, []}, |
173 |
| - {Credo.Check.Refactor.AppendSingleItem, []}, |
174 |
| - {Credo.Check.Refactor.DoubleBooleanNegation, []}, |
175 |
| - {Credo.Check.Refactor.ModuleDependencies, false}, |
176 |
| - {Credo.Check.Refactor.NegatedIsNil, []}, |
177 |
| - {Credo.Check.Refactor.PipeChainStart, []}, |
178 |
| - {Credo.Check.Refactor.VariableRebinding, false}, |
179 |
| - {Credo.Check.Warning.LeakyEnvironment, []}, |
180 |
| - {Credo.Check.Warning.MapGetUnsafePass, []}, |
181 |
| - {Credo.Check.Warning.UnsafeToAtom, []} |
182 |
| - |
183 |
| - # |
184 |
| - # Custom checks can be created using `mix credo.gen.check`. |
185 |
| - # |
186 |
| - ] |
| 205 | + # |
| 206 | + # Custom checks can be created using `mix credo.gen.check`. |
| 207 | + # |
| 208 | + ] |
| 209 | + } |
187 | 210 | }
|
188 | 211 | ]
|
189 | 212 | }
|
0 commit comments