You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating system: macOS 14.5 (Sonoma), Apple Silicon
Terminals: wezterm (20240203-110809-5046fc22) and iTerm (3.5.0) with zsh
The font I use (a Iosevka variant) does support the priority-indicating arrows (like → or ↗) when I enter them manually into the shell, or when I use elixir/iex to print the Unicode sequences.
Terminal environment:
$ echo$LANG
en_US.utf-8
$ echo$LC_ALL
en_US.utf-8
My terminal (wezterm) with the font I use (Iosevka) does support the respective arrow Unicode characters:
❯ iex
Erlang/OTP 27 [erts-15.0] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]
Interactive Elixir (1.16.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> to_string("\u{2192}")
"→"
iex(2)> to_string("\u{2197}")
"↗"
Lastly, even with a "fresh" wezterm setup of all defaults (via wezterm -n) shows the same behavior: credo output has raw Unicode sequences, whereas other uses of the same Unicode characters (e.g. via iex or manually typed) do render correctly.
What were you trying to do?
I want to run a basic credo report with mix credo --strict and see correctly formatted output.
To make it easier to summarize the issue in this discussion, I also include the expected vs. actual output for the following credo command line:
$ mix credo list --format=oneline --strict
FWIW it didn't matter whether or not I added --no-color to the commands.
Expected outcome
I expected that the priority indicator arrows (like → or ↗) would be printed to the terminal, note the left-hand side of the output, right next to where the categories like [R] and [D] are printed.
$ mix credo list --format=oneline --strict
[R] → lib/hello_elixir.ex:1:11 Modules should have a @moduledoc tag.
[D] → lib/hello_elixir.ex:12 Found a TODO tag in a comment: # TODO: Remove
[W] ↗ lib/hello_elixir.ex:20:10 There are identical sub-expressions to the left and to the right of the '&&' operator.
Actual outcome
Instead, the raw Unicode sequence were printed.
$ mix credo list --format=oneline --strict
[R] \x{2192} lib/hello_elixir.ex:1:11 Modules should have a @moduledoc tag.
[D] \x{2192} lib/hello_elixir.ex:12 Found a TODO tag in a comment: # TODO: Remove
[W] \x{2197} lib/hello_elixir.ex:20:10 There are identical sub-expressions to the left and to the right of the '&&' operator.
Here is more verbose output:
$ mix credo --strict
mix credo --strict
Checking 3 source files ...
Software Design
\x{2503}
\x{2503} [D] \x{2192} Found a TODO tag in a comment: # TODO: Remove\x{2503} lib/hello_elixir.ex:12 #(HelloElixir.hello)
Code Readability
\x{2503}
\x{2503} [R] \x{2192} Modules should have a @moduledoc tag.
\x{2503} lib/hello_elixir.ex:1:11 #(HelloElixir)
Warnings - please take a look
\x{2503}
\x{2503} [W] \x{2197} There are identical sub-expressions to the left and to the right of the '&&' operator.
\x{2503} lib/hello_elixir.ex:20:10 #(HelloElixir.baz)
Please report incorrect results: https://github.com/rrrene/credo/issues
Analysis took 0.06 seconds (0.04s to load, 0.02s running 67 checks on 3 files)
4 mods/funs, found 1 warning, 1 code readability issue, 1 software design suggestion.
Use `mix credo explain` to explain issues, `mix credo --help`for options.
As you can see, the priority-indicating arrows as well as further Unicode sequences are actually printed as \x{2192} etc.
The terminals I use and tested with (wezterm and iTerm) are correctly configured for Unicode. They do show the arrow characters when I enter them manually, for example.
$LANG and $LC_ALL are set to en_US.utf-8.
The font used in the terminals do support the arrow characters. I also tested with several fonts, including Iosevka, Fira Code, MesloLGF NF, Hack Nerd Font Mono.
Have you come across this before? I have not found any clearly related issue in the open or the closed GH issues.
The text was updated successfully, but these errors were encountered:
Precheck
Environment
mix credo -v
): 1.7.6-ref.main.a3c8308+uncommittedchangeselixir -v
):zsh
Terminal environment:
My terminal (wezterm) with the font I use (Iosevka) does support the respective arrow Unicode characters:
Lastly, even with a "fresh" wezterm setup of all defaults (via
wezterm -n
) shows the same behavior:credo
output has raw Unicode sequences, whereas other uses of the same Unicode characters (e.g. viaiex
or manually typed) do render correctly.What were you trying to do?
I want to run a basic credo report with
mix credo --strict
and see correctly formatted output.To make it easier to summarize the issue in this discussion, I also include the expected vs. actual output for the following
credo
command line:FWIW it didn't matter whether or not I added
--no-color
to the commands.Expected outcome
I expected that the priority indicator arrows (like → or ↗) would be printed to the terminal, note the left-hand side of the output, right next to where the categories like
[R]
and[D]
are printed.Actual outcome
Instead, the raw Unicode sequence were printed.
Here is more verbose output:
As you can see, the priority-indicating arrows as well as further Unicode sequences are actually printed as
\x{2192}
etc.en_US.utf-8
.Have you come across this before? I have not found any clearly related issue in the open or the closed GH issues.
The text was updated successfully, but these errors were encountered: