Skip to content

docs: update documentation assets #5393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 11, 2025
Merged
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
72 changes: 58 additions & 14 deletions .golangci.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ linters:
- errchkjson
- errname
- errorlint
- execinquery
- exhaustive
- exhaustruct
- exportloopref
- exptostd
- fatcontext
- forbidigo
Expand Down Expand Up @@ -106,7 +104,6 @@ linters:
- stylecheck
- tagalign
- tagliatelle
- tenv
- testableexamples
- testifylint
- testpackage
Expand Down Expand Up @@ -150,10 +147,8 @@ linters:
- errchkjson
- errname
- errorlint
- execinquery
- exhaustive
- exhaustruct
- exportloopref
- exptostd
- fatcontext
- forbidigo
Expand Down Expand Up @@ -225,7 +220,6 @@ linters:
- stylecheck
- tagalign
- tagliatelle
- tenv
- testableexamples
- testifylint
- testpackage
Expand All @@ -243,15 +237,18 @@ linters:
- wsl
- zerologlint
- deadcode # Deprecated
- execinquery # Deprecated
- exhaustivestruct # Deprecated
- exportloopref # Deprecated
- golint # Deprecated
- gomnd # Deprecated
- ifshort # Deprecated
- interfacer # Deprecated
- maligned # Deprecated
- gomnd # Deprecated
- nosnakecase # Deprecated
- scopelint # Deprecated
- structcheck # Deprecated
- tenv # Deprecated
- varcheck # Deprecated

# Enable presets.
Expand Down Expand Up @@ -548,6 +545,12 @@ linters-settings:
exclude:
- '.+/cobra\.Command$'

fatcontext:
# Check for potential fat contexts in struct pointers.
# May generate false positives.
# Default: false
check-struct-pointers: true

forbidigo:
# Forbid the following identifiers (list of regexp).
# Default: ["^(fmt\\.Print(|f|ln)|print|println)$"]
Expand Down Expand Up @@ -1841,7 +1844,7 @@ linters-settings:
- sortslice
# Check signature of methods of well-known interfaces.
- stdmethods
# Check for uses of too-new standard library symbols.
# Report uses of too-new standard library symbols.
- stdversion
# Check for string(int) conversions.
- stringintconv
Expand All @@ -1863,7 +1866,7 @@ linters-settings:
- unusedresult
# Checks for unused writes.
- unusedwrite
# Checks for misuses of sync.WaitGroup.
# Check for misuses of sync.WaitGroup.
- waitgroup

# Enable all analyzers.
Expand Down Expand Up @@ -1908,6 +1911,7 @@ linters-settings:
- slog
- sortslice
- stdmethods
- stdversion
- stringintconv
- structtag
- testinggoroutine
Expand All @@ -1918,6 +1922,7 @@ linters-settings:
- unsafeptr
- unusedresult
- unusedwrite
- waitgroup

# Settings per analyzer.
settings:
Expand Down Expand Up @@ -2238,23 +2243,37 @@ linters-settings:
# still required to have `t.Parallel`, but subtests are allowed to skip it.
# Default: false
ignore-missing-subtests: true

perfsprint:
# Enable/disable optimization of integer formatting.
# Default: true
integer-format: false
# Optimizes even if it requires an int or uint type cast.
# Default: true
int-conversion: false
# Enable/disable optimization of error formatting.
# Default: true
error-format: false
# Optimizes into `err.Error()` even if it is only equivalent for non-nil errors.
# Default: false
err-error: true
# Optimizes `fmt.Errorf`.
# Default: true
errorf: false
# Enable/disable optimization of string formatting.
# Default: true
string-format: false
# Optimizes `fmt.Sprintf` with only one argument.
# Default: true
sprintf1: false
# Optimizes into strings concatenation.
# Default: true
strconcat: false
# Enable/disable optimization of bool formatting.
# Default: true
bool-format: false
# Enable/disable optimization of hex formatting.
# Default: true
hex-format: false

prealloc:
# IMPORTANT: we don't recommend using this linter before doing performance profiling.
Expand Down Expand Up @@ -2371,7 +2390,7 @@ linters-settings:
# This means that linting errors with less than 0.8 confidence will be ignored.
# Default: 0.8
confidence: 0.1

# Run `GL_DEBUG=revive golangci-lint run --enable-only=revive` to see default, all available rules, and enabled rules.
rules:
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#add-constant
- name: add-constant
Expand Down Expand Up @@ -2508,6 +2527,7 @@ linters-settings:
exclude: [""]
arguments:
- "preserveScope"
- "allowJump"
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#empty-block
- name: empty-block
severity: warning
Expand Down Expand Up @@ -2591,7 +2611,7 @@ linters-settings:
disabled: false
exclude: [""]
arguments:
- "^[_a-z][_a-z0-9]*.go$"
- "^[_a-z][_a-z0-9]*\\.go$"
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#flag-parameter
- name: flag-parameter
severity: warning
Expand Down Expand Up @@ -2726,6 +2746,11 @@ linters-settings:
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#redundant-build-tag
- name: redundant-build-tag
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#redundant-import-alias
- name: redundant-import-alias
severity: warning
Expand Down Expand Up @@ -2835,6 +2860,11 @@ linters-settings:
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-errors-new
- name: use-errors-new
severity: warning
disabled: false
exclude: [""]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#useless-break
- name: useless-break
severity: warning
Expand Down Expand Up @@ -3639,8 +3669,8 @@ linters-settings:
os-mkdir-temp: false

# Enable/disable `os.Setenv()` detections.
# Default: false
os-setenv: true
# Default: true
os-setenv: false

# Enable/disable `os.TempDir()` detections.
# Default: false
Expand Down Expand Up @@ -4026,6 +4056,10 @@ issues:
# Default: false
new: true

# Show only new issues created after the best common ancestor (merge-base against HEAD).
# Default: ""
new-from-merge-base: main

# Show only new issues created after git revision `REV`.
# Default: ""
new-from-rev: HEAD
Expand Down Expand Up @@ -4124,6 +4158,16 @@ run:
# Default: 1m
timeout: 5m

# The mode used to evaluate relative paths.
# It's used by exclusions, Go plugins, and some linters.
# The value can be:
# - `gomod`: the paths will be relative to the directory of the `go.mod` file.
# - `gitroot`: the paths will be relative to the git root (the parent directory of `.git`).
# - `cfg`: the paths will be relative to the configuration file.
# - `wd` (NOT recommended): the paths will be relative to the place where golangci-lint is run.
# Default: wd
relative-path-mode: gomod

# Exit code when at least one issue was found.
# Default: 1
issues-exit-code: 2
Expand Down
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,48 @@ If you value it, consider supporting us, we appreciate it! ❤️
[![Open Collective backers and sponsors](https://img.shields.io/badge/OpenCollective-Donate-blue?logo=opencollective&style=for-the-badge)](https://opencollective.com/golangci-lint)
[![GitHub Sponsors](https://img.shields.io/badge/GitHub-Donate-blue?logo=github&style=for-the-badge)](https://github.com/sponsors/golangci)

### v1.64.2

This is the last minor release of golangci-lint v1.
The next release will be golangci-lint [v2](https://github.com/golangci/golangci-lint/issues/5300).

1. Enhancements
* 🎉 go1.24 support
* New `issues.new-from-merge-base` option
* New `run.relative-path-mode` option
2. Linters new features
* `copyloopvar`: from 1.1.0 to 1.2.1 (support suggested fixes)
* `exptostd`: from 0.3.1 to 0.4.1 (handles `golang.org/x/exp/constraints.Ordered`)
* `fatcontext`: from 0.5.3 to 0.7.1 (new option: `check-struct-pointers`)
* `perfsprint`: from 0.7.1 to 0.8.1 (new options: `integer-format`, `error-format`, `string-format`, `bool-format`, and `hex-format`)
* `revive`: from 1.5.1 to 1.6.0 (new rules: `redundant-build-tag`, `use-errors-new`. New option `early-return.early-return`)
3. Linters bug fixes
* `go-errorlint`: from 1.7.0 to 1.7.1
* `gochecknoglobals`: from 0.2.1 to 0.2.2
* `godox`: from 006bad1f9d26 to 1.1.0
* `gosec`: from 2.21.4 to 2.22.0
* `iface`: from 1.3.0 to 1.3.1
* `nilnesserr`: from 0.1.1 to 0.1.2
* `protogetter`: from 0.3.8 to 0.3.9
* `sloglint`: from 0.7.2 to 0.9.0
* `spancheck`: fix default `StartSpanMatchersSlice` values
* `staticcheck`: from 0.5.1 to 0.6.0
4. Deprecations
* ⚠️ `tenv` is deprecated and replaced by `usetesing.osenv: true`.
5. Misc.
* Sanitize severities by output format
* Avoid panic with plugin without description
6. Documentation
* Clarify `depguard` configuration

### v1.64.1

Cancelled due to CI failure.

### v1.64.0

Cancelled due to CI failure.

### v1.63.4

1. Linters bug fixes
Expand Down
33 changes: 11 additions & 22 deletions assets/linters-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@
},
{
"name": "copyloopvar",
"desc": "copyloopvar is a linter detects places where loop variables are copied",
"desc": "a linter detects places where loop variables are copied",
"loadMode": 8199,
"inPresets": [
"style"
],
"originalURL": "https://github.com/karamaru-alpha/copyloopvar",
"internal": false,
"canAutoFix": true,
"isSlow": false,
"since": "v1.57.0"
},
Expand Down Expand Up @@ -262,23 +263,6 @@
"isSlow": true,
"since": "v1.46.0"
},
{
"name": "exportloopref",
"desc": "checks for pointers to enclosing loop variables",
"loadMode": 8767,
"inPresets": [
"bugs"
],
"originalURL": "https://github.com/kyoh86/exportloopref",
"internal": false,
"isSlow": true,
"since": "v1.28.0",
"deprecation": {
"since": "v1.60.2",
"message": "Since Go1.22 (loopvar) this linter is no longer relevant.",
"replacement": "copyloopvar"
}
},
{
"name": "exptostd",
"desc": "Detects functions from golang.org/x/exp/ that can be replaced by std functions.",
Expand Down Expand Up @@ -343,7 +327,7 @@
},
{
"name": "gci",
"desc": "Checks if code and import statements are formatted, it makes import statements always deterministic.",
"desc": "Checks if code and import statements are formatted, with additional rules.",
"loadMode": 8199,
"inPresets": [
"format",
Expand Down Expand Up @@ -481,7 +465,7 @@
},
{
"name": "godox",
"desc": "Tool for detection of FIXME, TODO and other comment keywords",
"desc": "Detects usage of FIXME, TODO and other keywords inside comments",
"loadMode": 8199,
"inPresets": [
"style",
Expand Down Expand Up @@ -907,7 +891,7 @@
},
{
"name": "nilnesserr",
"desc": "Reports constructs that checks for err != nil, but returns a different nil value error. Powered by nilness and nilerr.",
"desc": "Reports constructs that checks for err != nil, but returns a different nil value error.\nPowered by nilness and nilerr.",
"loadMode": 8767,
"inPresets": [
"bugs"
Expand Down Expand Up @@ -1208,7 +1192,12 @@
"originalURL": "https://github.com/sivchari/tenv",
"internal": false,
"isSlow": true,
"since": "v1.43.0"
"since": "v1.43.0",
"deprecation": {
"since": "v1.64.0",
"message": "Duplicate feature another linter.",
"replacement": "usetesting"
}
},
{
"name": "testableexamples",
Expand Down
Loading
Loading