Skip to content

Commit

Permalink
chore: repo maintenance (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikoksr authored Oct 24, 2024
1 parent 7ddb569 commit 220487f
Show file tree
Hide file tree
Showing 9 changed files with 388 additions and 134 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59
version: v1.61
17 changes: 7 additions & 10 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This code is licensed under the terms of the MIT license https://opensource.org/license/mit
# Copyright (c) 2021 Marat Reymers

## Golden config for golangci-lint v1.59.1
## Golden config for golangci-lint v1.61.0
#
# This is the best config for golangci-lint based on my experience and opinion.
# It is very strict, but not extremely strict.
Expand All @@ -12,7 +12,6 @@ run:
# Default: 1m
timeout: 3m


# This file contains only configs which differ from defaults.
# All possible options can be found here https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml
linters-settings:
Expand Down Expand Up @@ -166,7 +165,7 @@ linters-settings:
nolintlint:
# Exclude following linters from requiring an explanation.
# Default: []
allow-no-explanation: [ funlen, gocognit, lll ]
allow-no-explanation: [funlen, gocognit, lll]
# Enable to require an explanation of nonzero length after each nolint directive.
# Default: false
require-explanation: true
Expand Down Expand Up @@ -209,7 +208,6 @@ linters-settings:
# Default: false
all: true


linters:
disable-all: true
enable:
Expand All @@ -227,14 +225,13 @@ linters:
- bidichk # checks for dangerous unicode character sequences
- bodyclose # checks whether HTTP response body is closed successfully
- canonicalheader # checks whether net/http.Header uses canonical header
- copyloopvar # detects places where loop variables are copied
- copyloopvar # detects places where loop variables are copied (Go 1.22+)
- cyclop # checks function and package cyclomatic complexity
- dupl # tool for code clone detection
- durationcheck # checks for two durations multiplied together
- errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
- exhaustive # checks exhaustiveness of enum switch statements
- exportloopref # checks for pointers to enclosing loop variables
- fatcontext # detects nested contexts in loops
- forbidigo # forbids identifiers
- funlen # tool for detection of long functions
Expand Down Expand Up @@ -314,6 +311,7 @@ linters:
#- err113 # [too strict] checks the errors handling expressions
#- errchkjson # [don't see profit + I'm against of omitting errors like in the first example https://github.com/breml/errchkjson] checks types passed to the json encoding functions. Reports unsupported types and optionally reports occasions, where the check for the returned error can be omitted
#- execinquery # [deprecated] checks query string in Query function which reads your Go src files and warning it finds
#- exportloopref # [not necessary from Go 1.22] checks for pointers to enclosing loop variables
#- forcetypeassert # [replaced by errcheck] finds forced type assertions
#- gofmt # [replaced by goimports] checks whether code was gofmt-ed
#- gofumpt # [replaced by goimports, gofumports is not available yet] checks whether code was gofumpt-ed
Expand All @@ -328,7 +326,6 @@ linters:
#- thelper # detects golang test helpers without t.Helper() call and checks the consistency of test helpers
#- wsl # [too strict and mostly code is not more readable] whitespace linter forces you to use empty lines


issues:
# Maximum count of issues with the same text.
# Set to 0 to disable.
Expand All @@ -337,9 +334,9 @@ issues:

exclude-rules:
- source: "(noinspection|TODO)"
linters: [ godot ]
linters: [godot]
- source: "//noinspection"
linters: [ gocritic ]
linters: [gocritic]
- path: "_test\\.go"
linters:
- bodyclose
Expand All @@ -348,4 +345,4 @@ issues:
- goconst
- gosec
- noctx
- wrapcheck
- wrapcheck
Loading

0 comments on commit 220487f

Please sign in to comment.