File tree Expand file tree Collapse file tree 6 files changed +78
-1
lines changed
pkg/commands/internal/migrate Expand file tree Collapse file tree 6 files changed +78
-1
lines changed Original file line number Diff line number Diff line change @@ -927,6 +927,10 @@ func convertAlternativeNames(names []string) []string {
927927 var results []string
928928
929929 for _ , name := range names {
930+ if name == "typecheck" {
931+ continue
932+ }
933+
930934 if n , ok := altNames [name ]; ok {
931935 results = append (results , n )
932936 continue
Original file line number Diff line number Diff line change @@ -9,9 +9,14 @@ func toSeverity(old *versionone.Config) versiontwo.Severity {
99 var rules []versiontwo.SeverityRule
1010
1111 for _ , rule := range old .Severity .Rules {
12+ names := convertStaticcheckLinterNames (convertAlternativeNames (rule .Linters ))
13+ if len (rule .Linters ) > 0 && len (names ) == 0 {
14+ continue
15+ }
16+
1217 rules = append (rules , versiontwo.SeverityRule {
1318 BaseRule : versiontwo.BaseRule {
14- Linters : convertStaticcheckLinterNames ( convertAlternativeNames ( rule . Linters )) ,
19+ Linters : names ,
1520 Path : rule .Path ,
1621 PathExcept : rule .PathExcept ,
1722 Text : rule .Text ,
Original file line number Diff line number Diff line change 1+ version : " 2"
Original file line number Diff line number Diff line change 1+ issues :
2+ # Only to not generate unrelated elements inside golden.
3+ exclude-use-default : false
4+ # Only to not generate unrelated elements inside golden.
5+ exclude-generated : strict
6+ # Only to not generate unrelated elements inside golden.
7+ exclude-dirs-use-default : false
8+
9+ exclude-case-sensitive : true
10+
11+ exclude-rules :
12+ - path : _test\.go
13+ linters :
14+ - typecheck
15+
16+ - path-except : _test\.go
17+ linters :
18+ - typecheck
19+
20+ - path : internal/hmac/
21+ text : " weak cryptographic primitive"
22+ linters :
23+ - typecheck
24+
25+ - linters :
26+ - typecheck
27+ text : " SA9003:"
28+
29+ - linters :
30+ - typecheck
31+ source : " foo"
Original file line number Diff line number Diff line change 1+ version : " 2"
Original file line number Diff line number Diff line change 1+ issues :
2+ # Only to not generate unrelated elements inside golden.
3+ exclude-use-default : false
4+ # Only to not generate unrelated elements inside golden.
5+ exclude-generated : strict
6+ # Only to not generate unrelated elements inside golden.
7+ exclude-dirs-use-default : false
8+
9+ severity :
10+ rules :
11+ - path : _test\.go
12+ severity : info
13+ linters :
14+ - typecheck
15+
16+ - path-except : _test\.go
17+ severity : info
18+ linters :
19+ - typecheck
20+
21+ - path : internal/hmac/
22+ severity : info
23+ text : " weak cryptographic primitive"
24+ linters :
25+ - typecheck
26+
27+ - linters :
28+ - typecheck
29+ text : " SA9003:"
30+ severity : info
31+
32+ - linters :
33+ - typecheck
34+ source : " foo"
35+ severity : info
You can’t perform that action at this time.
0 commit comments