Skip to content

Commit

Permalink
go fmt ci check
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonc committed Dec 7, 2022
1 parent 6c89799 commit e008570
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Expand Up @@ -11,6 +11,7 @@ linters:
- exportloopref #https://github.com/kyoh86/exportloopref
- bodyclose #https://github.com/timakin/bodyclose
- goconst #https://github.com/jgautheron/goconst
- gofmt
- errcheck #https://github.com/kisielk/errcheck
- stylecheck #https://github.com/dominikh/go-tools/tree/master/stylecheck
- revive #golint is deprecated and golangci-lint recommends to use revive instead https://github.com/mgechev/revive
Expand Down
4 changes: 1 addition & 3 deletions Makefile
Expand Up @@ -6,13 +6,11 @@ generate: check-resource
go mod tidy; \
go run . $(RESOURCE) ;

fmt:

vet:
go vet

fmt:
go fmt ./...
gofmt -s -l -w .

lint:
golangci-lint run .
Expand Down
5 changes: 3 additions & 2 deletions docs/CONTRIBUTING.md
Expand Up @@ -18,10 +18,11 @@ There are instances where several new resources being added (i.e Workspace Run T

## Linting

Linting is not necessarily required for a change to be merged, but it helps smooth the review process and catch common mistakes early. If you'd like to run the linters manually, follow these steps:
After opening a PR, our CI system will perform a series of code checks, one of which is linting. Linting is not strictly required for a change to be merged, but it helps smooth the review process and catch common mistakes early. If you'd like to run the linters manually, follow these steps:

1. Ensure you have [installed golangci-lint](https://golangci-lint.run/usage/install/#local-installation)
2. From the CLI, run `make lint`
2. Format your code by running `make fmt`
3. Run lint checks using `make lint`

## Writing Tests

Expand Down

0 comments on commit e008570

Please sign in to comment.