zf

zenflows testing
git clone https://s.sonu.ch/~srfsh/zf.git
Log | Files | Refs | Submodules | README | LICENSE

diff_output.ex (3059B)


      1 defmodule Credo.CLI.Command.Diff.DiffOutput do
      2   @moduledoc false
      3 
      4   use Credo.CLI.Output.FormatDelegator,
      5     default: Credo.CLI.Command.Diff.Output.Default,
      6     flycheck: Credo.CLI.Command.Diff.Output.FlyCheck,
      7     oneline: Credo.CLI.Command.Diff.Output.Oneline,
      8     json: Credo.CLI.Command.Diff.Output.Json
      9 
     10   alias Credo.CLI.Output.UI
     11 
     12   def print_help(exec) do
     13     usage = ["Usage: ", :olive, "mix credo diff [options]"]
     14 
     15     description = """
     16 
     17     Diffs objects against a point in Git's history.
     18     """
     19 
     20     example = [
     21       "Examples:\n",
     22       :olive,
     23       "  $ mix credo diff v1.4.0\n",
     24       "  $ mix credo diff main\n",
     25       "  $ mix credo diff --from-git-ref HEAD --files-included \"lib/**/*.ex\""
     26     ]
     27 
     28     options =
     29       """
     30 
     31       Arrows (↑ ↗ → ↘ ↓) hint at the importance of an issue.
     32 
     33       Diff options:
     34         -a, --all                     Show all new issues
     35         -A, --all-priorities          Show all new issues including low priority ones
     36         -c, --checks                  Only include checks that match the given strings
     37             --checks-with-tag         Only include checks that match the given tag (can be used multiple times)
     38             --checks-without-tag      Ignore checks that match the given tag (can be used multiple times)
     39             --config-file             Use the given config file
     40         -C, --config-name             Use the given config instead of "default"
     41             --enable-disabled-checks  Re-enable disabled checks that match the given strings
     42             --files-included          Only include these files (accepts globs, can be used multiple times)
     43             --files-excluded          Exclude these files (accepts globs, can be used multiple times)
     44             --format                  Display the list in a specific format (json,flycheck,oneline)
     45             --from-dir                Diff from the given directory
     46             --from-git-ref            Diff from the given Git ref
     47             --from-git-merge-base     Diff from where the current HEAD branched off from the given merge base
     48         -i, --ignore-checks           Ignore checks that match the given strings
     49             --ignore                  Alias for --ignore-checks
     50             --min-priority            Minimum priority to show issues (high,medium,normal,low,lower or number)
     51             --mute-exit-status        Exit with status zero even if there are issues
     52             --only                    Alias for --checks
     53             --since                   Diff from the given point in time (using Git)
     54             --strict                  Alias for --all-priorities
     55 
     56       General options:
     57             --[no-]color              Toggle colored output
     58         -v, --version                 Show version
     59         -h, --help                    Show this help
     60 
     61       Feedback:
     62         Open an issue here: https://github.com/rrrene/credo/issues
     63       """
     64       |> String.trim_trailing()
     65 
     66     UI.puts()
     67     UI.puts(usage)
     68     UI.puts(description)
     69     UI.puts(example)
     70     UI.puts(options)
     71 
     72     exec
     73   end
     74 end