Skip to content

Commit

Permalink
Merge branch 'master' into go-factory-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
maranqz committed Dec 15, 2023
2 parents c1195cf + 0d5efec commit ba1ed19
Show file tree
Hide file tree
Showing 24 changed files with 115 additions and 145 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fetch-depth: 0

- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
fetch-depth: 0

- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-extra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
Expand All @@ -35,7 +35,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
Expand All @@ -56,7 +56,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
Expand All @@ -72,7 +72,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
Expand All @@ -93,7 +93,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
Expand All @@ -117,7 +117,7 @@ jobs:
- name: Unshallow
run: git fetch --prune --unshallow
- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
Expand Down
3 changes: 3 additions & 0 deletions .golangci.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1873,6 +1873,9 @@ linters-settings:
# Enforce using methods that accept a context.
# Default: false
context-only: true
# Enforce using static values for log messages.
# Default: false
static-msg: true
# Enforce using constants instead of raw keys.
# Default: false
no-raw-keys: true
Expand Down
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ issues:
- path: test/(fix|linters)_test.go
text: "string `gocritic.go` has 3 occurrences, make it a constant"

# Due to a change inside go-critic v0.10.0, some reports have been removed,
# but as we run analysis with the previous version of golangci-lint this leads to a paradoxical situation.
# This exclusion will be removed when the next version of golangci-lint (v1.56.0) will be released.
- path: pkg/golinters/nolintlint/nolintlint.go
text: "hugeParam: (i|b) is heavy \\(\\d+ bytes\\); consider passing it by pointer"

run:
timeout: 5m
skip-dirs:
Expand Down
18 changes: 9 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ require (
github.com/ashanbrown/makezero v1.1.1
github.com/bkielbasa/cyclop v1.2.1
github.com/blizzy78/varnamelen v0.8.0
github.com/bombsimon/wsl/v3 v3.4.0
github.com/bombsimon/wsl/v4 v4.2.0
github.com/breml/bidichk v0.2.7
github.com/breml/errchkjson v0.3.6
github.com/butuzov/ireturn v0.2.2
github.com/butuzov/mirror v1.1.0
github.com/catenacyber/perfsprint v0.3.1
github.com/catenacyber/perfsprint v0.4.0
github.com/charithe/durationcheck v0.0.10
github.com/curioswitch/go-reassign v0.2.0
github.com/daixiang0/gci v0.11.2
Expand All @@ -37,7 +37,7 @@ require (
github.com/firefart/nonamedreturns v1.0.4
github.com/fzipp/gocyclo v0.6.0
github.com/ghostiam/protogetter v0.3.3
github.com/go-critic/go-critic v0.9.0
github.com/go-critic/go-critic v0.10.0
github.com/go-xmlfmt/xmlfmt v1.1.2
github.com/gofrs/flock v0.8.1
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2
Expand Down Expand Up @@ -83,8 +83,8 @@ require (
github.com/nakabonne/nestif v0.3.1
github.com/nishanths/exhaustive v0.12.0
github.com/nishanths/predeclared v0.2.2
github.com/nunnatsa/ginkgolinter v0.14.1
github.com/polyfloyd/go-errorlint v1.4.5
github.com/nunnatsa/ginkgolinter v0.15.1
github.com/polyfloyd/go-errorlint v1.4.7
github.com/quasilyte/go-ruleguard/dsl v0.3.22
github.com/ryancurrah/gomodguard v1.3.0
github.com/ryanrolds/sqlclosecheck v0.5.1
Expand All @@ -93,7 +93,7 @@ require (
github.com/sashamelentyev/usestdlibvars v1.24.0
github.com/securego/gosec/v2 v2.18.2
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c
github.com/shirou/gopsutil/v3 v3.23.10
github.com/shirou/gopsutil/v3 v3.23.11
github.com/sirupsen/logrus v1.9.3
github.com/sivchari/containedctx v1.0.3
github.com/sivchari/nosnakecase v1.7.0
Expand All @@ -119,7 +119,7 @@ require (
github.com/xen0n/gosmopolitan v1.2.2
github.com/yagipy/maintidx v1.0.0
github.com/yeya24/promlinter v0.2.0
github.com/ykadowak/zerologlint v0.1.3
github.com/ykadowak/zerologlint v0.1.5
gitlab.com/bosi/decorder v0.4.1
go-simpler.org/musttag v0.8.0
go-simpler.org/sloglint v0.3.0
Expand Down Expand Up @@ -191,10 +191,10 @@ require (
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect
golang.org/x/exp/typeparams v0.0.0-20231206192017-f3f8817b8deb // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
Expand Down
40 changes: 19 additions & 21 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/commands/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func initFlagSet(fs *pflag.FlagSet, cfg *config.Config, m *lintersdb.Manager, is
const allowParallelDesc = "Allow multiple parallel golangci-lint instances running. " +
"If false (default) - golangci-lint acquires file lock on start."
fs.BoolVar(&rc.AllowParallelRunners, "allow-parallel-runners", false, wh(allowParallelDesc))
const allowSerialDesc = "Allow multiple golangci-lint instances running, but serialize them around a lock. " +
const allowSerialDesc = "Allow multiple golangci-lint instances running, but serialize them around a lock. " +
"If false (default) - golangci-lint exits with an error if it fails to acquire file lock on start."
fs.BoolVar(&rc.AllowSerialRunners, "allow-serial-runners", false, wh(allowSerialDesc))

Expand Down
2 changes: 2 additions & 0 deletions pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ var defaultLintersSettings = LintersSettings{
KVOnly: false,
AttrOnly: false,
ContextOnly: false,
StaticMsg: false,
NoRawKeys: false,
KeyNamingCase: "",
ArgsOnSepLines: false,
Expand Down Expand Up @@ -761,6 +762,7 @@ type SlogLintSettings struct {
KVOnly bool `mapstructure:"kv-only"`
AttrOnly bool `mapstructure:"attr-only"`
ContextOnly bool `mapstructure:"context-only"`
StaticMsg bool `mapstructure:"static-msg"`
NoRawKeys bool `mapstructure:"no-raw-keys"`
KeyNamingCase string `mapstructure:"key-naming-case"`
ArgsOnSepLines bool `mapstructure:"args-on-sep-lines"`
Expand Down
Loading

0 comments on commit ba1ed19

Please sign in to comment.