Skip to content

Commit 1c5e5e1

Browse files
committed
chore: remove severity case sensitive option
1 parent 2621449 commit 1c5e5e1

File tree

6 files changed

+3
-22
lines changed

6 files changed

+3
-22
lines changed

.golangci.next.reference.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4209,10 +4209,6 @@ severity:
42094209
# Default: ""
42104210
default: error
42114211

4212-
# If set to true `severity-rules` regular expressions become case-sensitive.
4213-
# Default: false
4214-
case-sensitive: true
4215-
42164212
# When a list of severity rules are provided, severity information will be added to lint issues.
42174213
# Severity rules have the same filtering capability as exclude rules
42184214
# except you are allowed to specify one matcher per severity rule.

jsonschema/golangci.next.jsonschema.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4384,11 +4384,6 @@
43844384
"type": "string",
43854385
"default": ""
43864386
},
4387-
"case-sensitive": {
4388-
"description": "If set to true, severity-rules regular expressions become case sensitive.",
4389-
"type": "boolean",
4390-
"default": false
4391-
},
43924387
"rules": {
43934388
"description": "When a list of severity rules are provided, severity information will be added to lint issues. Severity rules have the same filtering capability as exclude rules except you are allowed to specify one matcher per severity rule.\nOnly affects out formats that support setting severity information.",
43944389
"type": "array",

pkg/config/severity.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ import (
88
const severityRuleMinConditionsCount = 1
99

1010
type Severity struct {
11-
Default string `mapstructure:"default"`
12-
CaseSensitive bool `mapstructure:"case-sensitive"`
13-
Rules []SeverityRule `mapstructure:"rules"`
11+
Default string `mapstructure:"default"`
12+
Rules []SeverityRule `mapstructure:"rules"`
1413
}
1514

1615
func (s *Severity) Validate() error {

pkg/result/processors/base_rule.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import (
99
"github.com/golangci/golangci-lint/pkg/result"
1010
)
1111

12-
const caseInsensitivePrefix = "(?i)"
13-
1412
type baseRule struct {
1513
text *regexp.Regexp
1614
source *regexp.Regexp

pkg/result/processors/severity.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,7 @@ func NewSeverity(log logutils.Log, files *fsutils.Files, cfg *config.Severity) *
3636
defaultSeverity: cfg.Default,
3737
}
3838

39-
prefix := caseInsensitivePrefix
40-
if cfg.CaseSensitive {
41-
prefix = ""
42-
p.name = "severity-rules-case-sensitive"
43-
}
44-
45-
p.rules = parseRules(cfg.Rules, prefix, newSeverityRule)
39+
p.rules = parseRules(cfg.Rules, "", newSeverityRule)
4640

4741
return p
4842
}

pkg/result/processors/severity_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ func TestSeverity_caseSensitive(t *testing.T) {
278278
},
279279
},
280280
},
281-
CaseSensitive: true,
282281
}
283282

284283
p := NewSeverity(nil, files, opts)

0 commit comments

Comments
 (0)