mix optimum.heex_check (OptimumCredo v0.5.0)

View Source

Runs HardcodedAssetPath, HiddenIdInput and EventNameSnakeCase over raw .heex files.

Stock mix credo drops .heex files (it parses them as Elixir), so this task is the entry point for standalone templates. See OptimumCredo.HeexCheck for how files are matched and read.

mix optimum.heex_check [PATH_OR_GLOB ...] [options]

Without paths, lib/**/*.heex is used. Directories are searched recursively.

Options

  • --format text|json - output format (default text)
  • --checks A,B - comma-separated check names (repeatable); default all
  • --exclude PATH_OR_GLOB - repeatable
  • --prefix /images/ - repeatable, HardcodedAssetPath asset prefixes
  • --allowed-field locale_id - repeatable, HiddenIdInput accepted fields
  • --allowed-event my-hook - repeatable, EventNameSnakeCase accepted names
  • --advisory - findings do not change the exit status (real errors still do)

Exit status

0 clean (or only findings with --advisory), 1 findings, 2 usage, read, path or check errors. JSON output is {"files": [...], "findings": [...], "errors": [...], "notes": [...]}.

Summary

Functions

Runs the task without printing or halting; returns {exit_status, output}.

Functions

execute(args)

@spec execute([String.t()]) :: {0 | 1 | 2, String.t()}

Runs the task without printing or halting; returns {exit_status, output}.