1
0
mirror of https://github.com/mgechev/revive.git synced 2025-10-30 23:37:49 +02:00

fix(var-naming): set node to package name for underscore in package name (#689)

Setting the entire file AST as the node causes golangci-lint to print
the entire file source as the context, and line and column numbers set
to 1. Point to the package name node instead.

Closes #688
This commit is contained in:
Ville Skyttä
2022-05-23 13:30:25 +03:00
committed by GitHub
parent e10678fea5
commit 4daa573afe

View File

@@ -56,7 +56,7 @@ func (r *VarNamingRule) Apply(file *lint.File, arguments lint.Arguments) []lint.
walker.onFailure(lint.Failure{
Failure: "don't use an underscore in package name",
Confidence: 1,
Node: walker.fileAst,
Node: walker.fileAst.Name,
Category: "naming",
})
}