mirror of
https://github.com/mgechev/revive.git
synced 2025-11-27 22:18:41 +02:00
Run var-naming on test files
This commit is contained in:
@@ -12,7 +12,8 @@ import (
|
|||||||
|
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
var var_name int // MATCH /don't use underscores in Go names; var var_name should be varName/
|
var safeUrl = "HttPS://..iaMHost..Test:443/paTh^A%ef//./%41PaTH/..//?" // MATCH /var safeUrl should be safeURL/
|
||||||
|
var var_name int // MATCH /don't use underscores in Go names; var var_name should be varName/
|
||||||
|
|
||||||
type t_wow struct { // MATCH /don't use underscores in Go names; type t_wow should be tWow/
|
type t_wow struct { // MATCH /don't use underscores in Go names; type t_wow should be tWow/
|
||||||
x_damn int // MATCH /don't use underscores in Go names; struct field x_damn should be xDamn/
|
x_damn int // MATCH /don't use underscores in Go names; struct field x_damn should be xDamn/
|
||||||
|
|||||||
@@ -16,10 +16,6 @@ type VarNamingRule struct{}
|
|||||||
func (r *VarNamingRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure {
|
func (r *VarNamingRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure {
|
||||||
var failures []lint.Failure
|
var failures []lint.Failure
|
||||||
|
|
||||||
if isTest(file) {
|
|
||||||
return failures
|
|
||||||
}
|
|
||||||
|
|
||||||
fileAst := file.AST
|
fileAst := file.AST
|
||||||
walker := lintNames{
|
walker := lintNames{
|
||||||
file: file,
|
file: file,
|
||||||
|
|||||||
Reference in New Issue
Block a user