Skip to content

Changes to Credo Config Break Credo #240

@defndaines

Description

@defndaines

Running 1.5.1 styler against our Credo config file produced the following change:

 %{
+  alias(Credo.Check.Refactor.RedundantWithClauseResult),
   configs: [
     %{
       name: "default",
...
-          {Credo.Check.Refactor.RedundantWithClauseResult, []},
+          {RedundantWithClauseResult, []},
...
-          {Credo.Check.Refactor.RedundantWithClauseResult, []},
+          {RedundantWithClauseResult, []},

Now, this points out that there was a redundancy in the file, so that's the obvious fix on our part. But this change also breaks mix credo:

    error: expected key-value pairs in a map, got: alias Credo.Check.Refactor.RedundantWithClauseResult
    │
  1 │ %{
    │ ^^
    │
    └─ config/.credo.exs:1

warning: Execution halted during Elixir.Credo.Execution.Task.ConvertCLIOptionsToConfig! Unrecognized error: {:badconfig, "...", %CompileError{file: ".../config/.credo.exs", line: 0, description: "cannot compile file (errors have been logged)"}}

Testing, the following change will compile and run:

alias Credo.Check.Refactor.RedundantWithClauseResult

%{
  configs: [
    %{
      name: "default",

I'm not aware of a circumstance where placing an alias() into the map would succeed, so should probably try to avoid that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions