Skip to content

Commit

Permalink
update lint action
Browse files Browse the repository at this point in the history
  • Loading branch information
wllmshao committed Feb 25, 2025
1 parent 58b88b4 commit cfc34a7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
25 changes: 18 additions & 7 deletions .github/workflows/rate-limiting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,25 @@ jobs:
name: Linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: golangci-lint
uses: golangci/golangci-lint-action@v2
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
with:
version: ${{ env.LINT_VERSION }}
working-directory: ${{ env.WORKING_DIRECTORY }}
args: --timeout=5m
PATTERNS: |
**/*.go
go.mod
go.sum
**/go.mod
**/go.sum
- name: run linting
if: env.GIT_DIFF
run: |
cd ${{ env.WORKING_DIRECTORY }}
make lint
test:
runs-on: ubuntu-latest
Expand Down
7 changes: 6 additions & 1 deletion modules/rate-limiting/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,13 @@ clean:
gosec:
gosec -exclude-dir=deps -severity=high ./...

golangci_lint_cmd=golangci-lint
golangci_version=v1.60.1

lint:
golangci-lint run
@echo "--> Running linter"
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
@$(golangci_lint_cmd) run --timeout=10m

###############################################################################
### Tests ###
Expand Down

0 comments on commit cfc34a7

Please sign in to comment.