chore: fix needs

This commit is contained in:
Kevin Franklin Kim 2021-11-19 12:42:11 +01:00
parent b3cf575dad
commit 54b4154426
3 changed files with 73 additions and 55 deletions

51
.github/linters/.golangci.yml vendored Normal file
View File

@ -0,0 +1,51 @@
linters-settings:
gci:
local-prefixes: github.com/foomo/keel
revive:
rules:
- name: indent-error-flow
disabled: true
gocritic:
enabled-tags:
- diagnostic
- performance
- style
disabled-tags:
- experimental
- opinionated
disabled-checks:
- ifElseChain
settings:
hugeParam:
sizeThreshold: 512
linters:
enable:
- bodyclose
- dogsled
- dupl
- exhaustive
- exportloopref
- gci
- goconst
- gocritic
- gocyclo
- gofmt
- goprintffuncname
- gosec
- ifshort
- misspell
- nakedret
- noctx
- nolintlint
- prealloc
- revive
- promlinter
- rowserrcheck
- sqlclosecheck
- stylecheck
- thelper
- tparallel
- unconvert
- unparam
- whitespace

View File

@ -1,14 +1,19 @@
# This workflow runs all dockerfiles in this repo
name: checks
on: [push, workflow_dispatch]
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
GO_VERSION: 1.17
GOLANGCI_LINT_VERSION: v1.43.0
jobs:
go-matrix:
name: Resolve Modules
go_matrix:
name: go matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
@ -19,11 +24,12 @@ jobs:
matrix=$(find . -type f -name "go.mod" -printf "{\"folder\":\"%h\"}," | sed -e 's/,$//')
echo "Matrix: $matrix"
echo ::set-output name=matrix::{\"include\":[$(echo $matrix)]}
go-lint:
name: lint
go_lint:
name: go lint
needs: go_matrix
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.go-matrix.outputs.matrix) }}
matrix: ${{ fromJson(needs.go_matrix.outputs.matrix) }}
env:
GOFLAGS: -mod=readonly
GOPROXY: https://proxy.golang.org

View File

@ -1,15 +1,12 @@
# Minimum golangci-lint version required: v1.42.0
run:
timeout: 5m
timeout: 3m
skip-dirs:
- tmp
linters-settings:
gci:
local-prefixes: github.com/foomo/keel
golint:
min-confidence: 0
goimports:
local-prefixes: github.com/foomo/keel
revive:
rules:
- name: indent-error-flow
@ -27,70 +24,34 @@ linters-settings:
settings:
hugeParam:
sizeThreshold: 512
lll:
line-length: 150
linters:
disable-all: true
enable:
- bodyclose
- deadcode
- dogsled
- dupl
- exhaustive
- exportloopref
- gci
- goconst
- gocritic
- gocyclo
- gofmt
- gofumpt
- goimports
- revive
- goprintffuncname
- govet
- ineffassign
- gosec
- ifshort
- misspell
- nakedret
- noctx
- nolintlint
- prealloc
- revive
- promlinter
- rowserrcheck
- sqlclosecheck
- staticcheck
- structcheck
- stylecheck
- typecheck
- thelper
- tparallel
- unconvert
- unparam
- unused
- varcheck
- whitespace
- errcheck
- gocritic
- gosimple
- gocyclo
- gosec
- lll
- exportloopref
# unused
# - godot
# - gocognit
# - nlreturn
# - gochecknoglobals
# - gochecknoinits
# - depguard
# - goheader
# - gomodguard
# don't enable:
# - asciicheck
# - funlen
# - godox
# - goerr113
# - gomnd
# - interfacer
# - maligned
# - nestif
# - testpackage
# - wsl