|
10 | 10 | configs: [
|
11 | 11 | %{
|
12 | 12 | #
|
13 |
| - # Run any config using `mix credo -C <name>`. If no config name is given |
| 13 | + # Run any exec using `mix credo -C <name>`. If no exec name is given |
14 | 14 | # "default" is used.
|
| 15 | + # |
15 | 16 | name: "default",
|
16 | 17 | #
|
17 | 18 | # These are the files included in the analysis:
|
18 | 19 | files: %{
|
19 | 20 | #
|
20 | 21 | # You can give explicit globs or simply directories.
|
21 | 22 | # In the latter case `**/*.{ex,exs}` will be used.
|
22 |
| - included: ["config/", "lib/", "test/"], |
23 |
| - excluded: [~r"/_build/", ~r"/deps/", "config/deploy/"] |
| 23 | + # |
| 24 | + included: ["config/", "lib/", "src/", "test/", "web/", "apps/"], |
| 25 | + excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/", ~r"config/deploy/"] |
24 | 26 | },
|
25 | 27 | #
|
26 | 28 | # If you create your own checks, you must specify the source files for
|
27 | 29 | # them here, so they can be loaded by Credo before running the analysis.
|
28 |
| - requires: [], |
29 | 30 | #
|
30 |
| - # Credo automatically checks for updates, like e.g. Hex does. |
31 |
| - # You can disable this behaviour below: |
32 |
| - check_for_updates: true, |
| 31 | + requires: [], |
33 | 32 | #
|
34 | 33 | # If you want to enforce a style guide and need a more traditional linting
|
35 | 34 | # experience, you can change `strict` to `true` below:
|
| 35 | + # |
36 | 36 | strict: true,
|
37 | 37 | #
|
38 | 38 | # If you want to use uncolored output by default, you can change `color`
|
39 | 39 | # to `false` below:
|
| 40 | + # |
40 | 41 | color: true,
|
41 | 42 | #
|
42 | 43 | # You can customize the parameters of any check by adding a second element
|
|
47 | 48 | # {Credo.Check.Design.DuplicatedCode, false}
|
48 | 49 | #
|
49 | 50 | checks: [
|
50 |
| - {Credo.Check.Consistency.ExceptionNames}, |
51 |
| - {Credo.Check.Consistency.LineEndings}, |
52 |
| - {Credo.Check.Consistency.MultiAliasImportRequireUse}, |
53 |
| - {Credo.Check.Consistency.ParameterPatternMatching}, |
54 |
| - {Credo.Check.Consistency.SpaceAroundOperators}, |
55 |
| - {Credo.Check.Consistency.SpaceInParentheses}, |
56 |
| - {Credo.Check.Consistency.TabsOrSpaces}, |
| 51 | + # |
| 52 | + ## Consistency Checks |
| 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, []}, |
57 | 60 |
|
58 |
| - # For some checks, like AliasUsage, you can only customize the priority |
| 61 | + # |
| 62 | + ## Design Checks |
| 63 | + # |
| 64 | + # You can customize the priority of any check |
59 | 65 | # Priority values are: `low, normal, high, higher`
|
60 |
| - {Credo.Check.Design.AliasUsage, priority: :low}, |
61 |
| - |
62 |
| - # For others you can set parameters |
63 |
| - |
| 66 | + # |
| 67 | + {Credo.Check.Design.AliasUsage, [priority: :low]}, |
| 68 | + # For some checks, you can also set other parameters |
| 69 | + # |
64 | 70 | # If you don't want the `setup` and `test` macro calls in ExUnit tests
|
65 | 71 | # or the `schema` macro in Ecto schemas to trigger DuplicatedCode, just
|
66 | 72 | # set the `excluded_macros` parameter to `[:schema, :setup, :test]`.
|
67 |
| - {Credo.Check.Design.DuplicatedCode, excluded_macros: []}, |
68 |
| - |
| 73 | + # |
| 74 | + {Credo.Check.Design.DuplicatedCode, [excluded_macros: []]}, |
69 | 75 | # You can also customize the exit_status of each check.
|
70 | 76 | # If you don't want TODO comments to cause `mix credo` to fail, just
|
71 | 77 | # set this value to 0 (zero).
|
72 |
| - {Credo.Check.Design.TagTODO, exit_status: 2}, |
73 |
| - {Credo.Check.Design.TagFIXME}, |
| 78 | + # |
| 79 | + {Credo.Check.Design.TagTODO, [exit_status: 2]}, |
| 80 | + {Credo.Check.Design.TagFIXME, []}, |
74 | 81 |
|
75 |
| - {Credo.Check.Readability.FunctionNames}, |
76 |
| - {Credo.Check.Readability.LargeNumbers}, |
77 |
| - {Credo.Check.Readability.MaxLineLength, priority: :low, max_length: 100}, |
78 |
| - {Credo.Check.Readability.ModuleAttributeNames}, |
79 |
| - {Credo.Check.Readability.ModuleDoc}, |
80 |
| - {Credo.Check.Readability.ModuleNames}, |
81 |
| - {Credo.Check.Readability.ParenthesesOnZeroArityDefs}, |
82 |
| - {Credo.Check.Readability.ParenthesesInCondition}, |
83 |
| - {Credo.Check.Readability.PredicateFunctionNames}, |
84 |
| - {Credo.Check.Readability.PreferImplicitTry}, |
85 |
| - {Credo.Check.Readability.RedundantBlankLines}, |
| 82 | + # |
| 83 | + ## Readability Checks |
| 84 | + # |
| 85 | + {Credo.Check.Readability.AliasOrder, []}, |
| 86 | + {Credo.Check.Readability.FunctionNames, []}, |
| 87 | + {Credo.Check.Readability.LargeNumbers, []}, |
| 88 | + {Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]}, |
| 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, []}, |
86 | 97 | {Credo.Check.Readability.StringSigils, false},
|
87 |
| - {Credo.Check.Readability.TrailingBlankLine}, |
88 |
| - {Credo.Check.Readability.TrailingWhiteSpace}, |
89 |
| - {Credo.Check.Readability.VariableNames}, |
90 |
| - {Credo.Check.Readability.Semicolons}, |
91 |
| - {Credo.Check.Readability.SpaceAfterCommas}, |
| 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, []}, |
92 | 103 |
|
93 |
| - {Credo.Check.Refactor.DoubleBooleanNegation}, |
94 |
| - {Credo.Check.Refactor.CondStatements}, |
95 |
| - {Credo.Check.Refactor.CyclomaticComplexity}, |
96 |
| - {Credo.Check.Refactor.FunctionArity}, |
97 |
| - {Credo.Check.Refactor.MatchInCondition}, |
98 |
| - {Credo.Check.Refactor.NegatedConditionsInUnless}, |
99 |
| - {Credo.Check.Refactor.NegatedConditionsWithElse}, |
100 |
| - {Credo.Check.Refactor.Nesting}, |
101 |
| - {Credo.Check.Refactor.PipeChainStart}, |
102 |
| - {Credo.Check.Refactor.UnlessWithElse}, |
| 104 | + # |
| 105 | + ## Refactoring Opportunities |
| 106 | + # |
| 107 | + {Credo.Check.Refactor.DoubleBooleanNegation, []}, |
| 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, []}, |
| 117 | + {Credo.Check.Refactor.PipeChainStart, |
| 118 | + [excluded_argument_types: [:atom, :binary, :fn, :keyword], excluded_functions: []]}, |
| 119 | + {Credo.Check.Refactor.UnlessWithElse, []}, |
103 | 120 |
|
104 |
| - {Credo.Check.Warning.BoolOperationOnSameValues}, |
105 |
| - {Credo.Check.Warning.IExPry}, |
106 |
| - {Credo.Check.Warning.IoInspect}, |
107 |
| - {Credo.Check.Warning.LazyLogging}, |
108 |
| - {Credo.Check.Warning.OperationOnSameValues}, |
109 |
| - {Credo.Check.Warning.OperationWithConstantResult}, |
110 |
| - {Credo.Check.Warning.UnusedEnumOperation}, |
111 |
| - {Credo.Check.Warning.UnusedFileOperation}, |
112 |
| - {Credo.Check.Warning.UnusedKeywordOperation}, |
113 |
| - {Credo.Check.Warning.UnusedListOperation}, |
114 |
| - {Credo.Check.Warning.UnusedPathOperation}, |
115 |
| - {Credo.Check.Warning.UnusedRegexOperation}, |
116 |
| - {Credo.Check.Warning.UnusedStringOperation}, |
117 |
| - {Credo.Check.Warning.UnusedTupleOperation}, |
| 121 | + # |
| 122 | + ## Warnings |
| 123 | + # |
| 124 | + {Credo.Check.Warning.BoolOperationOnSameValues, []}, |
| 125 | + {Credo.Check.Warning.ExpensiveEmptyEnumCheck, []}, |
| 126 | + {Credo.Check.Warning.IExPry, []}, |
| 127 | + {Credo.Check.Warning.IoInspect, []}, |
| 128 | + {Credo.Check.Warning.LazyLogging, []}, |
| 129 | + {Credo.Check.Warning.OperationOnSameValues, []}, |
| 130 | + {Credo.Check.Warning.OperationWithConstantResult, []}, |
| 131 | + {Credo.Check.Warning.UnusedEnumOperation, []}, |
| 132 | + {Credo.Check.Warning.UnusedFileOperation, []}, |
| 133 | + {Credo.Check.Warning.UnusedKeywordOperation, []}, |
| 134 | + {Credo.Check.Warning.UnusedListOperation, []}, |
| 135 | + {Credo.Check.Warning.UnusedPathOperation, []}, |
| 136 | + {Credo.Check.Warning.UnusedRegexOperation, []}, |
| 137 | + {Credo.Check.Warning.UnusedStringOperation, []}, |
| 138 | + {Credo.Check.Warning.UnusedTupleOperation, []}, |
| 139 | + {Credo.Check.Warning.RaiseInsideRescue, []}, |
118 | 140 |
|
| 141 | + # |
119 | 142 | # Controversial and experimental checks (opt-in, just remove `, false`)
|
120 | 143 | #
|
121 | 144 | {Credo.Check.Refactor.ABCSize, false},
|
122 | 145 | {Credo.Check.Refactor.AppendSingleItem, false},
|
123 | 146 | {Credo.Check.Refactor.VariableRebinding, false},
|
124 | 147 | {Credo.Check.Warning.MapGetUnsafePass, false},
|
| 148 | + {Credo.Check.Consistency.MultiAliasImportRequireUse, false}, |
125 | 149 |
|
| 150 | + # |
126 | 151 | # Deprecated checks (these will be deleted after a grace period)
|
127 |
| - {Credo.Check.Readability.Specs, false}, |
128 |
| - {Credo.Check.Warning.NameRedeclarationByAssignment, false}, |
129 |
| - {Credo.Check.Warning.NameRedeclarationByCase, false}, |
130 |
| - {Credo.Check.Warning.NameRedeclarationByDef, false}, |
131 |
| - {Credo.Check.Warning.NameRedeclarationByFn, false}, |
| 152 | + # |
| 153 | + {Credo.Check.Readability.Specs, false} |
132 | 154 |
|
| 155 | + # |
133 | 156 | # Custom checks can be created using `mix credo.gen.check`.
|
134 | 157 | #
|
135 | 158 | ]
|
|
0 commit comments