Skip to content

Commit b73cca9

Browse files
authored
change: merge code-style with style categories (#1573)
* change: merge code-style with style categories * deprecate variable
1 parent 010d7b2 commit b73cca9

File tree

6 files changed

+7
-5
lines changed

6 files changed

+7
-5
lines changed

‎lint/failure.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const (
1111
// FailureCategoryBadPractice indicates bad practice issues.
1212
FailureCategoryBadPractice FailureCategory = "bad practice"
1313
// FailureCategoryCodeStyle indicates code style issues.
14+
//
15+
// Deprecated: use FailureCategoryStyle instead.
1416
FailureCategoryCodeStyle FailureCategory = "code-style"
1517
// FailureCategoryComments indicates comment issues.
1618
FailureCategoryComments FailureCategory = "comments"

‎rule/file_length_limit.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (r *FileLengthLimitRule) Apply(file *lint.File, _ lint.Arguments) []lint.Fa
5757

5858
return []lint.Failure{
5959
{
60-
Category: lint.FailureCategoryCodeStyle,
60+
Category: lint.FailureCategoryStyle,
6161
Confidence: 1,
6262
Position: lint.FailurePosition{
6363
Start: token.Position{

‎rule/inefficient_map_lookup.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func (w *lintInefficientMapLookup) analyzeBlock(b *ast.BlockStmt) {
9999
w.onFailure(lint.Failure{
100100
Confidence: 1,
101101
Node: rangeOverMap,
102-
Category: lint.FailureCategoryCodeStyle,
102+
Category: lint.FailureCategoryStyle,
103103
Failure: "inefficient lookup of map key",
104104
})
105105
}

‎rule/line_length_limit.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (r lintLineLengthNum) check() {
7676
c := utf8.RuneCountInString(t)
7777
if c > r.max {
7878
r.onFailure(lint.Failure{
79-
Category: lint.FailureCategoryCodeStyle,
79+
Category: lint.FailureCategoryStyle,
8080
Position: lint.FailurePosition{
8181
// Offset not set; it is non-trivial, and doesn't appear to be needed.
8282
Start: token.Position{

‎rule/use_waitgroup_go.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func (w *lintUseWaitGroupGo) analyzeBlock(b *ast.BlockStmt) {
113113
w.onFailure(lint.Failure{
114114
Confidence: 1,
115115
Node: call,
116-
Category: lint.FailureCategoryCodeStyle,
116+
Category: lint.FailureCategoryStyle,
117117
Failure: "replace wg.Add()...go {...wg.Done()...} with wg.Go(...)",
118118
})
119119

‎rule/useless_fallthrough.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (w *lintUselessFallthrough) Visit(node ast.Node) ast.Visitor {
8181
w.onFailure(lint.Failure{
8282
Confidence: confidence,
8383
Node: branchStmt,
84-
Category: lint.FailureCategoryCodeStyle,
84+
Category: lint.FailureCategoryStyle,
8585
Failure: `this "fallthrough" can be removed by consolidating this case clause with the next one`,
8686
})
8787

0 commit comments

Comments
 (0)