Skip to content

Release v1.1.0

Latest

Choose a tag to compare

@github-actions github-actions released this 12 Nov 13:17
f86639d

Arc now ships a compile-time analyzer, the Elixir counterpart of the ARC Roslyn analyzers. It checks your code against Arc rules on every compile and reports Mix diagnostics in the terminal, in CI and in the editor.

Added

  • A :arc_analyzer compiler. Turn it on with compilers: [:arc_analyzer] ++ Mix.compilers() in mix.exs, or run mix igniter.install cratis_arc. The installer is safe to run twice and updates every app of an umbrella.
  • Rules ARCE0001 (a module declares a schema and handle/2 but does not use Arc.Command), ARCE0002 (a command or query is both anonymous and restricted), ARCE0003 (an @observe query has neither :watch nor :topics), ARCE0004 (a command appends to Chronicle itself) and ARCE0005 (two commands or queries resolve to the same route).
  • Configuration with config :cratis_arc, :analyzer: a global enabled switch and a severity per rule (:error, :warning, :info or :off). @arc_analyzer ignore: ["ARCE0001"] turns a rule off for one module, and mix compile --warnings-as-errors fails on warnings from the analyzer.
  • A Code analysis section in the documentation with a page for every rule, and a changelog.

Changed

  • Builds that add the analyzer can report new warnings after an upgrade that adds a rule. ARCE0002 and ARCE0005 default to errors; set a rule to :warning or :off under config :cratis_arc, :analyzer while you fix the findings.