mirror of
https://github.com/mgechev/revive.git
synced 2025-07-05 00:28:53 +02:00
refactor: fix typos in comments and struct names (#1304)
This commit is contained in:
@ -38,7 +38,7 @@ func fail(err string) {
|
||||
|
||||
// RunRevive runs the CLI for revive.
|
||||
func RunRevive(extraRules ...revivelib.ExtraRule) {
|
||||
// move parsing flags outside of init() otherwise tests dont works properly
|
||||
// move parsing flags outside of init() otherwise tests don't works properly
|
||||
// more info: https://github.com/golang/go/issues/46869#issuecomment-865695953
|
||||
initConfig()
|
||||
|
||||
|
@ -117,7 +117,7 @@ func (ff *FileFilter) prepareRegexp() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// it's whole file mask, just escape dots and normilze separators
|
||||
// it's whole file mask, just escape dots and normalize separators
|
||||
fillRx := src
|
||||
fillRx = strings.ReplaceAll(fillRx, "\\", "/")
|
||||
fillRx = strings.ReplaceAll(fillRx, ".", `\.`)
|
||||
|
@ -18,7 +18,7 @@ func (*OptimizeOperandsOrderRule) Apply(file *lint.File, _ lint.Arguments) []lin
|
||||
onFailure := func(failure lint.Failure) {
|
||||
failures = append(failures, failure)
|
||||
}
|
||||
w := lintOptimizeOperandsOrderlExpr{
|
||||
w := lintOptimizeOperandsOrderExpr{
|
||||
onFailure: onFailure,
|
||||
}
|
||||
ast.Walk(w, file.AST)
|
||||
@ -30,13 +30,13 @@ func (*OptimizeOperandsOrderRule) Name() string {
|
||||
return "optimize-operands-order"
|
||||
}
|
||||
|
||||
type lintOptimizeOperandsOrderlExpr struct {
|
||||
type lintOptimizeOperandsOrderExpr struct {
|
||||
onFailure func(failure lint.Failure)
|
||||
}
|
||||
|
||||
// Visit checks boolean AND and OR expressions to determine
|
||||
// if swapping their operands may result in an execution speedup.
|
||||
func (w lintOptimizeOperandsOrderlExpr) Visit(node ast.Node) ast.Visitor {
|
||||
func (w lintOptimizeOperandsOrderExpr) Visit(node ast.Node) ast.Visitor {
|
||||
binExpr, ok := node.(*ast.BinaryExpr)
|
||||
if !ok {
|
||||
return w
|
||||
|
2
testdata/go1.24/struct_tag.go
vendored
2
testdata/go1.24/struct_tag.go
vendored
@ -1,7 +1,7 @@
|
||||
package fixtures
|
||||
|
||||
type decodeAndValidateRequest struct {
|
||||
// BEAWRE : the flag of URLParam should match the const string URLParam
|
||||
// BEWARE : the flag of URLParam should match the const string URLParam
|
||||
URLParam string `json:"-" path:"url_param" validate:"numeric"`
|
||||
Text string `json:"text" validate:"max=10"`
|
||||
DefaultInt int `json:"defaultInt" default:"10.0"` // MATCH /type mismatch between field type and default value type in default tag/
|
||||
|
2
testdata/struct_tag.go
vendored
2
testdata/struct_tag.go
vendored
@ -3,7 +3,7 @@ package fixtures
|
||||
import "time"
|
||||
|
||||
type decodeAndValidateRequest struct {
|
||||
// BEAWRE : the flag of URLParam should match the const string URLParam
|
||||
// BEWARE : the flag of URLParam should match the const string URLParam
|
||||
URLParam string `json:"-" path:"url_param" validate:"numeric"`
|
||||
Text string `json:"text" validate:"max=10"`
|
||||
DefaultInt int `json:"defaultInt" default:"10.0"` // MATCH /type mismatch between field type and default value type in default tag/
|
||||
|
Reference in New Issue
Block a user