-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(cli): update help string for file and dir skipping #4872
Conversation
|
2b1ef41
to
a13d18e
Compare
docs/docs/configuration/skipping.md
Outdated
@@ -11,12 +11,19 @@ This section details ways to specify the files and directories that Trivy should | |||
| License | ✓ | | |||
|
|||
By default, Trivy traverses directories and searches for all necessary files for scanning. | |||
You can skip files that you don't maintain using the `--skip-files` flag. | |||
You can skip files that you don't maintain using the `--skip-files` flag, or the equivalent YAML config option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we say "or using the equivalent Trivy YAML configuration." instead?
To make it clear that we don't mean Kubernetes YAML or similar
docs/docs/configuration/skipping.md
Outdated
@@ -34,12 +47,19 @@ Will skip any file named `bar` in the subdirectories of testdata. | |||
| License | ✓ | | |||
|
|||
By default, Trivy traverses directories and searches for all necessary files for scanning. | |||
You can skip directories that you don't maintain using the `--skip-dirs` flag. | |||
You can skip directories that you don't maintain using the `--skip-dirs` flag, or the equivalent YAML config option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here: can we say "or using the equivalent Trivy YAML configuration." instead?
|
||
``` | ||
```bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a little subtitle *not bold or anything but just:
Using the --skip-dirs
flag:
EXAMPLE
Using the Trivy YAML configuration:
EXAMPLE
docs/docs/configuration/skipping.md
Outdated
@@ -48,12 +68,19 @@ $ trivy image --skip-dirs "./testdata/*" . | |||
|
|||
Will skip all subdirectories of the testdata directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"This will skip.."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was following the existing examples, but yes, can definitely update
docs/docs/configuration/skipping.md
Outdated
$ trivy config --skip-dirs "**/.terraform" . | ||
``` | ||
|
||
Will skip subdirectories at any depth named `.terraform/`. (Note: this will match `./foo/.terraform` or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"This will skip" ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a few minor comments, thank you for the work
a13d18e
to
8ae02b6
Compare
- Update the contextual help messages - Add some additional examples (and clarify YAML file configuration) for globbing - Update docs - Fix broken link in skipping docs See also #3754 Signed-off-by: William Yardley <wyardley@users.noreply.github.com>
8ae02b6
to
8bc94af
Compare
Hi @AnaisUrlichs - does that look good now? |
docs/docs/configuration/skipping.md
Outdated
@@ -82,4 +113,4 @@ A file pattern contains the analyzer it is used for, and the pattern itself, joi | |||
--file-patterns "dockerfile:.*.docker" --file-patterns "kubernetes:*.tpl" --file-patterns "pip:requirements-.*\.txt" | |||
``` | |||
|
|||
The prefixes are listed [here](https://github.com/aquasecurity/trivy/tree/{{ git.commit }}/pkg/fanal/analyzer/const.go) | |||
The prefixes are listed [here](../../../pkg/fanal/analyzer/const.go) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be deployed via MkDocs, so it doesn't work. I've reverted.
https://aquasecurity.github.io/trivy/v0.44/docs/configuration/skipping/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue I was trying to fix is that the current docs have a broken link when viewed via https://github.com/aquasecurity/trivy/blob/main/docs/docs/configuration/skipping.md (which gets linked to from various places IIRC)
…#4872) * docs(cli): update help string for file and dir skipping - Update the contextual help messages - Add some additional examples (and clarify YAML file configuration) for globbing - Update docs - Fix broken link in skipping docs See also aquasecurity#3754 Signed-off-by: William Yardley <wyardley@users.noreply.github.com> * docs: revert --------- Signed-off-by: William Yardley <wyardley@users.noreply.github.com> Co-authored-by: knqyf263 <knqyf263@gmail.com>
Description
Happy to adjust the wording or make other tweaks as necessary, but to me, this seems at least a little bit clearer
Related issues
Related PRs
--skip-dirs
and--skip-files
#3866(all merged; just related / previous PRs related to this)
Before:
After:
Checklist