Skip to content

Commit

Permalink
Makefile: Add a linting target that runs gofmt/goimports
Browse files Browse the repository at this point in the history
Explicitly ignore operatorclient generated packages

The gofmt/goimport commands are touching generated packages that don't
have the proper "//go:generate ..." instructions.

Signed-off-by: timflannagan <timflannagan@gmail.com>
  • Loading branch information
timflannagan committed Sep 8, 2021
1 parent 966ce43 commit 8ed489c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ clean:
@rm -rf test/e2e/log
@rm -rf e2e.namespace

lint:
find . -name '*.go' -not -path "./vendor/*" -not -path "./pkg/lib/operatorclient/operatorclientmocks/*" | xargs gofmt -w
find . -name '*.go' -not -path "./vendor/*" -not -path "./pkg/lib/operatorclient/operatorclientmocks/*" | xargs goimports -w

# Copy CRD manifests
manifests: vendor
Expand Down

0 comments on commit 8ed489c

Please sign in to comment.