list_output.ex (2929B)
1 defmodule Credo.CLI.Command.List.ListOutput do 2 @moduledoc false 3 4 use Credo.CLI.Output.FormatDelegator, 5 default: Credo.CLI.Command.List.Output.Default, 6 flycheck: Credo.CLI.Command.List.Output.FlyCheck, 7 oneline: Credo.CLI.Command.List.Output.Oneline, 8 json: Credo.CLI.Command.List.Output.Json 9 10 alias Credo.CLI.Output.UI 11 12 def print_help(exec) do 13 usage = ["Usage: ", :olive, "mix credo list [options]"] 14 15 description = """ 16 17 Lists objects that Credo thinks can be improved ordered by their priority. 18 """ 19 20 example = [ 21 "Examples:\n", 22 :olive, 23 " $ mix credo list --format json\n", 24 " $ mix credo list \"lib/**/*.ex\" --only consistency --all\n", 25 " $ mix credo list --checks-without-tag formatter --checks-without-tag controversial" 26 ] 27 28 options = 29 """ 30 31 Arrows (↑ ↗ → ↘ ↓) hint at the importance of an issue. 32 33 List options: 34 -a, --all Show all issues 35 -A, --all-priorities Show all 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 -i, --ignore-checks Ignore checks that match the given strings 46 --ignore Alias for --ignore-checks 47 --min-priority Minimum priority to show issues (high,medium,normal,low,lower or number) 48 --mute-exit-status Exit with status zero even if there are issues 49 --only Alias for --checks 50 --strict Alias for --all-priorities 51 52 General options: 53 --[no-]color Toggle colored output 54 -v, --version Show version 55 -h, --help Show this help 56 57 Find advanced usage instructions and more examples here: 58 https://hexdocs.pm/credo/list_command.html 59 60 Give feedback and open an issue here: 61 https://github.com/rrrene/credo/issues 62 """ 63 |> String.trim_trailing() 64 65 UI.puts() 66 UI.puts(usage) 67 UI.puts(description) 68 UI.puts(example) 69 UI.puts(options) 70 71 exec 72 end 73 end