Skip to content

Limit filename lint to non-ignored paths - #107

Merged
willmurphyscode merged 2 commits into
anchore:mainfrom
willmurphyscode:limit-filename-lint-to-non-ignored
Jul 7, 2026
Merged

willmurphyscode merged 2 commits into
anchore:mainfrom
willmurphyscode:limit-filename-lint-to-non-ignored

Conversation

@willmurphyscode

@willmurphyscode willmurphyscode commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Previously, if a path under the root dir of a repo using this tool contained a ":", static-analysis would fail even if the path was gitignored or part of a submodule. The submodule case particularly comes up with repos that submodule anchore/vulnerability-match-labels, which has some weird paths, including paths with ":" in them.

Instead, use "git ls-files" to list files that are tracker or untracked but not ignored (and thus might be added and committed) so that this lint still protects the repo from accepting files with ":" in the path but doesn't fail on gitignored scratchwork or surprising decisions by submodules.

For example, in grype today static-analysis only passes if the vulnerability-match-labels submodule has not be initialized.

$ make static-analysis
... passes ...
$ git submodule update --init test/quality/vulnerability-match-labels
$ make static-analysis
... fails: ...
 ERROR:
error: unsupported filename characters found

Previously, if a path under the root dir of a repo using this tool
contained a ":", static-analysis would fail even if the path was
gitignored or part of a submodule. The submodule case particularly comes
up with repos that submodule anchore/vulnerability-match-labels, which
has some weird paths, including paths with ":" in them.

Instead, use "git ls-files" to list files that are tracker or untracked
but not ignored (and thus might be added and committed) so that this
lint still protects the repo from accepting files with ":" in the path
but doesn't fail on gitignored scratchwork or surprising decisions by
submodules.

Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>
@willmurphyscode
willmurphyscode force-pushed the limit-filename-lint-to-non-ignored branch from 12feab9 to 9bfe4f6 Compare July 7, 2026 20:17
Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>
@willmurphyscode
willmurphyscode merged commit ea15f6d into anchore:main Jul 7, 2026
21 checks passed
@willmurphyscode
willmurphyscode deleted the limit-filename-lint-to-non-ignored branch July 7, 2026 22:26
@willmurphyscode willmurphyscode added the bug Something isn't working label Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants