Skip to content

Commit

Permalink
Merge branch 'main' into linter_test
Browse files Browse the repository at this point in the history
  • Loading branch information
Disper authored Dec 5, 2024
2 parents e2d5e24 + ea07e92 commit 57efe29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 45 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read
pull-requests: read
checks: write

jobs:
golangci-lint:
Expand All @@ -35,7 +35,7 @@ jobs:
# Note: By default, the `.golangci.yml` file should be at the root of the repository.
# The location of the configuration file can be changed by using `--config=`
# args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0
args: --timeout=10m --skip-files=.*_test\.go --skip-dirs=internal/controller/runtime/fsm/testing --verbose
args: --timeout=10m --skip-files=.*_test\.go --skip-dirs=internal/controller/runtime/fsm/testing

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
Expand Down
42 changes: 0 additions & 42 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,12 @@ linters-settings:
- os.WriteFile

govet:
# Enable all analyzers.
# Default: false
enable-all: true
# Disable analyzers by name.
# Run `go tool vet help` to see all analyzers.
# Default: []
disable:
- fieldalignment # too strict
# Settings per analyzer.
settings:
shadow:
# Whether to be strict about shadowing; can be noisy.
# Default: false
strict: false


linters:
disable-all: true
Expand All @@ -63,43 +54,10 @@ linters:
- 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
- staticcheck # is a go vet on steroids, applying a ton of static analysis checks
- typecheck # like the front-end of a Go compiler, parses and type-checks Go code
- unused # checks for unused constants, variables, functions and types
## disabled by default
- asasalint # checks for pass []any as any in variadic func(...any)
- asciicheck # checks that your code does not contain non-ASCII identifiers
- 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
- exportloopref # checks for pointers to enclosing loop variables
- gci # controls golang package import order and makes it always deterministic
- gochecknoglobals # checks that no global variables exist
- goconst # finds repeated strings that could be replaced by a constant
- gocritic # provides diagnostics that check for bugs, performance and style issues
- godox # detects TODOs keywords
# - goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt. Dissabled as can't work together with `gci`
- mnd # detects magic numbers
# - gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod
- nestif # reports deeply nested if statements
- nilerr # finds the code that returns nil even if it checks that the error is not nil
- nilnil # checks that there is no simultaneous return of nil error and an invalid value
- revive # fast, configurable, extensible, flexible, and beautiful linter for Go, drop-in replacement of golint
- unconvert # removes unnecessary type conversions
- unparam # reports unused function parameters
- whitespace # detects leading and trailing whitespace


issues:
# Maximum count of issues with the same text.
# Set to 0 to disable.
# Default: 3
max-same-issues: 5

exclude-rules:
- source: "(noinspection|TODO)"
linters: [ godot ]
- source: "//noinspection"
linters: [ gocritic ]
- path: "_test\\.go"
linters:
- goconst

0 comments on commit 57efe29

Please sign in to comment.