Skip to content

Conversation

@ldez
Copy link
Member

@ldez ldez commented Apr 19, 2024

before
$ golangci-lint run --enable-only gomoddirectives
WARN [runner] Can't process result by autogenerated_exclude processor: can't filter issue result.Issue{FromLinter:"gomoddirectives", Text:"local replacement are not allowed: k8s.io/api", Severity:"", SourceLines:[]string(nil), Replacement:(*result.Replacement)(nil), Pkg:(*packages.Package)(0xc000ed0480), LineRange:(*result.Range)(nil), Pos:token.Position{Filename:"go.mod", Offset:0, Line:240, Column:2}, HunkPos:0, ExpectNoLint:false, ExpectedNoLintLinter:""}: failed to get doc (lax) of file go.mod: failed to parse file: go.mod:7:1: expected 'package', found module 
With the PR
$ ./golangci-lint run --enable-only gomoddirectives
go.mod:240:2: local replacement are not allowed: k8s.io/api (gomoddirectives)
        k8s.io/api => ./staging/src/k8s.io/api
        ^
go.mod:241:2: local replacement are not allowed: k8s.io/apiextensions-apiserver (gomoddirectives)
        k8s.io/apiextensions-apiserver => ./staging/src/k8s.io/apiextensions-apiserver
        ^
go.mod:242:2: local replacement are not allowed: k8s.io/apimachinery (gomoddirectives)
        k8s.io/apimachinery => ./staging/src/k8s.io/apimachinery
        ^
...

The previous samples are created by analyzing the k8s code.

@ldez ldez added bug Something isn't working area: processors labels Apr 19, 2024
@ldez ldez added this to the next milestone Apr 19, 2024
@ldez ldez merged commit 2b2fc8c into golangci:master Apr 21, 2024
@ldez ldez deleted the fix/go-mod-reports branch April 21, 2024 11:59
@ldez ldez modified the milestones: next, v1.58 May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: processors bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants