Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,9 @@ The Flux reader produces the same target as the Argo one. The field-by-field rul

## 7. Outputs

- **One analysis, several writers.** Every format is written from the same result. `--output-file FORMAT=FILE` adds a report without replacing stdout, so CI gets Markdown for the pull request, SARIF for code scanning and the table in the log from one run.
- **`--output-file` exists because of PowerShell.** `>` decodes the output of other programs with the console code page and corrupts UTF-8 (`—` becomes `ÔÇö`). deadvalues writes the file itself, always UTF-8 and uncolored.
- **One analysis, several writers.** Every format is written from the same result. `-o table,markdown,sarif --report` keeps the table on screen and writes the others to files, so CI gets Markdown for the pull request, SARIF for code scanning and the table in the log from one run.
- **`-o` is the format, `--report` the files.** `-o` stays one format on stdout without `--report`, as in Helm and kubectl, so `-o json | jq` keeps working; `--report-path` takes a directory, a base name or one file, as `nmap -oA` and Dependency-Check's `--out` do. Files are named `<command>-<date>`: the time is inside the report, and a second run on the same day replaces the first instead of piling up. `--output-file FORMAT=FILE`, the first form, is still accepted but hidden: the GitHub Action passes it, so the action also works with a release before `--report`.
- **Files because of PowerShell.** `>` decodes the output of other programs with the console code page and corrupts UTF-8 (`—` becomes `ÔÇö`). deadvalues writes the file itself, always UTF-8 and uncolored.
- **Exact lines.** The values are parsed twice: into a `map` for Helm and as `yaml.v3` nodes for positions. `github` annotations and SARIF point to the line of the key.
- **Markdown without emoji.** Statuses are plain text and the ones that fail by default (`DEAD`, `BREAKING`) are bold. Color belongs to whatever shows the report; the GitHub Action adds a GitHub alert on top.
- **Relative paths.** Every output, JSON included, uses paths relative to the current directory.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Only apps whose chart version changed between the two sides are diffed. The outp
deadvalues scan apps

# Every finding, as a Markdown report
deadvalues scan apps --details -o markdown --output-file report.md
deadvalues scan apps --details -o markdown --report-path report.md

# Only the apps whose files changed in this branch
deadvalues scan apps --changed-since origin/main
Expand Down Expand Up @@ -221,7 +221,7 @@ No script is needed around it: the action installs the release matching its ref,

```yaml
- uses: guarnz/deadvalues/setup@v0
- run: deadvalues scan apps -o sarif --output-file results.sarif --fail-on none
- run: deadvalues scan apps --report-path results.sarif --fail-on none
```

`args` runs your own command with the same report; `setup` only installs the binary. Inputs, outputs and the report format are in [docs/github-action.md](https://github.com/guarnz/deadvalues/blob/main/docs/github-action.md).
Expand Down
27 changes: 14 additions & 13 deletions docs/cli/deadvalues.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,20 @@ deadvalues [flags]
### Options

```
--api-versions strings extra API versions for .Capabilities.APIVersions.Has
--cache-dir string chart cache (default "<user cache dir>/deadvalues")
--color string auto | always | never (default "auto")
-c, --config string path to .deadvalues.yaml (default: repo root)
-h, --help help for deadvalues
--kube-version string Kubernetes version for .Capabilities (default: Helm SDK default)
--no-cache always download charts
--no-color same as --color=never
-o, --output string table | json | markdown | sarif | github (default "table")
--output-file stringArray write the report to a file in UTF-8 instead of stdout; FORMAT=FILE writes that format and keeps stdout (repeatable)
-v, --verbose log every render and probe
--version print version, commit and Helm SDK version
-w, --workers int concurrent renders (default number of CPUs)
--api-versions strings extra API versions for .Capabilities.APIVersions.Has
--cache-dir string chart cache (default "<user cache dir>/deadvalues")
--color string auto | always | never (default "auto")
-c, --config string path to .deadvalues.yaml (default: repo root)
-h, --help help for deadvalues
--kube-version string Kubernetes version for .Capabilities (default: Helm SDK default)
--no-cache always download charts
--no-color same as --color=never
-o, --output strings table | json | markdown | sarif | github; several, comma-separated, with --report (default [table])
--report write json, markdown and sarif, or those in -o, to <command>-<date>.<ext> in the current directory
--report-path string write the report files here instead: a directory, a base name, or a file name when there is one file format (implies --report)
-v, --verbose log every render and probe
--version print version, commit and Helm SDK version
-w, --workers int concurrent renders (default number of CPUs)
```

### SEE ALSO
Expand Down
23 changes: 12 additions & 11 deletions docs/cli/deadvalues_check.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,18 @@ deadvalues check [flags]
### Options inherited from parent commands

```
--api-versions strings extra API versions for .Capabilities.APIVersions.Has
--cache-dir string chart cache (default "<user cache dir>/deadvalues")
--color string auto | always | never (default "auto")
-c, --config string path to .deadvalues.yaml (default: repo root)
--kube-version string Kubernetes version for .Capabilities (default: Helm SDK default)
--no-cache always download charts
--no-color same as --color=never
-o, --output string table | json | markdown | sarif | github (default "table")
--output-file stringArray write the report to a file in UTF-8 instead of stdout; FORMAT=FILE writes that format and keeps stdout (repeatable)
-v, --verbose log every render and probe
-w, --workers int concurrent renders (default number of CPUs)
--api-versions strings extra API versions for .Capabilities.APIVersions.Has
--cache-dir string chart cache (default "<user cache dir>/deadvalues")
--color string auto | always | never (default "auto")
-c, --config string path to .deadvalues.yaml (default: repo root)
--kube-version string Kubernetes version for .Capabilities (default: Helm SDK default)
--no-cache always download charts
--no-color same as --color=never
-o, --output strings table | json | markdown | sarif | github; several, comma-separated, with --report (default [table])
--report write json, markdown and sarif, or those in -o, to <command>-<date>.<ext> in the current directory
--report-path string write the report files here instead: a directory, a base name, or a file name when there is one file format (implies --report)
-v, --verbose log every render and probe
-w, --workers int concurrent renders (default number of CPUs)
```

### SEE ALSO
Expand Down
23 changes: 12 additions & 11 deletions docs/cli/deadvalues_diff.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,18 @@ deadvalues diff [dir] [flags]
### Options inherited from parent commands

```
--api-versions strings extra API versions for .Capabilities.APIVersions.Has
--cache-dir string chart cache (default "<user cache dir>/deadvalues")
--color string auto | always | never (default "auto")
-c, --config string path to .deadvalues.yaml (default: repo root)
--kube-version string Kubernetes version for .Capabilities (default: Helm SDK default)
--no-cache always download charts
--no-color same as --color=never
-o, --output string table | json | markdown | sarif | github (default "table")
--output-file stringArray write the report to a file in UTF-8 instead of stdout; FORMAT=FILE writes that format and keeps stdout (repeatable)
-v, --verbose log every render and probe
-w, --workers int concurrent renders (default number of CPUs)
--api-versions strings extra API versions for .Capabilities.APIVersions.Has
--cache-dir string chart cache (default "<user cache dir>/deadvalues")
--color string auto | always | never (default "auto")
-c, --config string path to .deadvalues.yaml (default: repo root)
--kube-version string Kubernetes version for .Capabilities (default: Helm SDK default)
--no-cache always download charts
--no-color same as --color=never
-o, --output strings table | json | markdown | sarif | github; several, comma-separated, with --report (default [table])
--report write json, markdown and sarif, or those in -o, to <command>-<date>.<ext> in the current directory
--report-path string write the report files here instead: a directory, a base name, or a file name when there is one file format (implies --report)
-v, --verbose log every render and probe
-w, --workers int concurrent renders (default number of CPUs)
```

### SEE ALSO
Expand Down
23 changes: 12 additions & 11 deletions docs/cli/deadvalues_explain.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,18 @@ deadvalues explain <key> [flags]
### Options inherited from parent commands

```
--api-versions strings extra API versions for .Capabilities.APIVersions.Has
--cache-dir string chart cache (default "<user cache dir>/deadvalues")
--color string auto | always | never (default "auto")
-c, --config string path to .deadvalues.yaml (default: repo root)
--kube-version string Kubernetes version for .Capabilities (default: Helm SDK default)
--no-cache always download charts
--no-color same as --color=never
-o, --output string table | json | markdown | sarif | github (default "table")
--output-file stringArray write the report to a file in UTF-8 instead of stdout; FORMAT=FILE writes that format and keeps stdout (repeatable)
-v, --verbose log every render and probe
-w, --workers int concurrent renders (default number of CPUs)
--api-versions strings extra API versions for .Capabilities.APIVersions.Has
--cache-dir string chart cache (default "<user cache dir>/deadvalues")
--color string auto | always | never (default "auto")
-c, --config string path to .deadvalues.yaml (default: repo root)
--kube-version string Kubernetes version for .Capabilities (default: Helm SDK default)
--no-cache always download charts
--no-color same as --color=never
-o, --output strings table | json | markdown | sarif | github; several, comma-separated, with --report (default [table])
--report write json, markdown and sarif, or those in -o, to <command>-<date>.<ext> in the current directory
--report-path string write the report files here instead: a directory, a base name, or a file name when there is one file format (implies --report)
-v, --verbose log every render and probe
-w, --workers int concurrent renders (default number of CPUs)
```

### SEE ALSO
Expand Down
23 changes: 12 additions & 11 deletions docs/cli/deadvalues_prune.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,18 @@ deadvalues prune [flags]
### Options inherited from parent commands

```
--api-versions strings extra API versions for .Capabilities.APIVersions.Has
--cache-dir string chart cache (default "<user cache dir>/deadvalues")
--color string auto | always | never (default "auto")
-c, --config string path to .deadvalues.yaml (default: repo root)
--kube-version string Kubernetes version for .Capabilities (default: Helm SDK default)
--no-cache always download charts
--no-color same as --color=never
-o, --output string table | json | markdown | sarif | github (default "table")
--output-file stringArray write the report to a file in UTF-8 instead of stdout; FORMAT=FILE writes that format and keeps stdout (repeatable)
-v, --verbose log every render and probe
-w, --workers int concurrent renders (default number of CPUs)
--api-versions strings extra API versions for .Capabilities.APIVersions.Has
--cache-dir string chart cache (default "<user cache dir>/deadvalues")
--color string auto | always | never (default "auto")
-c, --config string path to .deadvalues.yaml (default: repo root)
--kube-version string Kubernetes version for .Capabilities (default: Helm SDK default)
--no-cache always download charts
--no-color same as --color=never
-o, --output strings table | json | markdown | sarif | github; several, comma-separated, with --report (default [table])
--report write json, markdown and sarif, or those in -o, to <command>-<date>.<ext> in the current directory
--report-path string write the report files here instead: a directory, a base name, or a file name when there is one file format (implies --report)
-v, --verbose log every render and probe
-w, --workers int concurrent renders (default number of CPUs)
```

### SEE ALSO
Expand Down
23 changes: 12 additions & 11 deletions docs/cli/deadvalues_scan.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,18 @@ deadvalues scan <dir> [flags]
### Options inherited from parent commands

```
--api-versions strings extra API versions for .Capabilities.APIVersions.Has
--cache-dir string chart cache (default "<user cache dir>/deadvalues")
--color string auto | always | never (default "auto")
-c, --config string path to .deadvalues.yaml (default: repo root)
--kube-version string Kubernetes version for .Capabilities (default: Helm SDK default)
--no-cache always download charts
--no-color same as --color=never
-o, --output string table | json | markdown | sarif | github (default "table")
--output-file stringArray write the report to a file in UTF-8 instead of stdout; FORMAT=FILE writes that format and keeps stdout (repeatable)
-v, --verbose log every render and probe
-w, --workers int concurrent renders (default number of CPUs)
--api-versions strings extra API versions for .Capabilities.APIVersions.Has
--cache-dir string chart cache (default "<user cache dir>/deadvalues")
--color string auto | always | never (default "auto")
-c, --config string path to .deadvalues.yaml (default: repo root)
--kube-version string Kubernetes version for .Capabilities (default: Helm SDK default)
--no-cache always download charts
--no-color same as --color=never
-o, --output strings table | json | markdown | sarif | github; several, comma-separated, with --report (default [table])
--report write json, markdown and sarif, or those in -o, to <command>-<date>.<ext> in the current directory
--report-path string write the report files here instead: a directory, a base name, or a file name when there is one file format (implies --report)
-v, --verbose log every render and probe
-w, --workers int concurrent renders (default number of CPUs)
```

### SEE ALSO
Expand Down
23 changes: 12 additions & 11 deletions docs/cli/deadvalues_version.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@ deadvalues version [flags]
### Options inherited from parent commands

```
--api-versions strings extra API versions for .Capabilities.APIVersions.Has
--cache-dir string chart cache (default "<user cache dir>/deadvalues")
--color string auto | always | never (default "auto")
-c, --config string path to .deadvalues.yaml (default: repo root)
--kube-version string Kubernetes version for .Capabilities (default: Helm SDK default)
--no-cache always download charts
--no-color same as --color=never
-o, --output string table | json | markdown | sarif | github (default "table")
--output-file stringArray write the report to a file in UTF-8 instead of stdout; FORMAT=FILE writes that format and keeps stdout (repeatable)
-v, --verbose log every render and probe
-w, --workers int concurrent renders (default number of CPUs)
--api-versions strings extra API versions for .Capabilities.APIVersions.Has
--cache-dir string chart cache (default "<user cache dir>/deadvalues")
--color string auto | always | never (default "auto")
-c, --config string path to .deadvalues.yaml (default: repo root)
--kube-version string Kubernetes version for .Capabilities (default: Helm SDK default)
--no-cache always download charts
--no-color same as --color=never
-o, --output strings table | json | markdown | sarif | github; several, comma-separated, with --report (default [table])
--report write json, markdown and sarif, or those in -o, to <command>-<date>.<ext> in the current directory
--report-path string write the report files here instead: a directory, a base name, or a file name when there is one file format (implies --report)
-v, --verbose log every render and probe
-w, --workers int concurrent renders (default number of CPUs)
```

### SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion docs/github-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ steps:
with:
fetch-depth: 0
- uses: guarnz/deadvalues/setup@v0
- run: deadvalues scan apps -o sarif --output-file results.sarif --fail-on none
- run: deadvalues scan apps --report-path results.sarif --fail-on none
```

| Input | Default | Description |
Expand Down
2 changes: 1 addition & 1 deletion docs/json.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# JSON output

`-o json`, and `--output-file json=FILE`, print one object for every command that produces a report:
`-o json`, and the json file of `--report`, hold one object for every command that produces a report:

```json
{
Expand Down
Loading
Loading