exercism / elixir-analyzer

GNU Affero General Public License v3.0
30 stars 31 forks source link

Elixir `german-sysadmin` exercise recommends shorthand Unicode syntax when it is already being used. #388

Closed Kaylebor closed 1 year ago

Kaylebor commented 1 year ago

On the automated suggestions for this Elixir exercise, despite my submission already following the suggestion, the bot tells me to use the syntax.

Exercise: https://exercism.org/tracks/elixir/exercises/german-sysadmin Code:

defmodule Username do
  @spec sanitize(charlist) :: charlist
  def sanitize(username) do
    username
    |> Enum.filter(&(&1 in ~c"äöüßabcdefghijklmnopqrstuvwxyz_"))
    |> Enum.reduce([], fn char, list ->
      case char do
        ?ä -> [?e, ?a | list]
        ?ö -> [?e, ?o | list]
        ?ü -> [?e, ?u | list]
        ?ß -> [?s, ?s | list]
        c -> [c | list]
      end
    end)
    |> Enum.reverse()
  end
end
angelikatyborska commented 1 year ago

Hi! Thanks for the report. This issue is related to https://github.com/exercism/elixir-analyzer/issues/384, the wrong feedback is given for the same reasons. I need to tackle this soon...

Kaylebor commented 1 year ago

Oh, I should have looked into open issues more. I'll just close this one then.