|
23 | 23 | # You can give explicit globs or simply directories. |
24 | 24 | # In the latter case `**/*.{ex,exs}` will be used. |
25 | 25 | # |
26 | | - included: ["lib/", "priv/", "test/"], |
| 26 | + included: ["config/", "lib/", "priv/", "test/"], |
27 | 27 | excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"] |
28 | 28 | }, |
29 | 29 | # |
|
81 | 81 | # You can customize the priority of any check |
82 | 82 | # Priority values are: `low, normal, high, higher` |
83 | 83 | # |
84 | | - {Credo.Check.Design.AliasUsage, [priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 2]}, |
| 84 | + {Credo.Check.Design.AliasUsage, [priority: :low, if_nested_deeper_than: 4, if_called_more_often_than: 2]}, |
85 | 85 | {Credo.Check.Design.DuplicatedCode, false}, |
86 | 86 | # You can also customize the exit_status of each check. |
87 | 87 | # If you don't want TODO comments to cause `mix credo` to fail, just |
|
95 | 95 | # |
96 | 96 | {Credo.Check.Readability.AliasAs, false}, |
97 | 97 | {Credo.Check.Readability.AliasOrder, []}, |
98 | | - {Credo.Check.Readability.BlockPipe, []}, |
| 98 | + # We previously had this check enabled, but we have agreed to loosen this restriction to allow for more flexibility. |
| 99 | + # {Credo.Check.Readability.BlockPipe, []}, |
99 | 100 | {Credo.Check.Readability.FunctionNames, []}, |
100 | 101 | {Credo.Check.Readability.ImplTrue, []}, |
101 | 102 | {Credo.Check.Readability.LargeNumbers, [trailing_digits: 2]}, |
|
112 | 113 | {Credo.Check.Readability.RedundantBlankLines, []}, |
113 | 114 | {Credo.Check.Readability.Semicolons, []}, |
114 | 115 | {Credo.Check.Readability.SeparateAliasRequire, []}, |
115 | | - {Credo.Check.Readability.SinglePipe, []}, |
| 116 | + # We previously had this check enabled, but we have agreed to loosen this restriction. |
| 117 | + # Use common sense, piping a single arg into an arity 1 function like `input |> do_something()` should be avoided. |
| 118 | + # {Credo.Check.Readability.SinglePipe, []}, |
116 | 119 | {Credo.Check.Readability.SpaceAfterCommas, []}, |
117 | 120 | {Credo.Check.Readability.Specs, false}, |
118 | 121 | {Credo.Check.Readability.StrictModuleLayout, |
119 | 122 | [ |
120 | 123 | order: |
121 | 124 | ~w(moduledoc behaviour use import require alias module_attribute defstruct callback macrocallback optional_callback)a, |
122 | | - ignore: [:type] |
| 125 | + ignore: [:type], |
| 126 | + ignore_module_attributes: [:contract, :decorate, :operation, :trace] |
123 | 127 | ]}, |
124 | 128 | {Credo.Check.Readability.StringSigils, []}, |
125 | 129 | {Credo.Check.Readability.TrailingBlankLine, []}, |
|
145 | 149 | {Credo.Check.Refactor.NegatedConditionsWithElse, []}, |
146 | 150 | {Credo.Check.Refactor.NegatedIsNil, []}, |
147 | 151 | {Credo.Check.Refactor.Nesting, []}, |
148 | | - {Credo.Check.Refactor.PipeChainStart, []}, |
| 152 | + # We have an exception for `from` which is useful for piping a query into a `Repo` function. |
| 153 | + {Credo.Check.Refactor.PipeChainStart, [excluded_functions: ["from"]]}, |
149 | 154 | {Credo.Check.Refactor.UnlessWithElse, []}, |
150 | 155 | {Credo.Check.Refactor.VariableRebinding, false}, |
151 | 156 | {Credo.Check.Refactor.WithClauses, []}, |
|
177 | 182 | {Credo.Check.Warning.UnusedPathOperation, []}, |
178 | 183 | {Credo.Check.Warning.UnusedRegexOperation, []}, |
179 | 184 | {Credo.Check.Warning.UnusedStringOperation, []}, |
180 | | - {Credo.Check.Warning.UnusedTupleOperation, []} |
| 185 | + {Credo.Check.Warning.UnusedTupleOperation, []}, |
| 186 | + |
| 187 | + # |
| 188 | + ## Custom |
| 189 | + # |
| 190 | + {Credo.Check.Warning.ForbiddenModule, |
| 191 | + [ |
| 192 | + modules: [ |
| 193 | + {Oban.Worker, "use Oban.Pro.Worker instead"} |
| 194 | + ] |
| 195 | + ]} |
181 | 196 | ] |
182 | 197 | } |
183 | 198 | ] |
|
0 commit comments