rrrene / credo

A static code analysis tool for the Elixir language with a focus on code consistency and teaching.
http://credo-ci.org/
MIT License
4.94k stars 419 forks source link

Credo fails on elixir 1.15.4 on bad Keyword.drop usage #1066

Closed iloveitaly closed 11 months ago

iloveitaly commented 1 year ago

What were you trying to do?

Run credo on the CLI

Expected outcome

Successful output

Actual outcome

Checking 45 source files ...
Error while running Elixir.Credo.Check.Warning.MissedMetadataKeyInLoggerConfig on THE_FILE
Error while running Elixir.Credo.Check.Warning.MissedMetadataKeyInLoggerConfig on THE_FILE2
Error while running Elixir.Credo.Check.Warning.MissedMetadataKeyInLoggerConfig on THE_FILE3

12:16:12.751 [error] Task #PID<0.2109.0> started from #PID<0.2053.0> terminating
** (FunctionClauseError) no function clause matching in Keyword.drop/2
    (elixir 1.15.4) lib/keyword.ex:1262: Keyword.drop([name: {:name, [line: 57, column: 75], nil}, postal: {:postal, [line: 57, column: 89], nil}], :all)
    (credo 1.7.0) lib/credo/check/warning/missed_metadata_key_in_logger_config.ex:126: Credo.Check.Warning.MissedMetadataKeyInLoggerConfig.issue_for_call/4
    (credo 1.7.0) lib/credo/check/warning/missed_metadata_key_in_logger_config.ex:59: Credo.Check.Warning.MissedMetadataKeyInLoggerConfig.traverse/3
    (elixir 1.15.4) lib/macro.ex:688: anonymous fn/4 in Macro.do_traverse_args/4
    (stdlib 5.0.2) lists.erl:1706: :lists.mapfoldl_1/3
    (elixir 1.15.4) lib/macro.ex:653: Macro.do_traverse/4
    (stdlib 5.0.2) lists.erl:1706: :lists.mapfoldl_1/3
    (stdlib 5.0.2) lists.erl:1707: :lists.mapfoldl_1/3
Function: #Function<4.59091171/0 in Credo.Check.Warning.MissedMetadataKeyInLoggerConfig.do_run_on_all_source_files/3>
    Args: []

12:16:12.751 [error] Task #PID<0.2105.0> started from #PID<0.2053.0> terminating
** (FunctionClauseError) no function clause matching in Keyword.drop/2
    (elixir 1.15.4) lib/keyword.ex:1262: Keyword.drop([address: {:query, [line: 46, column: 48], nil}, error_reason: {:error_reason, [line: 46, column: 69], nil}], :all)
    (credo 1.7.0) lib/credo/check/warning/missed_metadata_key_in_logger_config.ex:126: Credo.Check.Warning.MissedMetadataKeyInLoggerConfig.issue_for_call/4
    (credo 1.7.0) lib/credo/check/warning/missed_metadata_key_in_logger_config.ex:59: Credo.Check.Warning.MissedMetadataKeyInLoggerConfig.traverse/3
    (elixir 1.15.4) lib/macro.ex:688: anonymous fn/4 in Macro.do_traverse_args/4
    (stdlib 5.0.2) lists.erl:1706: :lists.mapfoldl_1/3
    (elixir 1.15.4) lib/macro.ex:653: Macro.do_traverse/4
    (elixir 1.15.4) lib/macro.ex:668: Macro.do_traverse/4
    (stdlib 5.0.2) lists.erl:1706: :lists.mapfoldl_1/3
Function: #Function<4.59091171/0 in Credo.Check.Warning.MissedMetadataKeyInLoggerConfig.do_run_on_all_source_files/3>
    Args: []

12:16:12.751 [error] Task #PID<0.2113.0> started from #PID<0.2053.0> terminating
** (FunctionClauseError) no function clause matching in Keyword.drop/2
    (elixir 1.15.4) lib/keyword.ex:1262: Keyword.drop([parish_id: {{:., [line: 20, column: 49], [{:parish, [line: 20, column: 43], nil}, :id]}, [no_parens: true, line: 20, column: 50], []}], :all)
    (credo 1.7.0) lib/credo/check/warning/missed_metadata_key_in_logger_config.ex:126: Credo.Check.Warning.MissedMetadataKeyInLoggerConfig.issue_for_call/4
    (credo 1.7.0) lib/credo/check/warning/missed_metadata_key_in_logger_config.ex:59: Credo.Check.Warning.MissedMetadataKeyInLoggerConfig.traverse/3
    (elixir 1.15.4) lib/macro.ex:688: anonymous fn/4 in Macro.do_traverse_args/4
    (stdlib 5.0.2) lists.erl:1706: :lists.mapfoldl_1/3
    (elixir 1.15.4) lib/macro.ex:653: Macro.do_traverse/4
    (elixir 1.15.4) lib/macro.ex:668: Macro.do_traverse/4
    (stdlib 5.0.2) lists.erl:1706: :lists.mapfoldl_1/3
Function: #Function<4.59091171/0 in Credo.Check.Warning.MissedMetadataKeyInLoggerConfig.do_run_on_all_source_files/3>
    Args: []
** (EXIT from #PID<0.98.0>) an exception was raised:
    ** (FunctionClauseError) no function clause matching in Keyword.drop/2
        (elixir 1.15.4) lib/keyword.ex:1262: Keyword.drop([name: {:name, [line: 57, column: 75], nil}, postal: {:postal, [line: 57, column: 89], nil}], :all)
        (credo 1.7.0) lib/credo/check/warning/missed_metadata_key_in_logger_config.ex:126: Credo.Check.Warning.MissedMetadataKeyInLoggerConfig.issue_for_call/4
        (credo 1.7.0) lib/credo/check/warning/missed_metadata_key_in_logger_config.ex:59: Credo.Check.Warning.MissedMetadataKeyInLoggerConfig.traverse/3
        (elixir 1.15.4) lib/macro.ex:688: anonymous fn/4 in Macro.do_traverse_args/4
        (stdlib 5.0.2) lists.erl:1706: :lists.mapfoldl_1/3
        (elixir 1.15.4) lib/macro.ex:653: Macro.do_traverse/4
        (stdlib 5.0.2) lists.erl:1706: :lists.mapfoldl_1/3
        (stdlib 5.0.2) lists.erl:1707: :lists.mapfoldl_1/3
rrrene commented 1 year ago

Thx for reporting! :+1:

rrrene commented 11 months ago

This is part of 1.7.2-rc.3 :+1:

rrrene commented 11 months ago

This is part of Credo 1.7.2. :+1: