Skip to content

Commit 9508310

Browse files
author
Gilles Grousset
committed
feat(Rules): rules update
1 parent 71b0de1 commit 9508310

File tree

4 files changed

+72
-2
lines changed

4 files changed

+72
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#### Enhancements
1414

15-
- None.
15+
- Analyzer rules update (7 added)
1616

1717
#### Bug Fixes
1818

dart-lang/src/main/resources/dartanalyzer/analysis_options.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ linter:
22
rules:
33
- abi_specific_integer_invalid
44
- abstract_field_initializer
5+
- argument_must_be_native
56
- argument_type_not_assignable_to_error_handler
67
- body_might_complete_normally
78
- conflicting_constructor_and_static_member
@@ -50,6 +51,12 @@ linter:
5051
- undefined_super_member
5152
- unnecessary_final
5253
- unnecessary_null_comparison
54+
- uri_does_not_exist
55+
- uri_does_not_exist_in_doc_import
5356
- wrong_number_of_parameters_for_setter
5457
- wrong_number_of_type_arguments
5558
- yield_in_non_generator
59+
- literal_only_boolean_expressions
60+
- no_logic_in_create_state
61+
- prefer_const_declarations
62+
- sized_box_shrink_expand

dart-lang/src/main/resources/dartanalyzer/rules.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
"debt": "5min",
1818
"active": true
1919
},
20+
{
21+
"key": "argument_must_be_native",
22+
"name": "Argument must be native",
23+
"severity": "MAJOR",
24+
"description": "The analyzer produces this diagnostic when the argument passed to Native.addressOf isn't annotated with the Native annotation.\n @see https://dart.dev/tools/diagnostic-messages#argument_must_be_native",
25+
"type": "BUG",
26+
"debt": "5min",
27+
"active": true
28+
},
2029
{
2130
"key": "argument_type_not_assignable_to_error_handler",
2231
"name": "Argument type not assignable to error handler",
@@ -449,6 +458,24 @@
449458
"debt": "5min",
450459
"active": true
451460
},
461+
{
462+
"key": "uri_does_not_exist",
463+
"name": "Uri does not exist",
464+
"severity": "BLOCKER",
465+
"description": "The analyzer produces this diagnostic when an import, export, or part directive is found where the URI refers to a file that doesn't exist.\n @see https://dart.dev/tools/diagnostic-messages#uri_does_not_exist",
466+
"type": "BUG",
467+
"debt": "5min",
468+
"active": true
469+
},
470+
{
471+
"key": "uri_does_not_exist_in_doc_import",
472+
"name": "Uri does not exist in doc import",
473+
"severity": "MINOR",
474+
"description": "The analyzer produces this diagnostic when a doc-import is found where the URI refers to a file that doesn't exist.\n @see https://dart.dev/tools/diagnostic-messages#uri_does_not_exist_in_doc_import",
475+
"type": "BUG",
476+
"debt": "5min",
477+
"active": true
478+
},
452479
{
453480
"key": "wrong_number_of_parameters_for_setter",
454481
"name": "Wrong number of parameters for setter",
@@ -475,5 +502,41 @@
475502
"type": "BUG",
476503
"debt": "5min",
477504
"active": true
505+
},
506+
{
507+
"key": "literal_only_boolean_expressions",
508+
"name": "Literal only boolean expressions",
509+
"severity": "MAJOR",
510+
"description": "The analyzer produces this diagnostic when the value of the condition in an if or loop statement is known to be either always true or always false. An exception is made for a while loop whose condition is the Boolean literal true.\n @see https://dart.dev/tools/diagnostic-messages#literal_only_boolean_expressions",
511+
"type": "CODE_SMELL",
512+
"debt": "5min",
513+
"active": true
514+
},
515+
{
516+
"key": "no_logic_in_create_state",
517+
"name": "No logic in create state",
518+
"severity": "MAJOR",
519+
"description": "The analyzer produces this diagnostic when an implementation of createState in a subclass of StatefulWidget contains any logic other than the return of the result of invoking a zero argument constructor.\n @see https://dart.dev/tools/diagnostic-messages#no_logic_in_create_state",
520+
"type": "CODE_SMELL",
521+
"debt": "5min",
522+
"active": true
523+
},
524+
{
525+
"key": "prefer_const_declarations",
526+
"name": "Prefer const declarations",
527+
"severity": "MINOR",
528+
"description": "The analyzer produces this diagnostic when a top-level variable, static field, or local variable is marked as final and is initialized to a constant value.\n @see https://dart.dev/tools/diagnostic-messages#prefer_const_declarations",
529+
"type": "CODE_SMELL",
530+
"debt": "5min",
531+
"active": true
532+
},
533+
{
534+
"key": "sized_box_shrink_expand",
535+
"name": "Sized box shrink expand",
536+
"severity": "MINOR",
537+
"description": "The analyzer produces this diagnostic when a SizedBox constructor invocation specifies the values of both height and width as either 0.0 or double.infinity.\n @see https://dart.dev/tools/diagnostic-messages#sized_box_shrink_expand",
538+
"type": "CODE_SMELL",
539+
"debt": "5min",
540+
"active": true
478541
}
479542
]

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@
258258
<dependency>
259259
<groupId>org.codehaus.groovy</groupId>
260260
<artifactId>groovy-all</artifactId>
261-
<version>3.0.10</version>
261+
<version>3.0.22</version>
262262
<type>pom</type>
263263
</dependency>
264264
<dependency>

0 commit comments

Comments
 (0)