From 15c1adc75b3449dd72f048f14f6a127abb0e21d7 Mon Sep 17 00:00:00 2001 From: Jason Parraga Date: Thu, 4 Jul 2024 10:30:41 -0700 Subject: [PATCH] Add golangci lint --- .github/workflows/golangci-lint.yml | 24 ++++++++++++++++++++++++ .golangci.yml | 22 ++++++++++++++++++++++ go.mod | 2 +- 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/golangci-lint.yml create mode 100644 .golangci.yml diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 0000000..29b3db1 --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,24 @@ +name: golangci-lint +on: + push: + branches: + - main + - master + pull_request: + +permissions: + contents: read + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: stable + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.59 diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..8372b5f --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,22 @@ +linters: + # Disable all linters. + # Default: false + disable-all: true + # Enable specific linter + # https://golangci-lint.run/usage/linters/#enabled-by-default + enable: + - errcheck + - gosimple + - govet + - ineffassign + - staticcheck + - unused + +issues: + exclude-rules: + - path: (.+)_test.go + linters: + - errcheck + - path: test_utils.go + linters: + - errcheck diff --git a/go.mod b/go.mod index 728ed15..e661ce1 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/sovietaced/okta-jwt-verifier -go 1.21.5 +go 1.22 require ( github.com/MicahParks/jwkset v0.5.18