-
Notifications
You must be signed in to change notification settings - Fork 34
/
.credo.exs
45 lines (42 loc) · 1.23 KB
/
.credo.exs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
overwrite_checks = [
{Credo.Check.Design.TagTODO, false},
{Credo.Check.Readability.AliasAs, false},
{Credo.Check.Readability.OnePipePerLine, false},
{Credo.Check.Readability.SinglePipe, false},
{Credo.Check.Readability.Specs, false},
{Credo.Check.Readability.StrictModuleLayout, ignore_module_attributes: ~w[config_schema]a},
{Credo.Check.Refactor.ABCSize, false},
{Credo.Check.Refactor.ModuleDependencies, false},
{Credo.Check.Refactor.PipeChainStart, false},
{Credo.Check.Refactor.VariableRebinding, false},
{Credo.Check.Warning.LazyLogging, false}
]
all_checks =
Code.eval_file("deps/credo/.credo.exs")
|> get_in([Access.elem(0), :configs, Access.at(0), :checks])
|> then(fn checks -> checks.enabled ++ checks.disabled end)
project_checks =
Enum.reduce(overwrite_checks, all_checks, fn {check, config}, acc ->
Keyword.replace(acc, check, config)
end)
%{
configs: [
%{
name: "default",
files: %{
included: [
"lib/",
"test/",
"priv/"
],
excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"]
},
plugins: [],
requires: [],
strict: true,
parse_timeout: 5000,
color: true,
checks: project_checks
}
]
}