jeremyjh / dialyxir

Mix tasks to simplify use of Dialyzer in Elixir projects.
Apache License 2.0
1.7k stars 139 forks source link

Exception in default formatter #168

Closed kipcole9 closed 6 years ago

kipcole9 commented 6 years ago

I am slowly working on getting Dialyzer to pass on ex_money. On master branch of dialyxir I am getting the following exception. To reproduce, clone the repo, fetch deps and run the below.

Thanks for all the effort to help make dialyzer more accessible. I still struggle badly but with the formatter I am more encouraged to persevere.

$ mix dialyzer
Finding suitable PLTs
Checking PLT...
[:abnf2, :compiler, :decimal, :earmark, :elixir, :ex_cldr, :ex_cldr_currencies,
 :ex_cldr_numbers, :ex_doc, :inets, :kernel, :logger, :stdlib, :stream_data]
PLT is up to date!
Starting Dialyzer
dialyzer args: [
  check_plt: false,
  init_plt: '/Users/kip/Development/money/_build/dev/dialyxir_erlang-20.2.2_elixir-1.7.0-dev_deps-dev.plt',
  files_rec: ['/Users/kip/Development/money/_build/dev/lib/ex_money/ebin'],
  warnings: [:unknown],
  explain: nil,
  format: nil,
  raw: nil
]
** (SyntaxError) nofile:1: invalid character "@" (codepoint U+0040) in identifier: _money@1
    (elixir) lib/code.ex:483: Code.format_string!/2
    lib/dialyxir/pretty_print.ex:132: Dialyxir.PrettyPrint.pretty_print_args/1
    lib/dialyxir/warnings/call.ex:26: Dialyxir.Warnings.Call.format_long/1
    lib/dialyxir/formatter.ex:142: Dialyxir.Formatter.format_warning/2
    lib/dialyxir/formatter.ex:79: anonymous fn/2 in Dialyxir.Formatter.format_and_filter/3
    (elixir) lib/enum.ex:1298: Enum."-map/2-lists^map/1-0-"/2
    (elixir) lib/enum.ex:1298: Enum."-map/2-lists^map/1-0-"/2
asummers commented 6 years ago

Interesting! Thank you for the report. That's totally a bug.

kipcole9 commented 6 years ago

Maybe related issue that I'm getting in cldr. Also just clone, mix deps.get, mix dialyzer. BTW in both cases --format short works fine.

** (SyntaxError) nofile:1: syntax error before: '<'
    (elixir) lib/code.ex:483: Code.format_string!/2
    lib/dialyxir/pretty_print.ex:112: Dialyxir.PrettyPrint.pretty_print_type/1
    lib/dialyxir/warnings/pattern_match.ex:18: Dialyxir.Warnings.PatternMatch.format_long/1
    lib/dialyxir/formatter.ex:143: Dialyxir.Formatter.format_warning/2
    lib/dialyxir/formatter.ex:80: anonymous fn/2 in Dialyxir.Formatter.format_and_filter/3
    (elixir) lib/enum.ex:1298: Enum."-map/2-lists^map/1-0-"/2
    (elixir) lib/enum.ex:1298: Enum."-map/2-lists^map/1-0-"/2
asummers commented 6 years ago

I'm adding something in https://github.com/jeremyjh/dialyxir/pull/169 that will get me better error messages from your bugs, and prevent the program from blowing up at the place it's blowing up for you. Sorry about that crappy behavior! We'll get much more reasonable bugs soon.

jeremyjh commented 6 years ago

Thats in master now.

asummers commented 6 years ago

@kipcole9 I suspect once #170 is merged the second one will still fail but the issue attached to this issue will work. Can you make a separate issue with the new output once it is merged? Thank you 😄 ❤️