Skip to content
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

chore: exclude yardstick store from filename rules #1440

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

willmurphyscode
Copy link
Contributor

Enables "make lint" to be run after "make quality". Previously, the linter rules that prohibit ":" in any filename would fail if the yardstick or vulnerability-match-labels directories had been initialized (e.g. if "make quality" had been run), since they have filenames like "sha256:abcd" in them. Exclude them from this lint, since they are not go files.

Manual testing done

Test case where repo has yardstick state, and thus files with ":":

  1. Run make in test/quality to get some yardstick state in the workspace
  2. Prove that there are a lot of files with : in the name: find . | grep -e ":" | wc -l prints ~17k.
  3. Run make lint from the root of this workspace; it succeeds.

Running make lint on main, before this change, if the yardstick state is initialized, fails like this:

❯ make lint
Running linters
# ensure there are no go fmt differences
files with gofmt issues: []
# run all golangci-lint rules
./.tmp/golangci-lint run --tests=false
# go tooling does not play well with certain filename characters, ensure the common cases don't result in future "go get" failures
make: /bin/sh: Argument list too long
make: *** [lint] Error 1

Test case where this state hasn't existed (to make sure the subshell exiting differently because of the grep or whatever doesn't break something):

git clone -b ignore-label-and-image-dirs git@github.com:anchore/grype grype-test && cd grype-test && make bootstrap && make lint

exits zero.

Enables "make lint" to be run after "make quality". Previously, the
linter rules that prohibit ":" in any filename would fail if the
yardstick or vulnerability-match-labels directories had been initialized
(e.g. if "make quality" had been run), since they have filenames like
"sha256:abcd" in them. Exclude them from this lint, since they are not
go files.

Signed-off-by: Will Murphy <will.murphy@anchore.com>
@willmurphyscode willmurphyscode added the changelog-ignore Don't include this issue in the release changelog label Aug 16, 2023
@willmurphyscode willmurphyscode changed the title Exclude yardstick store from filename rules chore: exclude yardstick store from filename rules Aug 16, 2023
@willmurphyscode willmurphyscode merged commit ef2a5e9 into main Aug 16, 2023
9 checks passed
@willmurphyscode willmurphyscode deleted the ignore-label-and-image-dirs branch August 16, 2023 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-ignore Don't include this issue in the release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants