57 lines
2.0 KiB
Elixir
57 lines
2.0 KiB
Elixir
%{
|
|
configs: [
|
|
%{
|
|
name: "default",
|
|
requires: [
|
|
"./deps/phoenix_test/lib/phoenix_test/credo/**/*.ex"
|
|
],
|
|
plugins: [{ExSlop, []}],
|
|
checks: %{
|
|
extra: [
|
|
{PhoenixTest.Credo.NoOpenBrowser, []},
|
|
{MusicLibrary.Credo.NoLiveComponentPutToast, []},
|
|
{Credo.Check.Warning.ExpensiveEmptyEnumCheck, []},
|
|
{Credo.Check.Refactor.DoubleBooleanNegation, []},
|
|
{Credo.Check.Refactor.CondStatements, []},
|
|
{Credo.Check.Refactor.MapMap, []},
|
|
{Credo.Check.Refactor.FilterFilter, []},
|
|
{Credo.Check.Refactor.RejectReject, []},
|
|
{Credo.Check.Refactor.FilterCount, []},
|
|
{Credo.Check.Refactor.NegatedConditionsInUnless, []},
|
|
{Credo.Check.Refactor.UnlessWithElse, []},
|
|
{Credo.Check.Refactor.Nesting, max_nesting: 3},
|
|
{Credo.Check.Readability.ModuleDoc,
|
|
ignore_names: [
|
|
# Credo defaults
|
|
~r/(\.\w+Controller|\.Endpoint|\.\w+Live(\.\w+)?|\.Repo|\.Router|\.\w+Socket|\.\w+View|\.\w+HTML|\.\w+JSON|\.Telemetry|\.Layouts|\.Mailer)$/,
|
|
# Custom: external API internals follow a three-module pattern
|
|
# where only the facade needs documentation
|
|
~r/\.API(\..*)?$/,
|
|
~r/\.Config$/,
|
|
# Custom: test support modules
|
|
~r/Fixtures/,
|
|
# Custom: mix tasks
|
|
~r/^Mix\.Tasks\./
|
|
],
|
|
ignore_modules_using: [
|
|
# Credo defaults
|
|
Credo.Check,
|
|
Ecto.Schema,
|
|
Phoenix.LiveView,
|
|
~r/\.Web$/,
|
|
# Custom: LiveComponents and Oban workers are self-documenting
|
|
Oban.Worker,
|
|
# Matches `use MusicLibraryWeb, :live_component` etc.
|
|
MusicLibraryWeb
|
|
]},
|
|
{Credo.Check.Refactor.CyclomaticComplexity, max_complexity: 12}
|
|
],
|
|
disabled: [
|
|
{Credo.Check.Refactor.AppendSingleItem, []}
|
|
]
|
|
}
|
|
# files etc.
|
|
}
|
|
]
|
|
}
|