Skip to content

Commit

Permalink
Bump linter; revise linter running
Browse files Browse the repository at this point in the history
  • Loading branch information
quite committed Aug 15, 2024
1 parent 5c57551 commit a179640
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 1,164 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@ jobs:
options: --user 1001
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
#fetch-depth: 0
persist-credentials: false

- uses: actions/setup-go@v5
with:
go-version: stable

- name: build
run: ./build.sh

- name: make lint
run: |
go install golang.org/dl/go1.22.2@latest
$(go env GOPATH)/bin/go1.22.2 download
ln -s $(go env GOPATH)/bin/go1.22.2 $(go env GOPATH)/bin/go
PATH=$(go env GOPATH)/bin:$PATH
make lint
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60.1

# - name: check for SPDX tags
# run: ./tools/spdx-ensure
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/gotools/golangci-lint
/age-plugin-tkey
/internal/tkey/x25519.bin
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ linters:
- gocognit
- nestif
- exhaustruct # TODO? annoying for now
- goerr113 # TODO enable later
- err113 # TODO enable later
- godot
- godox
- depguard
Expand Down
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ check-deviceapp-hashes:
clean:
rm -f age-plugin-tkey

.PHONY: lint
lint:
make -C gotools golangci-lint
./gotools/golangci-lint run


.PHONY: build-in-container
build-in-container:
Expand All @@ -33,3 +28,15 @@ build-in-container:
build-image:
#--pull=always --no-cache
podman build -t localhost/tkey-apps-builder -f Containerfile


golangci_version=$(shell grep -A1 "uses: golangci" .github/workflows/ci.yaml | grep -o -m1 "v[0-9]\+\.[.0-9]\+")
golangci_cachedir=$(HOME)/.cache/golangci-lint/$(golangci_version)
.PHONY: lint
lint:
mkdir -p $(golangci_cachedir)
podman run --rm -it \
-v $$(pwd):/src -w /src \
-v $(golangci_cachedir):/root/.cache \
docker.io/golangci/golangci-lint:$(golangci_version)-alpine \
golangci-lint run
7 changes: 0 additions & 7 deletions gotools/Makefile

This file was deleted.

188 changes: 0 additions & 188 deletions gotools/go.mod

This file was deleted.

Loading

0 comments on commit a179640

Please sign in to comment.