Skip to content

Fix protocol default arguments warning#136

Open
weih-kahoot wants to merge 2 commits into
beatrichartz:mainfrom
weih-kahoot:fix-protocol-default-arguments-warning
Open

Fix protocol default arguments warning#136
weih-kahoot wants to merge 2 commits into
beatrichartz:mainfrom
weih-kahoot:fix-protocol-default-arguments-warning

Conversation

@weih-kahoot

@weih-kahoot weih-kahoot commented Jul 2, 2026

Copy link
Copy Markdown

No description provided.

This is necessary as credo 1.6 won't compile with recent Elixir/Erlang version.

==> credo
Compiling 242 files (.ex)

== Compilation error in file lib/credo/check/config_comment_finder.ex ==
** (Regex.CompileError) invalid range in character class at position 16
    (elixir 1.20.2) lib/regex.ex:250: Regex.compile!/2
    (elixir 1.20.2) lib/kernel.ex:6675: Kernel.compile_regex/2
    (elixir 1.20.2) expanding macro: Kernel.sigil_r/2
    lib/credo/check/config_comment_finder.ex:9: Credo.Check.ConfigCommentFinder (module)
    (elixir 1.20.2) expanding macro: Kernel.@/1
    lib/credo/check/config_comment_finder.ex:9: Credo.Check.ConfigCommentFinder (module)
This fix the following warning of default arguments in protocol definitions.

==> csv
Compiling 1 file (.ex)
    warning: default arguments in protocol definitions is deprecated
    │
 11 │   def encode(data, env \\ [])
    │   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    │
    └─ lib/csv/encoding/encode.ex:11: CSV.Encode (module)

    warning: protocols can only define functions without implementation via def/1, found: encode/1
    │
  1 │ defprotocol CSV.Encode do
    │ ~~~~~~~~~~~~~~~~~~~~~~~~~
    │
    └─ lib/csv/encoding/encode.ex:1: CSV.Encode (module)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant