KogenCredo.Diff.CLI (KogenCredo v0.1.0)

View Source

Argument handling and rendering behind mix kogen.diff_check, free of Mix.shell so it can be tested: run/1 returns {output, exit_code}.

Exit codes: 0 nothing at or above --fail-on, 1 findings at or above --fail-on, 2 usage error (including an empty --rules/--error-rules, or a --path that matches no file in either tree), git failure or any file whose source could not be analysed (an unparsable file is never reported as success).

Summary

Functions

Parses argv, runs the diff and renders the result.

Functions

run(argv)

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

Parses argv, runs the diff and renders the result.