Skip to content

Commit

Permalink
Merge pull request #1076 from grrrisu/sarif-doc
Browse files Browse the repository at this point in the history
show sarif as format option
  • Loading branch information
rrrene committed Oct 3, 2023
2 parents 6931c48 + 67f5eac commit d1d76ea
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 27 deletions.
42 changes: 21 additions & 21 deletions guides/commands/suggest_command.md
Expand Up @@ -17,26 +17,26 @@ $ mix credo suggest --checks-without-tag formatter --checks-without-tag controve

## Command Line Switches

| Name, shorthand | Description |
|----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------|
| [`--all`](#all), [`-a`](#all) | Show all issues for each category |
| [`--all-priorities`](#all-priorities-aliased-as-strict), [`-A`](#all-priorities-aliased-as-strict) | Show all issues including low priority ones |
| [`--checks`](#checks-aliased-as-only) | Only include checks that match the given comma-seperated patterns |
| [`--checks-with-tag`](#checks-with-tag) | Only include checks that match the given tag |
| [`--checks-without-tag`](#checks-without-tag) | Ignore checks that match the given tag |
| [`--config-file`](#config-file) | Use the given config file as Credo's config |
| [`--config-name`](#config-name) | Use the given config instead of "default" |
| [`--enable-disabled-checks`](#enable-disabled-checks) | Re-enable disabled checks that match the given comma-seperated patterns |
| [`--files-included`](#files-included) | Only include these files |
| [`--files-excluded`](#files-excluded) | Exclude these files |
| [`--format`](#format) | Display the list in a specific format (json, flycheck, or oneline) |
| [`--ignore-checks`](#ignore-checks-aliased-as-ignore) | Ignore checks that match the given comma-seperated patterns |
| [`--ignore`](#ignore) | Alias for [`--ignore-checks`](#ignore-checks-aliased-as-ignore) |
| [`--min-priority`](#min-priority) | Minimum priority to show issues |
| [`--mute-exit-status`](#mute-exit-status) | Exit with status zero even if there are issues |
| [`--only`](#only) | Alias for [`--checks`](#checks-aliased-as-only) |
| [`--strict`](#strict) | Alias for [`--all-priorities`](#all-priorities-aliased-as-strict) |
| [`--verbose`](#verbose) | Additionally print the check and the source code that raised the issue |
| Name, shorthand | Description |
| -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [`--all`](#all), [`-a`](#all) | Show all issues for each category |
| [`--all-priorities`](#all-priorities-aliased-as-strict), [`-A`](#all-priorities-aliased-as-strict) | Show all issues including low priority ones |
| [`--checks`](#checks-aliased-as-only) | Only include checks that match the given comma-seperated patterns |
| [`--checks-with-tag`](#checks-with-tag) | Only include checks that match the given tag |
| [`--checks-without-tag`](#checks-without-tag) | Ignore checks that match the given tag |
| [`--config-file`](#config-file) | Use the given config file as Credo's config |
| [`--config-name`](#config-name) | Use the given config instead of "default" |
| [`--enable-disabled-checks`](#enable-disabled-checks) | Re-enable disabled checks that match the given comma-seperated patterns |
| [`--files-included`](#files-included) | Only include these files |
| [`--files-excluded`](#files-excluded) | Exclude these files |
| [`--format`](#format) | Display the list in a specific format (json, flycheck, sarif or oneline) |
| [`--ignore-checks`](#ignore-checks-aliased-as-ignore) | Ignore checks that match the given comma-seperated patterns |
| [`--ignore`](#ignore) | Alias for [`--ignore-checks`](#ignore-checks-aliased-as-ignore) |
| [`--min-priority`](#min-priority) | Minimum priority to show issues |
| [`--mute-exit-status`](#mute-exit-status) | Exit with status zero even if there are issues |
| [`--only`](#only) | Alias for [`--checks`](#checks-aliased-as-only) |
| [`--strict`](#strict) | Alias for [`--all-priorities`](#all-priorities-aliased-as-strict) |
| [`--verbose`](#verbose) | Additionally print the check and the source code that raised the issue |

## Descriptions

Expand Down Expand Up @@ -151,7 +151,7 @@ $ mix credo --files-excluded "./test/**/*.exs"

### `--format`

Display the list in a specific format (json, flycheck, or oneline)
Display the list in a specific format (json, flycheck, sarif or oneline)

```bash
$ mix credo --format json
Expand Down
3 changes: 2 additions & 1 deletion guides/configuration/cli_switches.md
Expand Up @@ -14,6 +14,7 @@ Use `--format` to format the output in one of the following formats:

- `--format flycheck` for [Flycheck](http://www.flycheck.org/) output
- `--format json` for [JSON](https://www.json.org/) output
- `--format sarif` for [SARIF](https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sarif) output

Additionally, you can deactivate the output's coloring by using `--no-color`.

Expand Down Expand Up @@ -139,7 +140,7 @@ Suggest options:
--enable-disabled-checks Re-enable disabled checks that match the given strings
--files-included Only include these files (accepts globs, can be used multiple times)
--files-excluded Exclude these files (accepts globs, can be used multiple times)
--format Display the list in a specific format (json,flycheck,oneline)
--format Display the list in a specific format (json,flycheck,sarif,oneline)
-i, --ignore-checks Ignore checks that match the given strings
--ignore Alias for --ignore-checks
--min-priority Minimum priority to show issues (higher,high,normal,low,ignore or number)
Expand Down
2 changes: 1 addition & 1 deletion lib/credo/cli/command/diff/diff_output.ex
Expand Up @@ -41,7 +41,7 @@ defmodule Credo.CLI.Command.Diff.DiffOutput do
--enable-disabled-checks Re-enable disabled checks that match the given strings
--files-included Only include these files (accepts globs, can be used multiple times)
--files-excluded Exclude these files (accepts globs, can be used multiple times)
--format Display the list in a specific format (json,flycheck,oneline)
--format Display the list in a specific format (json,flycheck,sarif,oneline)
--from-dir Diff from the given directory
--from-git-ref Diff from the given Git ref
--from-git-merge-base Diff from where the current HEAD branched off from the given merge base
Expand Down
2 changes: 1 addition & 1 deletion lib/credo/cli/command/explain/explain_output.ex
Expand Up @@ -31,7 +31,7 @@ defmodule Credo.CLI.Command.Explain.ExplainOutput do
"""
Explain options:
--format Display the list in a specific format (json,flycheck,oneline)
--format Display the list in a specific format (json,flycheck,sarif,oneline)
General options:
--[no-]color Toggle colored output
Expand Down
2 changes: 1 addition & 1 deletion lib/credo/cli/command/info/info_output.ex
Expand Up @@ -40,7 +40,7 @@ defmodule Credo.CLI.Command.Info.InfoOutput do
--enable-disabled-checks Re-enable disabled checks that match the given strings
--files-included Only include these files (accepts globs, can be used multiple times)
--files-excluded Exclude these files (accepts globs, can be used multiple times)
--format Display the list in a specific format (json,flycheck,oneline)
--format Display the list in a specific format (json,flycheck,sarif,oneline)
-i, --ignore-checks Ignore checks that match the given strings
--ignore Alias for --ignore-checks
--min-priority Minimum priority to show issues (higher,high,normal,low,ignore or number)
Expand Down
2 changes: 1 addition & 1 deletion lib/credo/cli/command/list/list_output.ex
Expand Up @@ -42,7 +42,7 @@ defmodule Credo.CLI.Command.List.ListOutput do
--enable-disabled-checks Re-enable disabled checks that match the given strings
--files-included Only include these files (accepts globs, can be used multiple times)
--files-excluded Exclude these files (accepts globs, can be used multiple times)
--format Display the list in a specific format (json,flycheck,oneline)
--format Display the list in a specific format (json,flycheck,sarif,oneline)
-i, --ignore-checks Ignore checks that match the given strings
--ignore Alias for --ignore-checks
--min-priority Minimum priority to show issues (higher,high,normal,low,ignore or number)
Expand Down
2 changes: 1 addition & 1 deletion lib/credo/cli/command/suggest/suggest_output.ex
Expand Up @@ -42,7 +42,7 @@ defmodule Credo.CLI.Command.Suggest.SuggestOutput do
--enable-disabled-checks Re-enable disabled checks that match the given strings
--files-included Only include these files (accepts globs, can be used multiple times)
--files-excluded Exclude these files (accepts globs, can be used multiple times)
--format Display the list in a specific format (json,flycheck,oneline)
--format Display the list in a specific format (json,flycheck,sarif,oneline)
-i, --ignore-checks Ignore checks that match the given strings
--ignore Alias for --ignore-checks
--min-priority Minimum priority to show issues (higher,high,normal,low,ignore or number)
Expand Down

0 comments on commit d1d76ea

Please sign in to comment.