Skip to content

Commit

Permalink
Update deps (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo committed Apr 18, 2024
1 parent a12c199 commit 672f76c
Show file tree
Hide file tree
Showing 7 changed files with 170 additions and 223 deletions.
106 changes: 35 additions & 71 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,93 +3,57 @@ name: Test
on:
push:
branches:
- main
tags:
- '*'
- main
pull_request:
branches:
- main
- main

concurrency:
group: '${{ github.workflow }}-${{ github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
lint:
runs-on: 'ubuntu-latest'

steps:
- uses: 'actions/checkout@v3'
- uses: 'actions/checkout@v4'

- uses: 'actions/setup-go@v3'
with:
go-version: '1.14'
- uses: 'actions/setup-go@v5'
with:
cache: false
go-version-file: 'go.mod'

- uses: 'golangci/golangci-lint-action@v3'
with:
version: 'v1.50.1'
only-new-issues: true
skip-cache: true
skip-pkg-cache: true
skip-build-cache: true
args: >-
--enable=${{ join(fromJson('[
"asciicheck",
"bidichk",
"bodyclose",
"containedctx",
"depguard",
"dogsled",
"errcheck",
"errchkjson",
"errname",
"errorlint",
"exhaustive",
"exportloopref",
"forcetypeassert",
"godot",
"gofumpt",
"goheader",
"goimports",
"gomodguard",
"goprintffuncname",
"gosec",
"gosimple",
"govet",
"ifshort",
"ineffassign",
"makezero",
"noctx",
"nolintlint",
"prealloc",
"predeclared",
"revive",
"sqlclosecheck",
"staticcheck",
"stylecheck",
"tenv",
"thelper",
"tparallel",
"typecheck",
"unconvert",
"unused",
"whitespace",
]'), ',') }}
--max-issues-per-linter=0
--max-same-issues=0
--timeout=5m
- uses: 'golangci/golangci-lint-action@v4'
with:
version: 'v1.57.2'
skip-cache: true

test:
strategy:
matrix:
platform:
- 'macos-latest'
- 'ubuntu-latest'
- 'windows-latest'
- 'macos-latest'
- 'ubuntu-latest'
- 'windows-latest'
fail-fast: false

runs-on: '${{ matrix.platform }}'

steps:
- uses: 'actions/checkout@v3'

- uses: 'actions/setup-go@v3'
with:
go-version: '1.14'

- run: 'make test-acc'
- uses: 'actions/checkout@v4'

- uses: 'actions/setup-go@v5'
with:
cache: false
go-version-file: 'go.mod'

- shell: 'bash'
run: |-
go test \
-count=1 \
-race \
-shuffle=on \
-timeout=5m \
-vet=all \
./...
202 changes: 110 additions & 92 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
# Copyright 2023 The Authors (see AUTHORS file)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

run:
# default: '1m'
timeout: '5m'

# default: []
build-tags: []
build-tags:
- 'all'

# default: []
exclude-dirs:
- 'third_party'

# default: true
skip-dirs-use-default: false

# default: ''
modules-download-mode: 'readonly'
Expand All @@ -13,107 +35,103 @@ run:

linters:
enable:
- 'asasalint'
- 'asciicheck'
- 'bidichk'
- 'bodyclose'
- 'containedctx'
- 'contextcheck'
- 'cyclop'
- 'decorder'
- 'depguard'
- 'dogsled'
- 'dupl'
- 'dupword'
- 'durationcheck'
- 'errcheck'
- 'errchkjson'
- 'errname'
- 'errorlint'
- 'execinquery'
- 'exhaustive'
- 'exhaustruct'
- 'exportloopref'
- 'forbidigo'
- 'forcetypeassert'
- 'funlen'
- 'gci'
- 'gochecknoglobals'
- 'gochecknoinits'
- 'gocognit'
- 'goconst'
- 'gocritic'
- 'gocyclo'
- 'godot'
- 'godox'
- 'goerr113'
- 'gofumpt'
- 'goheader'
- 'goimports'
- 'gomnd'
- 'gomoddirectives'
- 'gomodguard'
- 'goprintffuncname'
- 'gosec'
- 'gosimple'
- 'govet'
- 'grouper'
- 'importas'
- 'ineffassign'
- 'interfacebloat'
- 'ireturn'
- 'lll'
- 'loggercheck'
- 'maintidx'
- 'makezero'
- 'misspell'
- 'nakedret'
- 'nestif'
- 'nilerr'
- 'nilnil'
- 'nlreturn'
- 'noctx'
- 'nolintlint'
- 'nonamedreturns'
- 'nosprintfhostport'
- 'paralleltest'
- 'prealloc'
- 'predeclared'
- 'promlinter'
- 'reassign'
- 'revive'
- 'rowserrcheck'
- 'sqlclosecheck'
- 'staticcheck'
- 'stylecheck'
- 'tagliatelle'
- 'tenv'
- 'testableexamples'
- 'testpackage'
- 'thelper'
- 'tparallel'
- 'typecheck'
- 'unconvert'
- 'unparam'
- 'unused'
- 'usestdlibvars'
- 'varnamelen'
- 'wastedassign'
- 'whitespace'
- 'wrapcheck'
- 'wsl'
- 'asasalint'
- 'asciicheck'
- 'bidichk'
- 'bodyclose'
- 'containedctx'
- 'dupword'
- 'durationcheck'
- 'errcheck'
- 'errchkjson'
- 'errname'
- 'errorlint'
- 'execinquery'
- 'exhaustive'
- 'exportloopref'
- 'forcetypeassert'
- 'gci'
- 'gocheckcompilerdirectives'
- 'godot'
- 'gofmt'
- 'gofumpt'
- 'goheader'
- 'goimports'
- 'goprintffuncname'
- 'gosec'
- 'gosimple'
- 'govet'
- 'importas'
- 'ineffassign'
- 'loggercheck'
- 'makezero'
- 'mirror'
- 'misspell'
- 'nilerr'
- 'noctx'
- 'nolintlint'
- 'nosprintfhostport'
- 'paralleltest'
- 'prealloc'
- 'predeclared'
- 'protogetter'
- 'rowserrcheck'
- 'sloglint'
- 'spancheck'
- 'sqlclosecheck'
- 'staticcheck'
- 'stylecheck'
- 'tenv'
- 'thelper'
- 'typecheck'
- 'unconvert'
- 'unused'
- 'wastedassign'
- 'whitespace'
- 'wrapcheck'

issues:
# default: []
exclude:
- '^SA3000:' # staticcheck: not required in Go 11.4+
- '^G102:' # gosec: we have to bind to all ifaces in Cloud Run services

# default: []
exclude-rules:
# Exclude test files from certain linters
- path: '_test.go'
linters:
- 'wrapcheck'

# default: 50
max-issues-per-linter: 0

# default: 3
max-same-issues: 0

gci:
sections:
- 'standard'
- 'default'
- 'blank'
- 'dot'

skip-generated: true
custom-order: true

gofumpt:
# default: false
extra-rules: true

sloglint:
# default: false
context-only: true
# default: false
static-msg: false
# default: '' (snake, kebab, camel, pascal)
key-naming-case: 'snake'
# default: false
args-on-sep-lines: true

severity:
# default: ''
default-severity: error
default-severity: 'error'

0 comments on commit 672f76c

Please sign in to comment.