Nothing much just a build up of things
[anni] / .credo.exs
1 # This file contains the configuration for Credo and you are probably reading
2 # this after creating it with `mix credo.gen.config`.
3 #
4 # If you find anything wrong or unclear in this file, please report an
5 # issue on GitHub: https://github.com/rrrene/credo/issues
6 #
7 %{
8   #
9   # You can have as many configs as you like in the `configs:` field.
10   configs: [
11     %{
12       #
13       # Run any config using `mix credo -C <name>`. If no config name is given
14       # "default" is used.
15       name: "default",
16       #
17       # These are the files included in the analysis:
18       files: %{
19         #
20         # You can give explicit globs or simply directories.
21         # In the latter case `**/*.{ex,exs}` will be used.
22         included: ["lib/", "src/", "web/", "apps/", "test/"],
23         excluded: [~r"/_build/", ~r"/deps/"]
24       },
25       #
26       # If you create your own checks, you must specify the source files for
27       # them here, so they can be loaded by Credo before running the analysis.
28       requires: ["./test/credo/check/consistency/file_location.ex"],
29       #
30       # Credo automatically checks for updates, like e.g. Hex does.
31       # You can disable this behaviour below:
32       check_for_updates: true,
33       #
34       # If you want to enforce a style guide and need a more traditional linting
35       # experience, you can change `strict` to `true` below:
36       strict: false,
37       #
38       # If you want to use uncolored output by default, you can change `color`
39       # to `false` below:
40       color: true,
41       #
42       # You can customize the parameters of any check by adding a second element
43       # to the tuple.
44       #
45       # To disable a check put `false` as second element:
46       #
47       #     {Credo.Check.Design.DuplicatedCode, false}
48       #
49       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},
57
58         # For some checks, like AliasUsage, you can only customize the priority
59         # Priority values are: `low, normal, high, higher`
60         {Credo.Check.Design.AliasUsage, priority: :low, if_called_more_often_than: 3},
61
62         # For others you can set parameters
63
64         # If you don't want the `setup` and `test` macro calls in ExUnit tests
65         # or the `schema` macro in Ecto schemas to trigger DuplicatedCode, just
66         # set the `excluded_macros` parameter to `[:schema, :setup, :test]`.
67         {Credo.Check.Design.DuplicatedCode, excluded_macros: []},
68
69         # You can also customize the exit_status of each check.
70         # If you don't want TODO comments to cause `mix credo` to fail, just
71         # set this value to 0 (zero).
72         {Credo.Check.Design.TagTODO, exit_status: 0},
73         {Credo.Check.Design.TagFIXME, exit_status: 0},
74         {Credo.Check.Readability.FunctionNames},
75         {Credo.Check.Readability.LargeNumbers},
76         {Credo.Check.Readability.MaxLineLength, priority: :low, max_length: 100},
77         {Credo.Check.Readability.ModuleAttributeNames},
78         {Credo.Check.Readability.ModuleDoc, false},
79         {Credo.Check.Readability.ModuleNames},
80         {Credo.Check.Readability.ParenthesesOnZeroArityDefs},
81         {Credo.Check.Readability.ParenthesesInCondition},
82         {Credo.Check.Readability.PredicateFunctionNames},
83         # lanodan: I think PreferImplicitTry should be consistency, and the behaviour seems
84         # inconsistent, see: https://github.com/rrrene/credo/issues/224
85         {Credo.Check.Readability.PreferImplicitTry, false},
86         {Credo.Check.Readability.PipeIntoAnonymousFunctions, exit_status: 0},
87         {Credo.Check.Readability.RedundantBlankLines},
88         {Credo.Check.Readability.StringSigils},
89         {Credo.Check.Readability.TrailingBlankLine},
90         {Credo.Check.Readability.TrailingWhiteSpace},
91         {Credo.Check.Readability.VariableNames},
92         {Credo.Check.Readability.Semicolons},
93         {Credo.Check.Readability.SpaceAfterCommas},
94         {Credo.Check.Readability.WithSingleClause, exit_status: 0},
95         {Credo.Check.Refactor.DoubleBooleanNegation},
96         {Credo.Check.Refactor.CondStatements},
97         {Credo.Check.Refactor.CyclomaticComplexity},
98         {Credo.Check.Refactor.FunctionArity},
99         {Credo.Check.Refactor.MatchInCondition},
100         {Credo.Check.Refactor.NegatedConditionsInUnless},
101         {Credo.Check.Refactor.NegatedConditionsWithElse},
102         {Credo.Check.Refactor.Nesting},
103         {Credo.Check.Refactor.PipeChainStart},
104         {Credo.Check.Refactor.UnlessWithElse},
105         {Credo.Check.Warning.BoolOperationOnSameValues},
106         {Credo.Check.Warning.IExPry},
107         {Credo.Check.Warning.IoInspect},
108         # Got too much of them, not sure if relevant
109         {Credo.Check.Warning.LazyLogging, false},
110         {Credo.Check.Warning.OperationOnSameValues},
111         {Credo.Check.Warning.OperationWithConstantResult},
112         {Credo.Check.Warning.UnusedEnumOperation},
113         {Credo.Check.Warning.UnusedFileOperation},
114         {Credo.Check.Warning.UnusedKeywordOperation},
115         {Credo.Check.Warning.UnusedListOperation},
116         {Credo.Check.Warning.UnusedPathOperation},
117         {Credo.Check.Warning.UnusedRegexOperation},
118         {Credo.Check.Warning.UnusedStringOperation},
119         {Credo.Check.Warning.UnusedTupleOperation},
120
121         # Controversial and experimental checks (opt-in, just remove `, false`)
122         #
123         {Credo.Check.Refactor.ABCSize, false},
124         {Credo.Check.Refactor.AppendSingleItem, false},
125         {Credo.Check.Refactor.VariableRebinding, false},
126         {Credo.Check.Warning.MapGetUnsafePass, false},
127
128         # Deprecated checks (these will be deleted after a grace period)
129         {Credo.Check.Readability.Specs, false},
130
131         # Custom checks can be created using `mix credo.gen.check`.
132         #
133         {Credo.Check.Consistency.FileLocation}
134       ]
135     }
136   ]
137 }