1
0
mirror of https://github.com/mgechev/revive.git synced 2025-03-31 21:55:29 +02:00

refactor: fix typo in the field name of TestFileFilterRule (#1086)

This commit is contained in:
Oleksandr Redko 2024-10-29 14:33:18 +02:00 committed by GitHub
parent 0ac1ef7298
commit 7c29b560c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,14 +7,14 @@ import (
) )
type TestFileFilterRule struct { type TestFileFilterRule struct {
WasApplyed bool WasApplied bool
} }
var _ lint.Rule = (*TestFileFilterRule)(nil) var _ lint.Rule = (*TestFileFilterRule)(nil)
func (*TestFileFilterRule) Name() string { return "test-file-filter" } func (*TestFileFilterRule) Name() string { return "test-file-filter" }
func (tfr *TestFileFilterRule) Apply(*lint.File, lint.Arguments) []lint.Failure { func (tfr *TestFileFilterRule) Apply(*lint.File, lint.Arguments) []lint.Failure {
tfr.WasApplyed = true tfr.WasApplied = true
return nil return nil
} }
@ -22,7 +22,7 @@ func TestFileExcludeFilterAtRuleLevel(t *testing.T) {
t.Run("is called if no excludes", func(t *testing.T) { t.Run("is called if no excludes", func(t *testing.T) {
rule := &TestFileFilterRule{} rule := &TestFileFilterRule{}
testRule(t, "file-to-exclude", rule, &lint.RuleConfig{}) testRule(t, "file-to-exclude", rule, &lint.RuleConfig{})
if !rule.WasApplyed { if !rule.WasApplied {
t.Fatal("should call rule if no excludes") t.Fatal("should call rule if no excludes")
} }
}) })
@ -31,7 +31,7 @@ func TestFileExcludeFilterAtRuleLevel(t *testing.T) {
cfg := &lint.RuleConfig{Exclude: []string{"no-matched.go"}} cfg := &lint.RuleConfig{Exclude: []string{"no-matched.go"}}
cfg.Initialize() cfg.Initialize()
testRule(t, "file-to-exclude", rule, cfg) testRule(t, "file-to-exclude", rule, cfg)
if !rule.WasApplyed { if !rule.WasApplied {
t.Fatal("should call rule if no excludes") t.Fatal("should call rule if no excludes")
} }
}) })
@ -41,7 +41,7 @@ func TestFileExcludeFilterAtRuleLevel(t *testing.T) {
cfg := &lint.RuleConfig{Exclude: []string{"../testdata/file-to-exclude.go"}} cfg := &lint.RuleConfig{Exclude: []string{"../testdata/file-to-exclude.go"}}
cfg.Initialize() cfg.Initialize()
testRule(t, "file-to-exclude", rule, cfg) testRule(t, "file-to-exclude", rule, cfg)
if rule.WasApplyed { if rule.WasApplied {
t.Fatal("should not call rule if excluded") t.Fatal("should not call rule if excluded")
} }
}) })