lpil / dogma

:closed_lock_with_key: A code style linter for Elixir
Other
471 stars 52 forks source link

Dogma fails on parsing scripts #255

Closed peterrudenko closed 6 years ago

peterrudenko commented 6 years ago

Running mix dogma gives me this (happens only on my Linux machine, where I have Elixir 1.7):

** (CaseClauseError) no case clause matching: {:ok, [{:eol, {1, 1, 1}}, {:identifier, {6, 1, nil}, :use}, {:alias, {6, 5, nil}, :Mix}, {:., {6, 8, nil}}, {:alias, {6, 9, nil}, :Config}, {:eol, {6, 15, 1}}, {:identifier, {9, 1, nil}, :config}, {:atom, {9, 8, nil}, ... tons of stuff there ... }
    lib/dogma/script.ex:105: Dogma.Script.tokenize/1
    lib/dogma/script.ex:81: Dogma.Script.add_tokens/1
    lib/dogma/script.ex:48: Dogma.Script.parse/2
    lib/dogma/script_sources.ex:42: anonymous fn/2 in Dogma.ScriptSources.to_scripts/1
    (elixir) lib/enum.ex:1901: Enum."-reduce/3-lists^foldl/2-0-"/3
    lib/dogma/script_sources.ex:39: Dogma.ScriptSources.to_scripts/1
    lib/dogma.ex:23: Dogma.run/3
    lib/mix/tasks/dogma.ex:25: Mix.Tasks.Dogma.main/1

elixir --version:

Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]

Elixir 1.7.0-dev (3a597c7) (compiled with OTP 20)

Dogma version 0.1.16

lpil commented 6 years ago

The format of the AST metadata recently changed, causing this crash. With the new v1.6 formatter I don't think Dogma has anything to offer and has been deprecated, so I'm afraid I'm not going to be fixing this.

peterrudenko commented 6 years ago

Thanks for the answer, I just noticed your announcement in readme.

lpil commented 6 years ago

Thank you :)