Skip to content

Commit ad2d135

Browse files
committed
Merge remote-tracking branch 'origin/embeddedcheck-linter' into embeddedcheck-linter
# Conflicts: # go.mod # go.sum
2 parents 0c883bf + 71ca3dd commit ad2d135

File tree

17 files changed

+118
-42
lines changed

17 files changed

+118
-42
lines changed

.golangci.next.reference.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,9 @@ linters:
541541
# Checks if the exported methods of a structure are placed before the non-exported ones.
542542
# Default: true
543543
struct-method: false
544+
# Checks if the constructors and/or structure methods are sorted alphabetically.
545+
# Default: false
546+
alphabetical: true
544547

545548
funlen:
546549
# Checks the number of lines in a function.

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,36 @@ If you value it, consider supporting us, we appreciate it! ❤️
77
[![Open Collective backers and sponsors](https://img.shields.io/badge/OpenCollective-Donate-blue?logo=opencollective&style=for-the-badge)](https://opencollective.com/golangci-lint)
88
[![GitHub Sponsors](https://img.shields.io/badge/GitHub-Donate-blue?logo=github&style=for-the-badge)](https://github.com/sponsors/golangci)
99

10+
### v2.1.6
11+
12+
1. Linters bug fixes
13+
* `godot`: from 1.5.0 to 1.5.1
14+
* `musttag`: from 0.13.0 to 0.13.1
15+
2. Documentation
16+
* Add note about golangci-lint v2 integration in VS Code
17+
18+
### v2.1.5
19+
20+
Due to an error related to Snapcraft, some artifacts of the v2.1.4 release have not been published.
21+
22+
This release contains the same things as v2.1.3.
23+
24+
### v2.1.4
25+
26+
Due to an error related to Snapcraft, some artifacts of the v2.1.3 release have not been published.
27+
28+
This release contains the same things as v2.1.3.
29+
30+
### v2.1.3
31+
32+
1. Linters bug fixes
33+
* `fatcontext`: from 0.7.2 to 0.8.0
34+
2. Misc.
35+
* migration: fix `nakedret.max-func-lines: 0`
36+
* migration: fix order of `staticcheck` settings
37+
* fix: add `go.mod` hash to the cache salt
38+
* fix: use diagnostic position for related information position
39+
1040
### v2.1.2
1141

1242
1. Linters bug fixes

assets/github-action-config-v2.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package-lock.json

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/src/docs/welcome/integrations.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Both v1 and v2 versions are supported.
1515

1616
Install the [extension](https://marketplace.visualstudio.com/items?itemName=golang.Go).
1717

18+
**Note:** To use golangci-lint v2, you may need to switch to the pre-release version of the extension: [vscode-go#3732](https://github.com/golang/vscode-go/issues/3732#issuecomment-2805974456).
19+
1820
<details>
1921
<summary style={{color: '#737380'}}>Recommended settings for those who installed golangci-lint manually</summary>
2022

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24
1515
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1
1616
github.com/OpenPeeDeeP/depguard/v2 v2.2.1
17-
github.com/alecthomas/chroma/v2 v2.16.0
17+
github.com/alecthomas/chroma/v2 v2.17.2
1818
github.com/alecthomas/go-check-sumtype v0.3.1
1919
github.com/alexkohler/nakedret/v2 v2.0.6
2020
github.com/alexkohler/prealloc v1.0.0
@@ -74,7 +74,7 @@ require (
7474
github.com/leonklingele/grouper v1.1.2
7575
github.com/macabu/inamedparam v0.2.0
7676
github.com/manuelarte/embeddedcheck v0.1.0
77-
github.com/manuelarte/funcorder v0.2.1
77+
github.com/manuelarte/funcorder v0.3.0
7878
github.com/maratori/testableexamples v1.0.0
7979
github.com/maratori/testpackage v1.1.1
8080
github.com/matoous/godox v1.1.0
@@ -98,7 +98,7 @@ require (
9898
github.com/sashamelentyev/interfacebloat v1.1.0
9999
github.com/sashamelentyev/usestdlibvars v1.28.0
100100
github.com/securego/gosec/v2 v2.22.3
101-
github.com/shirou/gopsutil/v4 v4.25.3
101+
github.com/shirou/gopsutil/v4 v4.25.4
102102
github.com/sirupsen/logrus v1.9.3
103103
github.com/sivchari/containedctx v1.0.3
104104
github.com/sonatard/noctx v0.1.0
@@ -110,7 +110,7 @@ require (
110110
github.com/stbenjam/no-sprintf-host-port v0.2.0
111111
github.com/stretchr/testify v1.10.0
112112
github.com/tdakkota/asciicheck v0.4.1
113-
github.com/tetafro/godot v1.5.0
113+
github.com/tetafro/godot v1.5.1
114114
github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67
115115
github.com/timonwong/loggercheck v0.11.0
116116
github.com/tomarrell/wrapcheck/v2 v2.11.0
@@ -125,7 +125,7 @@ require (
125125
github.com/yeya24/promlinter v0.3.0
126126
github.com/ykadowak/zerologlint v0.1.5
127127
gitlab.com/bosi/decorder v0.4.2
128-
go-simpler.org/musttag v0.13.0
128+
go-simpler.org/musttag v0.13.1
129129
go-simpler.org/sloglint v0.11.0
130130
go.augendre.info/fatcontext v0.8.0
131131
go.uber.org/automaxprocs v1.6.0

go.sum

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jsonschema/golangci.next.jsonschema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,11 @@
13171317
"description": "Checks if the exported methods of a structure are placed before the non-exported ones.",
13181318
"type": "boolean",
13191319
"default": true
1320+
},
1321+
"alphabetical": {
1322+
"description": "Checks if the constructors and/or structure methods are sorted alphabetically.",
1323+
"type": "boolean",
1324+
"default": false
13201325
}
13211326
}
13221327
},

pkg/config/linters_settings.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ type ForbidigoPattern struct {
428428
type FuncOrderSettings struct {
429429
Constructor bool `mapstructure:"constructor,omitempty"`
430430
StructMethod bool `mapstructure:"struct-method,omitempty"`
431+
Alphabetical bool `mapstructure:"alphabetical,omitempty"`
431432
}
432433

433434
type FunlenSettings struct {

pkg/golinters/funcorder/funcorder.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ func New(settings *config.FuncOrderSettings) *goanalysis.Linter {
1717
cfg[a.Name] = map[string]any{
1818
analyzer.ConstructorCheckName: settings.Constructor,
1919
analyzer.StructMethodCheckName: settings.StructMethod,
20+
analyzer.AlphabeticalCheckName: settings.Alphabetical,
2021
}
2122
}
2223

0 commit comments

Comments
 (0)