|
51 | 51 | # |
52 | 52 | ## Consistency Checks |
53 | 53 | # |
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}, |
| 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, []}, |
60 | 60 |
|
61 | 61 | # |
62 | 62 | ## Design Checks |
63 | 63 | # |
64 | 64 | # You can customize the priority of any check |
65 | 65 | # Priority values are: `low, normal, high, higher` |
66 | 66 | # |
67 | | - {Credo.Check.Design.AliasUsage, priority: :low}, |
| 67 | + {Credo.Check.Design.AliasUsage, |
| 68 | + [ |
| 69 | + priority: :low, |
| 70 | + if_nested_deeper_than: 2, |
| 71 | + if_called_more_often_than: 0 |
| 72 | + ]}, |
68 | 73 | # For some checks, you can also set other parameters |
69 | 74 | # |
70 | 75 | # If you don't want the `setup` and `test` macro calls in ExUnit tests |
71 | 76 | # or the `schema` macro in Ecto schemas to trigger DuplicatedCode, just |
72 | 77 | # set the `excluded_macros` parameter to `[:schema, :setup, :test]`. |
73 | 78 | # |
74 | | - {Credo.Check.Design.DuplicatedCode, excluded_macros: []}, |
| 79 | + {Credo.Check.Design.DuplicatedCode, [excluded_macros: []]}, |
75 | 80 | # You can also customize the exit_status of each check. |
76 | 81 | # If you don't want TODO comments to cause `mix credo` to fail, just |
77 | 82 | # set this value to 0 (zero). |
78 | 83 | # |
79 | | - {Credo.Check.Design.TagTODO, exit_status: 0}, |
80 | | - {Credo.Check.Design.TagFIXME}, |
| 84 | + {Credo.Check.Design.TagTODO, [exit_status: 0]}, |
| 85 | + {Credo.Check.Design.TagFIXME, []}, |
81 | 86 |
|
82 | 87 | # |
83 | 88 | ## Readability Checks |
84 | 89 | # |
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}, |
| 90 | + {Credo.Check.Readability.AliasOrder, []}, |
| 91 | + {Credo.Check.Readability.FunctionNames, []}, |
| 92 | + {Credo.Check.Readability.LargeNumbers, []}, |
| 93 | + {Credo.Check.Readability.MaxLineLength, |
| 94 | + [priority: :low, max_length: 80]}, |
| 95 | + {Credo.Check.Readability.ModuleAttributeNames, []}, |
| 96 | + {Credo.Check.Readability.ModuleDoc, []}, |
| 97 | + {Credo.Check.Readability.ModuleNames, []}, |
| 98 | + {Credo.Check.Readability.ParenthesesInCondition, []}, |
| 99 | + {Credo.Check.Readability.ParenthesesOnZeroArityDefs, []}, |
| 100 | + {Credo.Check.Readability.PredicateFunctionNames, []}, |
| 101 | + {Credo.Check.Readability.PreferImplicitTry, []}, |
| 102 | + {Credo.Check.Readability.RedundantBlankLines, []}, |
| 103 | + {Credo.Check.Readability.Semicolons, []}, |
| 104 | + {Credo.Check.Readability.SpaceAfterCommas, []}, |
| 105 | + {Credo.Check.Readability.StringSigils, []}, |
| 106 | + {Credo.Check.Readability.TrailingBlankLine, []}, |
| 107 | + {Credo.Check.Readability.TrailingWhiteSpace, []}, |
| 108 | + {Credo.Check.Readability.VariableNames, []}, |
103 | 109 |
|
104 | 110 | # |
105 | 111 | ## Refactoring Opportunities |
106 | 112 | # |
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}, |
| 113 | + {Credo.Check.Refactor.CondStatements, []}, |
| 114 | + {Credo.Check.Refactor.CyclomaticComplexity, []}, |
| 115 | + {Credo.Check.Refactor.FunctionArity, []}, |
| 116 | + {Credo.Check.Refactor.LongQuoteBlocks, []}, |
| 117 | + {Credo.Check.Refactor.MapInto, []}, |
| 118 | + {Credo.Check.Refactor.MatchInCondition, []}, |
| 119 | + {Credo.Check.Refactor.NegatedConditionsInUnless, []}, |
| 120 | + {Credo.Check.Refactor.NegatedConditionsWithElse, []}, |
| 121 | + {Credo.Check.Refactor.Nesting, []}, |
117 | 122 | {Credo.Check.Refactor.PipeChainStart, |
118 | | - excluded_argument_types: [:atom, :binary, :fn, :keyword], |
119 | | - excluded_functions: []}, |
120 | | - {Credo.Check.Refactor.UnlessWithElse}, |
| 123 | + [ |
| 124 | + excluded_argument_types: [:atom, :binary, :fn, :keyword], |
| 125 | + excluded_functions: [] |
| 126 | + ]}, |
| 127 | + {Credo.Check.Refactor.UnlessWithElse, []}, |
121 | 128 |
|
122 | 129 | # |
123 | 130 | ## Warnings |
124 | 131 | # |
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}, |
| 132 | + {Credo.Check.Warning.BoolOperationOnSameValues, []}, |
| 133 | + {Credo.Check.Warning.ExpensiveEmptyEnumCheck, []}, |
| 134 | + {Credo.Check.Warning.IExPry, []}, |
| 135 | + {Credo.Check.Warning.IoInspect, []}, |
| 136 | + {Credo.Check.Warning.LazyLogging, []}, |
| 137 | + {Credo.Check.Warning.OperationOnSameValues, []}, |
| 138 | + {Credo.Check.Warning.OperationWithConstantResult, []}, |
| 139 | + {Credo.Check.Warning.RaiseInsideRescue, []}, |
| 140 | + {Credo.Check.Warning.UnusedEnumOperation, []}, |
| 141 | + {Credo.Check.Warning.UnusedFileOperation, []}, |
| 142 | + {Credo.Check.Warning.UnusedKeywordOperation, []}, |
| 143 | + {Credo.Check.Warning.UnusedListOperation, []}, |
| 144 | + {Credo.Check.Warning.UnusedPathOperation, []}, |
| 145 | + {Credo.Check.Warning.UnusedRegexOperation, []}, |
| 146 | + {Credo.Check.Warning.UnusedStringOperation, []}, |
| 147 | + {Credo.Check.Warning.UnusedTupleOperation, []}, |
141 | 148 |
|
142 | 149 | # |
143 | 150 | # Controversial and experimental checks (opt-in, just remove `, false`) |
144 | 151 | # |
| 152 | + {Credo.Check.Consistency.MultiAliasImportRequireUse, false}, |
| 153 | + {Credo.Check.Readability.Specs, false}, |
145 | 154 | {Credo.Check.Refactor.ABCSize, false}, |
146 | 155 | {Credo.Check.Refactor.AppendSingleItem, false}, |
| 156 | + {Credo.Check.Refactor.DoubleBooleanNegation, false}, |
147 | 157 | {Credo.Check.Refactor.VariableRebinding, false}, |
148 | 158 | {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} |
| 159 | + {Credo.Check.Warning.UnsafeToAtom, false} |
155 | 160 |
|
156 | 161 | # |
157 | 162 | # Custom checks can be created using `mix credo.gen.check`. |
|
0 commit comments