Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update linters and actions #157

Merged
merged 1 commit into from
Jul 17, 2023
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
4 changes: 2 additions & 2 deletions .github/actions/terraform-linter/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ runs:
using: 'composite'
steps:
- id: 'checkout-pkg'
uses: 'actions/checkout@v3'
uses: 'actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9' # ratchet:actions/checkout@v3
with:
repository: 'abcxyz/pkg'
path: 'abcxyz-pkg'

- id: 'setup-go'
uses: 'actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568' # ratchet:actions/setup-go@v3
uses: 'actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753' # ratchet:actions/setup-go@v4
with:
go-version: '1.20'

Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/go-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
golangci_lint_version:
description: 'Version of golangci linter to use'
type: 'string'
default: 'v1.52'
default: 'v1.53'

jobs:
# modules checks if the go modules are all up-to-date. While rare with modern
Expand All @@ -31,10 +31,10 @@ jobs:
runs-on: 'ubuntu-latest'
steps:
- name: 'Checkout'
uses: 'actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b' # ratchet:actions/checkout@v3
uses: 'actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9' # ratchet:actions/checkout@v3

- name: 'Setup Go'
uses: 'actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568' # ratchet:actions/setup-go@v3
uses: 'actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753' # ratchet:actions/setup-go@v4
with:
go-version: '${{ inputs.go_version }}'

Expand All @@ -61,10 +61,10 @@ jobs:
runs-on: 'ubuntu-latest'
steps:
- name: 'Checkout'
uses: 'actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b' # ratchet:actions/checkout@v3
uses: 'actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9' # ratchet:actions/checkout@v3

- name: 'Setup Go'
uses: 'actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568' # ratchet:actions/setup-go@v3
uses: 'actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753' # ratchet:actions/setup-go@v4
with:
go-version: '${{ inputs.go_version }}'

Expand All @@ -90,18 +90,16 @@ jobs:

- name: 'Lint (default configuration)'
if: '${{ hashFiles(''.golangci.yml'', ''.golangci.yaml'') == '''' }}'
uses: 'golangci/golangci-lint-action@07db5389c99593f11ad7b44463c2d4233066a9b1' # ratchet:golangci/golangci-lint-action@v3
uses: 'golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299' # ratchet:golangci/golangci-lint-action@v3
with:
args: |-
--config "${{ steps.load-default-config.outputs.output-file }}"
version: '${{ inputs.golangci_lint_version }}'
skip-cache: true
working-directory: '${{ inputs.directory }}'

- name: 'Lint (custom configuration)'
if: '${{ hashFiles(''.golangci.yml'', ''.golangci.yaml'') != '''' }}'
uses: 'golangci/golangci-lint-action@07db5389c99593f11ad7b44463c2d4233066a9b1' # ratchet:golangci/golangci-lint-action@v3
uses: 'golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299' # ratchet:golangci/golangci-lint-action@v3
with:
version: '${{ inputs.golangci_lint_version }}'
skip-cache: true
working-directory: '${{ inputs.directory }}'
4 changes: 2 additions & 2 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ jobs:
jq -r "to_entries | map(\"\(.key)=\(.value|tostring)\") | .[]" <<< '${{ inputs.env }}' >> $GITHUB_ENV

- name: 'Checkout'
uses: 'actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b' # ratchet:actions/checkout@v3
uses: 'actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9' # ratchet:actions/checkout@v3

- name: 'Setup Go'
uses: 'actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568' # ratchet:actions/setup-go@v3
uses: 'actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753' # ratchet:actions/setup-go@v4
with:
go-version: '${{ inputs.go_version }}'

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/java-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
google_java_format_version:
description: 'The version of google-java-format to use. This must be the full version with no leading "v" prefix.'
type: 'string'
default: '1.15.0'
default: '1.17.0'
directory:
description: 'Directory in which Java files reside.'
type: 'string'
Expand All @@ -31,10 +31,10 @@ jobs:
runs-on: 'ubuntu-latest'
steps:
- name: 'Checkout'
uses: 'actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b' # ratchet:actions/checkout@v3
uses: 'actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9' # ratchet:actions/checkout@v3

- name: 'Setup Java'
uses: 'actions/setup-java@c3ac5dd0ed8db40fedb61c32fbe677e6b355e94c' # ratchet:actions/setup-java@v3
uses: 'actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2' # ratchet:actions/setup-java@v3
with:
distribution: '${{ inputs.java_distribution }}'
java-version: '${{ inputs.java_version }}'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/terraform-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
runs-on: 'ubuntu-latest'
steps:
- name: 'Checkout'
uses: 'actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b' # ratchet:actions/checkout@v3
uses: 'actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9' # ratchet:actions/checkout@v3

- name: 'Setup Terraform'
uses: 'hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1' # ratchet:hashicorp/[email protected]
Expand All @@ -44,13 +44,13 @@ jobs:
terraform fmt -recursive -check -diff

- id: 'checkout-pkg'
uses: 'actions/checkout@v3'
uses: 'actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9' # ratchet:actions/checkout@v3
with:
repository: 'abcxyz/pkg'
path: 'abcxyz-pkg'

- id: 'setup-go'
uses: 'actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568' # ratchet:actions/setup-go@v3
uses: 'actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753' # ratchet:actions/setup-go@v4
with:
go-version: '1.20'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/yaml-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
runs-on: 'ubuntu-latest'
steps:
- name: 'Checkout'
uses: 'actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b' # ratchet:actions/checkout@v3
uses: 'actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9' # ratchet:actions/checkout@v3

- name: 'Setup Python'
uses: 'actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0' # ratchet:actions/setup-python@v4.6.1
uses: 'actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1' # ratchet:actions/setup-python@v4

- name: 'Install yamllint'
run: |-
Expand Down
28 changes: 19 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ linters:
- 'govet'
- 'importas'
- 'ineffassign'
# - 'ireturn' # does not handle generics yet: https://github.com/butuzov/ireturn/issues/37
- 'loggercheck'
- 'makezero'
- 'misspell'
Expand Down Expand Up @@ -107,14 +106,25 @@ issues:

linters-settings:
depguard:
list-type: 'denylist'
packages-with-error-message:
- 'github.com/auth0/go-jwt-middleware': 'the approved jwx library is github.com/lestrrat-go/jwx/v2'
- 'github.com/gin-contrib/*': 'third-party web frameworks are not approved, use net/http'
- 'github.com/gin-gonic/contrib': 'third-party web frameworks are not approved, use net/http'
- 'github.com/gin-gonic/gin': 'third-party web frameworks are not approved, use net/http'
- 'github.com/golang-jwt/jwe': 'the approved jwx library is github.com/lestrrat-go/jwx/v2'
- 'github.com/golang-jwt/jwt': 'the approved jwx library is github.com/lestrrat-go/jwx/v2'
rules:
main:
files:
- '$all'
deny:
- pkg: 'github.com/auth0/go-jwt-middleware'
desc: 'the approved jwx library is github.com/lestrrat-go/jwx/v2'
- pkg: 'github.com/gin-contrib/*'
desc: 'third-party web frameworks are not approved, use net/http'
- pkg: 'github.com/gin-gonic/contrib'
desc: 'third-party web frameworks are not approved, use net/http'
- pkg: 'github.com/gin-gonic/gin'
desc: 'third-party web frameworks are not approved, use net/http'
- pkg: 'github.com/golang-jwt/jwe'
desc: 'the approved jwx library is github.com/lestrrat-go/jwx/v2'
- pkg: 'github.com/golang-jwt/jwt'
desc: 'the approved jwx library is github.com/lestrrat-go/jwx/v2'
- pkg: 'github.com/stretchr/testify'
desc: 'use the standard library for tests'

gofumpt:
# default: false
Expand Down
2 changes: 1 addition & 1 deletion containertest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
name: Go Test
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20' # Optional
```
Expand Down
2 changes: 1 addition & 1 deletion mysqltest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
name: Go Test
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20' # Optional
```
Expand Down