lpil / dogma

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

Old dependencies, warnings, unable to run `mix dogma` #257

Closed vukanac closed 4 years ago

vukanac commented 4 years ago

Received several warnings, but at the end didn't finish successfully:

$ mix deps.get
New:
  dogma 0.1.16
* Getting dogma (Hex package)

$mix escript.build
==> dogma
Compiling 59 files (.ex)
warning: "not expr1 in expr2" is deprecated. Instead use "expr1 not in expr2" if you require Elixir v1.5+, or "not(expr1 in expr2)" if you have to support earlier Elixir versions
  lib/dogma/rule/infix_operator_padding.ex:129

warning: "not expr1 in expr2" is deprecated. Instead use "expr1 not in expr2" if you require Elixir v1.5+, or "not(expr1 in expr2)" if you have to support earlier Elixir versions
  lib/dogma/rule/infix_operator_padding.ex:139

warning: the GenEvent module is deprecated, see its documentation for alternatives
  lib/dogma/reporter/json.ex:37: Dogma.Reporter.JSON (module)

warning: the GenEvent module is deprecated, see its documentation for alternatives
  lib/dogma/reporter/flycheck.ex:11: Dogma.Reporter.Flycheck (module)

warning: trailing commas are not allowed inside function/macro call arguments
  lib/dogma/config.ex:8

warning: the GenEvent module is deprecated, see its documentation for alternatives
  lib/dogma/reporter/simple.ex:18: Dogma.Reporter.Simple (module)

warning: Code.get_docs/2 is deprecated. Code.get_docs/2 always returns nil as its outdated documentation is no longer stored on BEAM files. Use Code.fetch_docs/1 instead
Found at 2 locations:
  lib/dogma/documentation/reporters_list.ex:57
  lib/dogma/documentation/rules_list.ex:50

warning: GenEvent.__using__/1 is deprecated. Use one of the alternatives described in the documentation for the GenEvent module
Found at 3 locations:
  lib/dogma/reporter/flycheck.ex:11
  lib/dogma/reporter/json.ex:37
  lib/dogma/reporter/simple.ex:18

warning: GenEvent.add_handler/3 is deprecated. Use one of the alternatives described in the documentation for the GenEvent module
  lib/mix/tasks/dogma.ex:22

warning: GenEvent.start_link/1 is deprecated. Use one of the alternatives described in the documentation for the GenEvent module
  lib/mix/tasks/dogma.ex:21

warning: GenEvent.sync_notify/2 is deprecated. Use one of the alternatives described in the documentation for the GenEvent module
Found at 3 locations:
  lib/dogma.ex:32
  lib/dogma.ex:37
  lib/dogma/rules.ex:22

warning: String.strip/1 is deprecated. Use String.trim/1 instead
  lib/dogma/rule/multiple_blank_lines.ex:14

warning: String.to_char_list/1 is deprecated. Use String.to_charlist/1 instead
  lib/dogma/script.ex:102

Generated dogma app
==> my_app
Compiling 9 files (.ex)
Generated my_app app
** (Mix) Could not generate escript, please set :main_module in your project configuration (under :escript option) to a module that implements main/1

By adding config/dogma.exs helped partially, but still:

$ mix dogma
***
warnings
***
Generated dogma app
** (CaseClauseError) no case clause matching: {:ok, [{:identifier, {1, 1, nil}, :use}, {:alias, {1, 5, nil}, :Mix}, {:., {1, 8, nil}}, {:alias, {1, 9, nil}, :Config}, {:eol, {1, 15, 2}}, {:identifier, {3, 1, nil}, :case}, {:alias, {3, 6, nil}, :System}, {:., {3, 12, nil}}, {:paren_identifier, {3, 13, nil}, :fetch_env}, {:"(", {3, 22, nil}}, {:bin_string, {3, 23, nil}, ["MONGODB_HOST"]}, {:")", {3, 37, nil}}, {:do, {3, 39, nil}}, {:eol, {3, 41, 1}}, {:"{", {4, 3, nil}}, {:atom, {4, 4, nil}, :ok}, {:",", {4, 7, 0}}, {:identifier, {4, 9, nil}, :value}, {:"}", {4, 14, nil}}, {:stab_op, {4, 16, nil}, :->}, {:eol, {4, 18, 1}}, {:alias, {5, 5, nil}, :IO}, {:., {5, 7, nil}}, {:identifier, {5, 8, nil}, :puts}, {:sigil, {5, 13, nil}, 115, ["Setting :mongodb_host to \"", {{5, 42, nil}, {5, 49, nil}, [{:identifier, {5, 44, nil}, :value}]}, "\""], [], "("}, {:eol, {5, 52, 1}}, {:identifier, {6, 5, nil}, :config}, {:atom, {6, 12, nil}, :heimdall}, {:",", {6, 21, 0}}, {:kw_identifier, {6, 23, nil}, :mongodb_host}, {:identifier, {6, 37, nil}, :value}, {:eol, {6, 42, 2}}, {:atom, {8, 3, nil}, :error}, {:stab_op, {8, 10, nil}, :->}, {:atom, {8, 13, nil}, :noop}, {:eol, {8, 18, 1}}, {:end, {9, 1, nil}}, {:eol, {9, 4, 2}}, {:identifier, {11, 1, nil}, :case}, {:alias, {11, 6, nil}, :System}, {:., {11, 12, nil}}, {:paren_identifier, {11, 13, nil}, :fetch_env}, {:"(", {11, 22, nil}}, {:bin_string, {11, 23, ...}, ["MONGODB_PORT"]}, {:")", {11, ...}}, {:do, {...}}, {:eol, ...}, {...}, ...]}
    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:1948: 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
lpil commented 4 years ago

Hi there. Thanks for trying it bu this project is deprecated and no longer maintained! I recommend using the Elixir formatter instead.