Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Commit 13fb583

Browse files
fix: temporary remove enums support (#849)
* fix: temporary remove enums support * test: update tests Co-authored-by: Dmitry Krutskikh <dmitry.krutskikh@gmail.com>
1 parent 7b09a55 commit 13fb583

File tree

4 files changed

+6
-18
lines changed

4 files changed

+6
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* fix: [`avoid-border-all`](https://dartcodemetrics.dev/docs/rules/flutter/avoid-border-all) is triggered even when it is not a const.
66
* fix: remove duplicated and ignore void function calls for [`prefer-moving-to-variable`](https://dartcodemetrics.dev/docs/rules/common/prefer-moving-to-variable).
7+
* fix: temporary remove enums support for [`prefer-trailing-comma`](https://dartcodemetrics.dev/docs/rules/common/prefer-trailing-comma).
78

89
## 4.15.1
910

lib/src/analyzers/lint_analyzer/rules/rules_list/prefer_trailing_comma/visitor.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ class _Visitor extends RecursiveAstVisitor<void> {
2828
);
2929
}
3030

31-
@override
32-
void visitEnumDeclaration(EnumDeclaration node) {
33-
super.visitEnumDeclaration(node);
34-
35-
_visitNodeList(node.constants, node.leftBracket, node.rightBracket);
36-
}
37-
3831
@override
3932
void visitListLiteral(ListLiteral node) {
4033
super.visitListLiteral(node);

test/src/analyzers/lint_analyzer/rules/rules_list/prefer_trailing_comma/examples/incorrect_example.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ enum FirstEnum {
3535
thirdItem,
3636
forthItem,
3737
fifthItem,
38-
sixthItem // LINT
38+
sixthItem
3939
}
4040

4141
class FirstClass {

test/src/analyzers/lint_analyzer/rules/rules_list/prefer_trailing_comma/prefer_trailing_comma_rule_test.dart

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,15 @@ void main() {
3030

3131
RuleTestHelper.verifyIssues(
3232
issues: issues,
33-
startLines: [3, 9, 13, 18, 24, 28, 38, 49, 58, 64, 70],
34-
startColumns: [50, 7, 5, 52, 9, 8, 3, 59, 3, 3, 3],
33+
startLines: [3, 9, 13, 18, 24, 28, 49, 58, 64, 70],
34+
startColumns: [50, 7, 5, 52, 9, 8, 59, 3, 3, 3],
3535
locationTexts: [
3636
'String thirdArgument',
3737
"'and another string for length exceed'",
3838
'String arg3',
3939
'String thirdArgument',
4040
"'and another string for length exceed'",
4141
"'some other string'",
42-
'sixthItem',
4342
'this.forthField',
4443
"'and another string for length exceed'",
4544
"'and another string for length exceed'",
@@ -56,7 +55,6 @@ void main() {
5655
'Prefer trailing comma.',
5756
'Prefer trailing comma.',
5857
'Prefer trailing comma.',
59-
'Prefer trailing comma.',
6058
],
6159
replacementComments: [
6260
'Add trailing comma.',
@@ -69,7 +67,6 @@ void main() {
6967
'Add trailing comma.',
7068
'Add trailing comma.',
7169
'Add trailing comma.',
72-
'Add trailing comma.',
7370
],
7471
replacements: [
7572
'String thirdArgument,',
@@ -78,7 +75,6 @@ void main() {
7875
'String thirdArgument,',
7976
"'and another string for length exceed',",
8077
"'some other string',",
81-
'sixthItem,',
8278
'this.forthField,',
8379
"'and another string for length exceed',",
8480
"'and another string for length exceed',",
@@ -102,8 +98,8 @@ void main() {
10298

10399
RuleTestHelper.verifyIssues(
104100
issues: issues,
105-
startLines: [9, 17, 19, 37, 41, 75, 91, 99, 109, 119],
106-
startColumns: [21, 33, 20, 23, 19, 18, 43, 21, 19, 19],
101+
startLines: [9, 17, 19, 37, 41, 91, 99, 109, 119],
102+
startColumns: [21, 33, 20, 23, 19, 43, 21, 19, 19],
107103
locationTexts: [
108104
'String arg1',
109105
'void Function() callback',
@@ -114,7 +110,6 @@ void main() {
114110
'() {\n'
115111
' return;\n'
116112
' }',
117-
'firstItem',
118113
'0',
119114
'\'some string\'',
120115
'\'some string\'',
@@ -130,7 +125,6 @@ void main() {
130125
'Prefer trailing comma.',
131126
'Prefer trailing comma.',
132127
'Prefer trailing comma.',
133-
'Prefer trailing comma.',
134128
],
135129
);
136130
});

0 commit comments

Comments
 (0)