mix metacredo.gen.config (MetaCredo v0.6.2)

View Source

Generates a .metacredo.exs configuration file in the current directory.

The generated file lists every available MetaCredo check grouped by category. To disable a check, move its entry to the disabled list or set its second element to false:

{MetaCredo.Check.Security.SQLInjection, false}

Example Output

%{
  configs: [
    %{
      name: "default",
      files: %{
        included: ["lib/", "src/", "web/"],
        excluded: [~r"(^|/)_build/", ~r"(^|/)deps/", ~r"(^|/)node_modules/"]
      },
      checks: %{
        enabled: [
          # -- Consistency --
          {MetaCredo.Check.Consistency.ExceptionNames, []},
          ...
        ],
        disabled: []
      }
    }
  ]
}

Usage

$ mix metacredo.gen.config

Options

  • --force - Overwrite an existing .metacredo.exs
  • --global - Generate the configuration file in the user's global config directory (e.g. ~/.config/metacredo/.metacredo.exs)