Skip to content

Commit f6fa9ab

Browse files
jmcarpgithub-actions[bot]sudomateo
authored
Drop redundant linters. (#378)
The golangci-lint tool includes various other linters, including staticcheck and goimports. This patch configures golangci-lint to do the work that was being done by other standalone linters, then drops the other linters from our configs. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Matthew Sanabria <matthew.sanabria@oxide.computer>
1 parent 905343c commit f6fa9ab

File tree

7 files changed

+2986
-1587
lines changed

7 files changed

+2986
-1587
lines changed

.github/workflows/build-test.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,3 @@ jobs:
2121
shell: bash
2222
run: |
2323
make lint
24-
- name: staticcheck
25-
shell: bash
26-
run: |
27-
make staticcheck
28-
- name: vet
29-
shell: bash
30-
run: |
31-
make vet
32-
- name: fmt
33-
shell: bash
34-
run: |
35-
make fmt
36-

.golangci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ linters:
1818

1919
formatters:
2020
enable:
21-
- gofmt
21+
- goimports
2222
- golines
2323
settings:
2424
golines:
2525
max-len: 100
2626
shorten-comments: true
27+
exclusions:
28+
generated: disable
2729

2830
run:
2931
timeout: 5m

Makefile

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ VERSION := $(shell cat $(CURDIR)/VERSION)
1818
generate:
1919
@ echo "+ Generating SDK..."
2020
@ go generate ./...
21-
@ echo "+ Updating imports..."
22-
@ go tool -modfile tools/go.mod goimports -w oxide/*.go
2321
@ echo "+ Formatting generated SDK..."
24-
@ gofmt -s -w oxide/*.go
22+
@ $(MAKE) fmt
2523
@ echo "+ Tidying up modules..."
2624
@ go mod tidy
2725

@@ -32,7 +30,7 @@ $(NAME): $(wildcard *.go) $(wildcard */*.go)
3230
@echo "+ $@"
3331
$(GO) build -tags "$(BUILDTAGS)" ${GO_LDFLAGS} -o $(NAME) ./internal/generate/
3432

35-
all: generate test fmt lint staticcheck vet ## Runs a fmt, lint, test, staticcheck, and vet.
33+
all: generate test fmt lint ## Runs a fmt, lint, and test.
3634

3735
.PHONY: fmt
3836
fmt: ## Formats Go code including long line wrapping.
@@ -59,19 +57,6 @@ golden-fixtures: ## Refreshes golden test fixtures. Requires OXIDE_HOST, OXIDE_T
5957
@ echo "+ Refreshing golden test fixtures..."
6058
@ $(GO) run ./oxide/testdata/main.go
6159

62-
.PHONY: vet
63-
vet: ## Verifies `go vet` passes.
64-
@ echo "+ Verifying go vet passes..."
65-
@if [[ ! -z "$(shell $(GO) vet ./... | tee /dev/stderr)" ]]; then \
66-
exit 1; \
67-
fi
68-
69-
.PHONY: staticcheck
70-
staticcheck: ## Verifies `staticcheck` passes.
71-
@ echo "+ Verifying staticcheck passes..."
72-
@if [[ ! -z "$(shell go tool -modfile tools/go.mod staticcheck ./... | tee /dev/stderr)" ]]; then \
73-
exit 1; \
74-
fi
7560

7661
.PHONY: tag
7762
tag: ## Create a new git tag to prepare to build a release.

0 commit comments

Comments
 (0)