Skip to content

Commit

Permalink
Merge branch 'master' of github.com:lrstanley/bubbletint
Browse files Browse the repository at this point in the history
  • Loading branch information
lrstanley committed Jun 16, 2024
2 parents 085ae79 + c2e1e7c commit 76a153d
Showing 1 changed file with 49 additions and 32 deletions.
81 changes: 49 additions & 32 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ run:
timeout: 3m

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

exclude-rules:
Expand Down Expand Up @@ -44,18 +43,21 @@ linters:
- asciicheck # checks that your code does not contain non-ASCII identifiers
- 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
- cyclop # checks function and package cyclomatic complexity
- dupl # tool for code clone detection
- durationcheck # checks for two durations multiplied together
- errcheck # checking for unchecked errors, these unchecked errors can be critical bugs in some cases
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
- execinquery # checks query string in Query function which reads your Go src files and warning it finds
- exportloopref # checks for pointers to enclosing loop variables
- fatcontext # detects nested contexts in loops
- forbidigo # forbids identifiers
- funlen # tool for detection of long functions
- gci # controls golang package import order and makes it always deterministic
- gocheckcompilerdirectives # validates go compiler directive comments (//go:)
- gochecknoinits # checks that no init functions are present in Go code
- gochecksumtype # checks exhaustiveness on Go "sum types"
- goconst # finds repeated strings that could be replaced by a constant
- gocritic # provides diagnostics that check for bugs, performance and style issues
- gocyclo # computes and checks the cyclomatic complexity of functions
Expand All @@ -69,6 +71,7 @@ linters:
- gosimple # specializes in simplifying a code
- govet # reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
- ineffassign # detects when assignments to existing variables are not used
- intrange # finds places where for loops could make use of an integer range
- loggercheck # checks key value pairs for common logger libraries (kitlog,klog,logr,zap)
- makezero # finds slice declarations with non-zero initial length
- misspell # finds commonly misspelled words
Expand All @@ -78,16 +81,20 @@ linters:
- nilnil # checks that there is no simultaneous return of nil error and an invalid value
- noctx # finds sending http request without context.Context
- nosprintfhostport # checks for misuse of Sprintf to construct a host with port in a URL
- perfsprint # checks that fmt.Sprintf can be replaced with a faster alternative
- predeclared # finds code that shadows one of Go's predeclared identifiers
- promlinter # checks Prometheus metrics naming via promlint
- reassign # checks that package variables are not reassigned
- revive # fast, configurable, extensible, flexible, and beautiful linter for Go, drop-in replacement of golint
- rowserrcheck # checks whether Err of rows is checked successfully
- sloglint # ensure consistent code style when using log/slog
- sqlclosecheck # checks that sql.Rows and sql.Stmt are closed
- staticcheck # is a go vet on steroids, applying a ton of static analysis checks
- stylecheck # is a replacement for golint
# - tagalign # aligns struct tags -- disable for now (https://github.com/4meepo/tagalign/issues/13)
- tenv # detects using os.Setenv instead of t.Setenv since Go1.17
- testableexamples # checks if examples are testable (have an expected output)
- testifylint # checks usage of github.com/stretchr/testify
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
- typecheck # like the front-end of a Go compiler, parses and type-checks Go code
- unconvert # removes unnecessary type conversions
Expand All @@ -97,15 +104,6 @@ linters:
- wastedassign # finds wasted assignment statements
- whitespace # detects leading and trailing whitespace

# disabled for now:
# - gomnd # detects magic numbers
# - errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
# - gochecknoglobals # checks that no global variables exist
# - gocognit # computes and checks the cognitive complexity of functions
# - nestif # reports deeply nested if statements
# - nonamedreturns # reports all named returns
# - testpackage # makes you use a separate _test package

linters-settings:
cyclop:
# The maximal code complexity to report.
Expand All @@ -121,15 +119,11 @@ linters-settings:

funlen:
# Checks the number of lines in a function.
# If lower than 0, disable the check.
lines: 150
# Checks the number of statements in a function.
# If lower than 0, disable the check.
statements: 75

# gocognit:
# # Minimal code complexity to report.
# min-complexity: 25
# Ignore comments.
ignore-comments: true

gocritic:
disabled-checks:
Expand All @@ -150,20 +144,6 @@ linters-settings:
# Whether to skip (*x).method() calls where x is a pointer receiver.
skipRecvDeref: false

# gomnd:
# # Values always ignored: `time.Date`,
# # `strconv.FormatInt`, `strconv.FormatUint`, `strconv.FormatFloat`,
# # `strconv.ParseInt`, `strconv.ParseUint`, `strconv.ParseFloat`.
# ignored-functions:
# - os.Chmod
# - os.Mkdir
# - os.MkdirAll
# - os.OpenFile
# - os.WriteFile
# - prometheus.ExponentialBuckets
# - prometheus.ExponentialBucketsRange
# - prometheus.LinearBuckets

gomodguard:
blocked:
# List of blocked modules.
Expand Down Expand Up @@ -205,6 +185,43 @@ linters-settings:
- all
- -ST1008 # handled by revive already.

sloglint:
# Enforce not using global loggers.
no-global: "all"
# Enforce using methods that accept a context.
context: "scope"

tagalign:
align: true
sort: true
order:
# go-flags items
- command
- alias
- group
- namespace
- env-namespace
- subcommands-optional
- env
- env-delim
- short
- long
- no-flag
- hidden
- required
- value-name
- default
- choice
- description
- long-description
# everything else
- json
- yaml
- yml
- toml
- validate
strict: false

tenv:
# The option `all` will run against whole test files (`_test.go`) regardless of method/function signatures.
# Otherwise, only methods that take `*testing.T`, `*testing.B`, and `testing.TB` as arguments are checked.
Expand Down

0 comments on commit 76a153d

Please sign in to comment.