Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite1d05f7

Browse files
authored
refactor: remove rule enforce-else (#1495)
1 parentfc46c84 commite1d05f7

File tree

6 files changed

+0
-205
lines changed

6 files changed

+0
-205
lines changed

‎README.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,6 @@ List of all available rules. The rules ported from `golint` are left unchanged a
534534
|[`early-return`](./RULES_DESCRIPTIONS.md#early-return)|[]string| Spots if-then-else statements where the predicate may be inverted to reduce nesting| no| no|
535535
|[`empty-block`](./RULES_DESCRIPTIONS.md#empty-block)| n/a| Warns on empty code blocks| no| yes|
536536
|[`empty-lines`](./RULES_DESCRIPTIONS.md#empty-lines)| n/a| Warns when there are heading or trailing newlines in a block| no| no|
537-
|[`enforce-else`](./RULES_DESCRIPTIONS.md#enforce-else)| n/a| Enforces`else` branch at the end of`if...else if` chains.| no| no|
538537
|[`enforce-map-style`](./RULES_DESCRIPTIONS.md#enforce-map-style)| string (defaults to "any")| Enforces consistent usage of`make(map[type]type)` or`map[type]type{}` for map initialization. Does not affect`make(map[type]type, size)` constructions.| no| no|
539538
|[`enforce-repeated-arg-type-style`](./RULES_DESCRIPTIONS.md#enforce-repeated-arg-type-style)| string (defaults to "any")| Enforces consistent style for repeated argument and/or return value types.| no| no|
540539
|[`enforce-slice-style`](./RULES_DESCRIPTIONS.md#enforce-slice-style)| string (defaults to "any")| Enforces consistent usage of`make([]type, 0)` or`[]type{}` for slice initialization. Does not affect`make(map[type]type, non_zero_len, or_non_zero_cap)` constructions.| no| no|

‎RULES_DESCRIPTIONS.md‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ List of all available rules.
2828
-[early-return](#early-return)
2929
-[empty-block](#empty-block)
3030
-[empty-lines](#empty-lines)
31-
-[enforce-else](#enforce-else)
3231
-[enforce-map-style](#enforce-map-style)
3332
-[enforce-repeated-arg-type-style](#enforce-repeated-arg-type-style)
3433
-[enforce-slice-style](#enforce-slice-style)
@@ -451,14 +450,6 @@ this rule warns when there are heading or trailing newlines in code blocks.
451450

452451
_Configuration_: N/A
453452

454-
##enforce-else
455-
456-
_Description_: This rule warns if an`if` statement followed by one or more`else if` statements does not have a final`else` statement.
457-
458-
This is consistent with the requirement to have a`default` clause in a`switch` statement (see[`enforce-switch-style` rule](#enforce-switch-style)).
459-
460-
_Configuration_: N/A
461-
462453
##enforce-map-style
463454

464455
_Description_: This rule enforces consistent usage of`make(map[type]type)` or`map[type]type{}` for map initialization.

‎config/config.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ var allRules = append([]lint.Rule{
106106
&rule.UseFmtPrintRule{},
107107
&rule.EnforceSwitchStyleRule{},
108108
&rule.IdenticalSwitchConditionsRule{},
109-
&rule.EnforceElseRule{},
110109
&rule.IdenticalIfElseIfConditionsRule{},
111110
&rule.IdenticalIfElseIfBranchesRule{},
112111
&rule.IdenticalSwitchBranchesRule{},

‎rule/enforce_else.go‎

Lines changed: 0 additions & 130 deletions
This file was deleted.

‎test/enforce_else_test.go‎

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎testdata/enforce_else.go‎

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp