Ethyl.Lint behaviour (Ethyl v0.2.0) View Source

Functions for linting Ethyl code

Link to this section Summary

Functions

Lints a source file against all known linters

Traverses the AST in search of lint issues

Link to this section Types

Specs

t() :: %Ethyl.Lint{
  description: term(),
  file: term(),
  line: term(),
  linter: term()
}

Link to this section Callbacks

Specs

lint(source :: Ethyl.Source.t()) :: [t()]

Link to this section Functions

Lints a source file against all known linters

Link to this function

traverse(source, traversal_fn, acc \\ [])

View Source

Traverses the AST in search of lint issues

This function uses Macro.prewalk/3 under the hood. The traversal_fn must be a function of arity 2 taking the AST and the accumulator as arguments. traversal_fn should return a 2-tuple of {ast, lints}