Skip to content

Commit

Permalink
fix: Ensure fresh linting
Browse files Browse the repository at this point in the history
  • Loading branch information
a-spiker committed Oct 9, 2024
1 parent 7858d39 commit fc9f0e1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/golangci.lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
submodules: true
- name: Get go version from go.mod
run: |
echo "GO_VERSION=$(grep '^go ' go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
Expand All @@ -25,5 +27,7 @@ jobs:
go-version: 1.22
- name: Run Lint
run: |
make golanci-lint | make go-lint
make remove-lint
make golanci-lint
make go-lint
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ issues:
exclude-dirs:
- testdata
- .git
- schema
- schema/schemas

8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,22 @@ $(ACONFIG_BIN): $(SOURCES)
GOLANGCI_LINT ?= $(GOBIN)/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.61.0

# install golangci-lint
.PHONY: golanci-lint
golanci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
$(GOLANGCI_LINT): $(GOBIN)
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) $(GOLANGCI_LINT_VERSION)

# Run linting in verbose
.PHONY: go-lint
go-lint: golanci-lint ## Run golangci-lint against code.
$(GOLANGCI_LINT) run -c .golangci.yml -v

# Clean up golangci-lint
.PHONY: remove-lint
remove-lint:
$(RM) ${GOBIN}/golangci-lint

# Clean up
.PHONY: clean
clean:
Expand Down

0 comments on commit fc9f0e1

Please sign in to comment.