1
0
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:
Oleksandr Redko
2025-04-10 08:47:55 +03:00
committed by GitHub
parent 8221f8516d
commit 1cb97fdcfc
5 changed files with 7 additions and 7 deletions

View File

@ -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()

View File

@ -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, ".", `\.`)

View File

@ -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

View File

@ -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/

View File

@ -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/