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:
		| @@ -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", | ||||
| 		}) | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user