Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Jan 24, 2025
1 parent 5f46982 commit 3fa2ebb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pkg/config/base_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (b *BaseRule) Validate(minConditionsCount int) error {
}

if nonBlank < minConditionsCount {
return fmt.Errorf("at least %d of (text, source, path[-except], linters) should be set", minConditionsCount)
return fmt.Errorf("at least %d of (text, source, path[-except], linters) should be set", minConditionsCount)
}

return nil
Expand Down
10 changes: 5 additions & 5 deletions pkg/config/issues_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestExcludeRule_Validate(t *testing.T) {
{
desc: "empty rule",
rule: &ExcludeRule{},
expected: "at least 2 of (text, source, path[-except], linters) should be set",
expected: "at least 2 of (text, source, path[-except], linters) should be set",
},
{
desc: "only path rule",
Expand All @@ -43,7 +43,7 @@ func TestExcludeRule_Validate(t *testing.T) {
Path: "test",
},
},
expected: "at least 2 of (text, source, path[-except], linters) should be set",
expected: "at least 2 of (text, source, path[-except], linters) should be set",
},
{
desc: "only path-except rule",
Expand All @@ -52,7 +52,7 @@ func TestExcludeRule_Validate(t *testing.T) {
PathExcept: "test",
},
},
expected: "at least 2 of (text, source, path[-except], linters) should be set",
expected: "at least 2 of (text, source, path[-except], linters) should be set",
},
{
desc: "only text rule",
Expand All @@ -61,7 +61,7 @@ func TestExcludeRule_Validate(t *testing.T) {
Text: "test",
},
},
expected: "at least 2 of (text, source, path[-except], linters) should be set",
expected: "at least 2 of (text, source, path[-except], linters) should be set",
},
{
desc: "only source rule",
Expand All @@ -70,7 +70,7 @@ func TestExcludeRule_Validate(t *testing.T) {
Source: "test",
},
},
expected: "at least 2 of (text, source, path[-except], linters) should be set",
expected: "at least 2 of (text, source, path[-except], linters) should be set",
},
{
desc: "invalid path rule",
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/severity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func TestSeverityRule_Validate_error(t *testing.T) {
rule: &SeverityRule{
Severity: "low",
},
expected: "at least 1 of (text, source, path[-except], linters) should be set",
expected: "at least 1 of (text, source, path[-except], linters) should be set",
},
{
desc: "invalid path rule",
Expand Down
4 changes: 2 additions & 2 deletions pkg/result/processors/exclusion_paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (p *ExclusionPaths) Finish() {
func (p *ExclusionPaths) shouldPassIssue(issue *result.Issue) bool {
for _, pattern := range p.pathPatterns {
if pattern.MatchString(issue.RelativePath) {
p.excludedPathCounter[pattern] += 1
p.excludedPathCounter[pattern]++
return false
}
}
Expand All @@ -110,7 +110,7 @@ func (p *ExclusionPaths) shouldPassIssue(issue *result.Issue) bool {
continue
}

p.excludedPathExceptCounter[pattern] += 1
p.excludedPathExceptCounter[pattern]++
matched = true
}

Expand Down

0 comments on commit 3fa2ebb

Please sign in to comment.