Skip to content
Open
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/workflows/build-binary-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:
steps:

- name: Check out repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: go.mod

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ jobs:

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: go.mod

- name: Initialize CodeQL
uses: github/codeql-action/init@16140ae1a102900babc80a33c44059580f687047 # v4.30.9
uses: github/codeql-action/init@fdbfb4d2750291e159f0156def62b853c2798ca2 # v4.31.5
with:
languages: go, python

Expand All @@ -36,11 +36,11 @@ jobs:
make build

- name: golangci-lint
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
uses: golangci/golangci-lint-action@e7fa5ac41e1cf5b7d48e45e42232ce7ada589601 # v9.1.0
with:
version: v2.5
version: v2.6
args: --issues-exit-code=1 --timeout 10m
only-new-issues: false

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@16140ae1a102900babc80a33c44059580f687047 # v4.30.9
uses: github/codeql-action/analyze@fdbfb4d2750291e159f0156def62b853c2798ca2 # v4.31.5
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
steps:

- name: Check out code into the Go module directory
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: go.mod

Expand Down
116 changes: 19 additions & 97 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ linters:
disable:
- godoclint
- funcorder

#
# Redundant
#
Expand All @@ -14,50 +15,27 @@ linters:
- gocyclo # revive
- lll # revive

#
# Recommended? (easy)
#

- exhaustive # check exhaustiveness of enum switch statements
- godot # Check if comments end in a period
- gosec # (gas): Inspects source code for security problems
- inamedparam # reports interfaces with unnamed method parameters
- promlinter # Check Prometheus metrics naming via promlint
- tagalign # check that struct tags are well aligned
- thelper # thelper detects tests helpers which is not start with t.Helper() method.
- wrapcheck # Checks that errors returned from external packages are wrapped

#
# Recommended? (requires some work)
#

- errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`.
- ireturn # Accept Interfaces, Return Concrete Types
- mnd # An analyzer to detect magic numbers.

#
# Formatting only, useful in IDE but should not be forced on CI?
#

- nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity
- whitespace # Whitespace is a linter that checks for unnecessary newlines at the start and end of functions, if, for, etc.
- wsl # add or remove empty lines
- wsl_v5 # add or remove empty lines
- noinlineerr
- embeddedstructfieldcheck

#
# Well intended, but not ready for this
#
- forcetypeassert # finds forced type assertions
- godox # Tool for detection of FIXME, TODO and other comment keywords
- err113 # Go linter to check the errors handling expressions
- paralleltest # Detects missing usage of t.Parallel() method in your Go test
- testpackage # linter that makes you use a separate _test package

#
# Too strict / too many false positives (for now?)
#
- exhaustruct # Checks if all structure fields are initialized
- forbidigo # Forbids identifiers
- gochecknoglobals # Check that no global variables exist.
Expand All @@ -67,10 +45,7 @@ linters:
- prealloc

- depguard

- perfsprint
- noctx # manu
- dupword
- nonamedreturns


settings:
Expand All @@ -85,129 +60,82 @@ linters:
disabled-checks:
- paramTypeCombine
- todoCommentWithoutDetail
- exposedSyncMutex # manu
- commentedOutCode
- ptrToRefParam # manu
- octalLiteral # manu
- unnamedResult
- assignOp
- importShadow # manu
- emptyStringTest # manu
- builtinShadow # manu
- captLocal # manu
- commentFormatting
- whyNoLint
- preferFprint # manu

govet:
disable:
- fieldalignment
- shadow # manu
enable-all: true

maintidx:
# adjusted to accommodate API constructor complexity
under: 10
under: 17

misspell:
locale: US

modernize:
disable:
- bloop

nestif:
# lower this after refactoring
min-complexity: 13
min-complexity: 12

nlreturn:
block-size: 5

nolintlint:
require-explanation: false # don't require an explanation for nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
require-specific: true # require nolint directives to be specific about which linter is being skipped
allow-unused: false # report any unused nolint directives

perfsprint:
error-format: true
string-format: true

revive:
severity: error
enable-all-rules: true
rules:
- name: add-constant
disabled: true
- name: bool-literal-in-expr
disabled: true
- name: cognitive-complexity
arguments:
# lower this after refactoring
- 90
- 40
- name: comment-spacings
disabled: true
- name: confusing-results
disabled: true
- name: cyclomatic
arguments:
# lower this after refactoring
- 49
- 33
- name: enforce-switch-style
disabled: true
- name: context-as-argument
disabled: true
- name: empty-lines
disabled: true
- name: function-length
arguments:
# lower this after refactoring
- 111
- 287
- 93
- 233
- name: import-alias-naming
disabled: true
- name: import-shadowing
disabled: true
- name: line-length-limit
arguments:
# lower this after refactoring
- 251
- 231
- name: max-control-nesting
arguments:
# lower this after refactoring
- 7
- name: if-return
disabled: true
- name: max-public-structs
disabled: true
- name: package-directory-mismatch
disabled: true
- name: redundant-test-main-exit
disabled: true
- name: struct-tag
disabled: true
- name: var-naming
disabled: true
- name: exported
disabled: true
- name: identical-switch-branches
disabled: true
- name: indent-error-flow
disabled: true
- name: unexported-naming
disabled: true
- name: unnecessary-format
disabled: true
- name: unused-parameter
disabled: true
- name: use-any
disabled: true
- name: use-errors-new
disabled: true
- name: unused-receiver
disabled: true
- name: var-declaration
disabled: true
- 6

staticcheck:
checks:
- all
- -ST1003 # manu

wsl:
# Allow blocks to end with comments
allow-trailing-comment: true

exclusions:
presets:
Expand All @@ -223,12 +151,6 @@ linters:
- govet
text: 'shadow: declaration of "(err|ctx)" shadows declaration'

# named/naked returns are evil, with a single exception
# https://go.dev/wiki/CodeReviewComments#named-result-parameters
- linters:
- nonamedreturns
text: named return .* with type .* found

# we use t,ctx instead of ctx,t in tests
- linters:
- revive
Expand Down
Loading