Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,3 @@ jobs:
shell: bash
run: |
make lint
- name: staticcheck
shell: bash
run: |
make staticcheck
- name: vet
shell: bash
run: |
make vet
- name: fmt
shell: bash
run: |
make fmt

4 changes: 3 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ linters:

formatters:
enable:
- gofmt
- goimports
- golines
settings:
golines:
max-len: 100
shorten-comments: true
exclusions:
generated: disable
Comment on lines +27 to +28

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This runs the formatters on generated files. Specfically, it disables the exclusion logic that would normally exclude generated files from formatters.


run:
timeout: 5m
19 changes: 2 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ VERSION := $(shell cat $(CURDIR)/VERSION)
generate:
@ echo "+ Generating SDK..."
@ go generate ./...
@ echo "+ Updating imports..."
@ go tool -modfile tools/go.mod goimports -w oxide/*.go
@ echo "+ Formatting generated SDK..."
@ gofmt -s -w oxide/*.go
@ $(MAKE) fmt
@ echo "+ Tidying up modules..."
@ go mod tidy

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

all: generate test fmt lint staticcheck vet ## Runs a fmt, lint, test, staticcheck, and vet.
all: generate test fmt lint ## Runs a fmt, lint, and test.

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

.PHONY: vet
vet: ## Verifies `go vet` passes.
@ echo "+ Verifying go vet passes..."
@if [[ ! -z "$(shell $(GO) vet ./... | tee /dev/stderr)" ]]; then \
exit 1; \
fi

.PHONY: staticcheck
staticcheck: ## Verifies `staticcheck` passes.
@ echo "+ Verifying staticcheck passes..."
@if [[ ! -z "$(shell go tool -modfile tools/go.mod staticcheck ./... | tee /dev/stderr)" ]]; then \
exit 1; \
fi

.PHONY: tag
tag: ## Create a new git tag to prepare to build a release.
Expand Down
Loading