Skip to content

Commit 9b578c6

Browse files
authored
Merge branch 'main' into gofuncor
2 parents 74ca9fe + 86cc7c6 commit 9b578c6

File tree

8 files changed

+24
-10
lines changed

8 files changed

+24
-10
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ 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.0.2
11+
12+
1. Misc.
13+
* Fixes flags parsing for formatters
14+
* Fixes the filepath used by the exclusion `source` option
15+
2. Documentation
16+
* Adds a section about flags migration
17+
* Cleaning pages with v1 options
18+
1019
### v2.0.1
1120

1221
1. Linters/formatters 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/src/docs/usage/false-positives.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ var bad_name int //nolint:all
122122
To exclude issues from specific linters only:
123123

124124
```go
125-
var bad_name int //nolint:golint,unused
125+
var bad_name int //nolint:wsl,unused
126126
```
127127

128128
To exclude issues for the block of code use this directive on the beginning of a line:

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ require (
6464
github.com/kisielk/errcheck v1.9.0
6565
github.com/kkHAIKE/contextcheck v1.1.6
6666
github.com/kulti/thelper v0.6.3
67-
github.com/kunwardeep/paralleltest v1.0.10
67+
github.com/kunwardeep/paralleltest v1.0.13
6868
github.com/lasiar/canonicalheader v1.1.2
6969
github.com/ldez/exptostd v0.4.2
7070
github.com/ldez/gomoddirectives v0.6.1

go.sum

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

pkg/result/processors/base_rule.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ func (r *baseRule) matchLinter(issue *result.Issue) bool {
8383
}
8484

8585
func (r *baseRule) matchSource(issue *result.Issue, lineCache *fsutils.LineCache, log logutils.Log) bool {
86-
sourceLine, errSourceLine := lineCache.GetLine(issue.RelativePath, issue.Line())
86+
sourceLine, errSourceLine := lineCache.GetLine(issue.FilePath(), issue.Line())
8787
if errSourceLine != nil {
88-
log.Warnf("Failed to get line %s:%d from line cache: %s", issue.RelativePath, issue.Line(), errSourceLine)
88+
log.Warnf("Failed to get line %s:%d from line cache: %s", issue.FilePath(), issue.Line(), errSourceLine)
8989
return false // can't properly match
9090
}
9191

pkg/result/processors/nolint_filter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func TestTestNolintFilter_Process(t *testing.T) {
6363
processAssertEmpty(t, p, newNolintFileIssue(6, "any"))
6464
processAssertEmpty(t, p, newNolintFileIssue(7, "any"))
6565

66-
processAssertSame(t, p, newNolintFileIssue(1, "golint")) // no directive
66+
processAssertSame(t, p, newNolintFileIssue(1, "wsl")) // no directive
6767

6868
// test preceding comments
6969
processAssertEmpty(t, p, newNolintFileIssue(10, "any")) // preceding comment for var

scripts/website/expand_templates/linters.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ func (e *ExampleSnippetsExtractor) extractExampleSnippets(example []byte) (*Sett
254254

255255
for j, node := range root.Content {
256256
switch node.Value {
257-
case "run", "output", keyLinters, keyFormatters, "issues", "severity":
257+
case "run", "output", keyLinters, keyFormatters, "issues", "severity", "version":
258258
default:
259259
continue
260260
}
@@ -280,6 +280,11 @@ func (e *ExampleSnippetsExtractor) extractExampleSnippets(example []byte) (*Sett
280280
},
281281
}
282282

283+
if node.Value == "version" {
284+
node.HeadComment = `See the dedicated "version" documentation section.`
285+
newNode = nextNode
286+
}
287+
283288
globalNode.Content = append(globalNode.Content, node, newNode)
284289

285290
if node.Value == keyLinters || node.Value == keyFormatters {

0 commit comments

Comments
 (0)