Skip to content

Commit 2b8c0ee

Browse files
parloughCommit Queue
authored andcommitted
[analyzer] Mark latest diagnostic docs as published
Change-Id: I288dcf8c997819bc2e48bf7b4479c37dcba35485 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/419681 Reviewed-by: Phil Quitslund <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Auto-Submit: Parker Lougheed <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]>
1 parent 5e62d29 commit 2b8c0ee

File tree

5 files changed

+48
-27
lines changed

5 files changed

+48
-27
lines changed

pkg/analyzer/lib/src/error/codes.g.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7049,6 +7049,7 @@ class WarningCode extends ErrorCode {
70497049
"Using multiple 'hide' or 'show' combinators is never necessary and often "
70507050
"produces surprising results.",
70517051
correctionMessage: "Try using a single combinator.",
7052+
hasPublishedDocs: true,
70527053
);
70537054

70547055
/// Generates a warning for classes that inherit from classes annotated with

pkg/analyzer/messages.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27707,7 +27707,7 @@ WarningCode:
2770727707
MULTIPLE_COMBINATORS:
2770827708
problemMessage: "Using multiple 'hide' or 'show' combinators is never necessary and often produces surprising results."
2770927709
correctionMessage: "Try using a single combinator."
27710-
hasPublishedDocs: false
27710+
hasPublishedDocs: true
2771127711
comment: No parameters.
2771227712
documentation: |-
2771327713
#### Description
@@ -27726,17 +27726,17 @@ WarningCode:
2772627726
var x = Future.value(1);
2772727727
```
2772827728

27729-
The following code produces this diagnostic because the second `hide` combinator
27730-
is redundant:
27729+
The following code produces this diagnostic because
27730+
the second `hide` combinator is redundant:
2773127731

2773227732
```dart
2773327733
import 'dart:math' [!hide Random, max, min hide min!];
2773427734

2773527735
var x = pi;
2773627736
```
2773727737

27738-
The following codes produce this diagnostic because the `hide` combinator
27739-
is redundant:
27738+
The following codes produce this diagnostic because
27739+
the `hide` combinator is redundant:
2774027740

2774127741
```dart
2774227742
import 'dart:math' [!show Random, max hide min!];
@@ -27745,8 +27745,9 @@ WarningCode:
2774527745
var r = Random();
2774627746
```
2774727747

27748-
The following code produces this diagnostic because the `show` combinator
27749-
already hides `Random` and `max`, so the `hide` combinator is redundant:
27748+
The following code produces this diagnostic because
27749+
the `show` combinator already hides `Random` and `max`,
27750+
so the `hide` combinator is redundant:
2775027751

2775127752
```dart
2775227753
import 'dart:math' [!hide Random, max show min!];
@@ -27756,15 +27757,17 @@ WarningCode:
2775627757

2775727758
#### Common fixes
2775827759

27759-
If you prefer to list the names that should be visible, then use a single `show` combinator:
27760+
If you prefer to list the names that should be visible,
27761+
then use a single `show` combinator:
2776027762

2776127763
```dart
2776227764
import 'dart:math' show min;
2776327765

2776427766
var x = min(0, 1);
2776527767
```
2776627768

27767-
If you prefer to list the names that should be hidden, then use a single `hide` combinator:
27769+
If you prefer to list the names that should be hidden,
27770+
then use a single `hide` combinator:
2776827771

2776927772
```dart
2777027773
import 'dart:math' hide Random, max, min;

pkg/linter/lib/src/lint_codes.g.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ class LinterLintCode extends LintCode {
159159
LintNames.avoid_dynamic_calls,
160160
"Method invocation or property access on a 'dynamic' target.",
161161
correctionMessage: "Try giving the target a type.",
162+
hasPublishedDocs: true,
162163
);
163164

164165
static const LintCode avoid_empty_else = LinterLintCode(
@@ -568,6 +569,7 @@ class LinterLintCode extends LintCode {
568569
"The public property isn't described by either 'debugFillProperties' or "
569570
"'debugDescribeChildren'.",
570571
correctionMessage: "Try describing the property.",
572+
hasPublishedDocs: true,
571573
);
572574

573575
static const LintCode directives_ordering_alphabetical = LinterLintCode(
@@ -872,6 +874,7 @@ class LinterLintCode extends LintCode {
872874
LintNames.missing_whitespace_between_adjacent_strings,
873875
"Missing whitespace between adjacent strings.",
874876
correctionMessage: "Try adding whitespace between the strings.",
877+
hasPublishedDocs: true,
875878
);
876879

877880
static const LintCode no_adjacent_strings_in_list = LinterLintCode(
@@ -1006,6 +1009,7 @@ class LinterLintCode extends LintCode {
10061009
"Don't throw instances of classes that don't extend either 'Exception' or "
10071010
"'Error'.",
10081011
correctionMessage: "Try throwing a different class of object.",
1012+
hasPublishedDocs: true,
10091013
);
10101014

10111015
static const LintCode overridden_fields = LinterLintCode(
@@ -1051,12 +1055,14 @@ class LinterLintCode extends LintCode {
10511055
LintNames.prefer_asserts_in_initializer_lists,
10521056
"Assert should be in the initializer list.",
10531057
correctionMessage: "Try moving the assert to the initializer list.",
1058+
hasPublishedDocs: true,
10541059
);
10551060

10561061
static const LintCode prefer_asserts_with_message = LinterLintCode(
10571062
LintNames.prefer_asserts_with_message,
10581063
"Missing a message in an assert.",
10591064
correctionMessage: "Try adding a message to the assert.",
1065+
hasPublishedDocs: true,
10601066
);
10611067

10621068
static const LintCode prefer_collection_literals = LinterLintCode(
@@ -1111,6 +1117,7 @@ class LinterLintCode extends LintCode {
11111117
LintNames.prefer_constructors_over_static_methods,
11121118
"Static method should be a constructor.",
11131119
correctionMessage: "Try converting the method into a constructor.",
1120+
hasPublishedDocs: true,
11141121
);
11151122

11161123
static const LintCode prefer_contains_always_false = LinterLintCode(
@@ -1145,6 +1152,7 @@ class LinterLintCode extends LintCode {
11451152
LintNames.prefer_expression_function_bodies,
11461153
"Unnecessary use of a block function body.",
11471154
correctionMessage: "Try using an expression function body.",
1155+
hasPublishedDocs: true,
11481156
);
11491157

11501158
static const LintCode prefer_final_fields = LinterLintCode(
@@ -1158,6 +1166,7 @@ class LinterLintCode extends LintCode {
11581166
LintNames.prefer_final_in_for_each,
11591167
"The pattern should be final.",
11601168
correctionMessage: "Try making the pattern final.",
1169+
hasPublishedDocs: true,
11611170
uniqueName: 'prefer_final_in_for_each_pattern',
11621171
);
11631172

@@ -1172,12 +1181,14 @@ class LinterLintCode extends LintCode {
11721181
LintNames.prefer_final_locals,
11731182
"Local variables should be final.",
11741183
correctionMessage: "Try making the variable final.",
1184+
hasPublishedDocs: true,
11751185
);
11761186

11771187
static const LintCode prefer_final_parameters = LinterLintCode(
11781188
LintNames.prefer_final_parameters,
11791189
"The parameter '{0}' should be final.",
11801190
correctionMessage: "Try making the parameter final.",
1191+
hasPublishedDocs: true,
11811192
);
11821193

11831194
static const LintCode prefer_for_elements_to_map_fromIterable =
@@ -1194,6 +1205,7 @@ class LinterLintCode extends LintCode {
11941205
"Use 'forEach' rather than a 'for' loop to apply a function to every "
11951206
"element.",
11961207
correctionMessage: "Try using 'forEach' rather than a 'for' loop.",
1208+
hasPublishedDocs: true,
11971209
);
11981210

11991211
static const LintCode
@@ -1402,6 +1414,7 @@ class LinterLintCode extends LintCode {
14021414
LintNames.public_member_api_docs,
14031415
"Missing documentation for a public member.",
14041416
correctionMessage: "Try adding documentation for the member.",
1417+
hasPublishedDocs: true,
14051418
);
14061419

14071420
static const LintCode recursive_getters = LinterLintCode(
@@ -1535,12 +1548,14 @@ class LinterLintCode extends LintCode {
15351548
"Use a type annotation rather than 'assert' to enforce non-nullability.",
15361549
correctionMessage:
15371550
"Try adding a type annotation and removing the 'assert'.",
1551+
hasPublishedDocs: true,
15381552
);
15391553

15401554
static const LintCode type_annotate_public_apis = LinterLintCode(
15411555
LintNames.type_annotate_public_apis,
15421556
"Missing type annotation on a public API.",
15431557
correctionMessage: "Try adding a type annotation.",
1558+
hasPublishedDocs: true,
15441559
);
15451560

15461561
static const LintCode type_init_formals = LinterLintCode(
@@ -1716,12 +1731,14 @@ class LinterLintCode extends LintCode {
17161731
"Unnecessary use of a null-aware operator to invoke an extension method on "
17171732
"a nullable type.",
17181733
correctionMessage: "Try removing the '?'.",
1734+
hasPublishedDocs: true,
17191735
);
17201736

17211737
static const LintCode unnecessary_null_checks = LinterLintCode(
17221738
LintNames.unnecessary_null_checks,
17231739
"Unnecessary use of a null check ('!').",
17241740
correctionMessage: "Try removing the null check.",
1741+
hasPublishedDocs: true,
17251742
);
17261743

17271744
static const LintCode unnecessary_null_in_if_null_operators = LinterLintCode(

pkg/linter/messages.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ LintCode:
765765
experimental: "2.12"
766766
stable: "2.14"
767767
categories: [binarySize, errorProne]
768-
hasPublishedDocs: false
768+
hasPublishedDocs: true
769769
documentation: |-
770770
#### Description
771771
@@ -3870,7 +3870,7 @@ LintCode:
38703870
state:
38713871
stable: "2.3"
38723872
categories: [errorProne, flutter]
3873-
hasPublishedDocs: false
3873+
hasPublishedDocs: true
38743874
documentation: |-
38753875
#### Description
38763876
@@ -6199,7 +6199,7 @@ LintCode:
61996199
state:
62006200
stable: "2.8"
62016201
categories: [errorProne]
6202-
hasPublishedDocs: false
6202+
hasPublishedDocs: true
62036203
documentation: |-
62046204
#### Description
62056205
@@ -7365,7 +7365,7 @@ LintCode:
73657365
state:
73667366
stable: "2.0"
73677367
categories: [style]
7368-
hasPublishedDocs: false
7368+
hasPublishedDocs: true
73697369
documentation: |-
73707370
#### Description
73717371
@@ -7830,7 +7830,7 @@ LintCode:
78307830
state:
78317831
stable: "2.0"
78327832
categories: [style]
7833-
hasPublishedDocs: false
7833+
hasPublishedDocs: true
78347834
documentation: |-
78357835
#### Description
78367836
@@ -7884,7 +7884,7 @@ LintCode:
78847884
state:
78857885
stable: "2.3"
78867886
categories: [style]
7887-
hasPublishedDocs: false
7887+
hasPublishedDocs: true
78887888
documentation: |-
78897889
#### Description
78907890
@@ -8444,7 +8444,7 @@ LintCode:
84448444
state:
84458445
stable: "2.0"
84468446
categories: [style]
8447-
hasPublishedDocs: false
8447+
hasPublishedDocs: true
84488448
documentation: |-
84498449
#### Description
84508450
@@ -8661,7 +8661,7 @@ LintCode:
86618661
state:
86628662
stable: "2.0"
86638663
categories: [brevity, style]
8664-
hasPublishedDocs: false
8664+
hasPublishedDocs: true
86658665
documentation: |-
86668666
#### Description
86678667
@@ -8840,7 +8840,7 @@ LintCode:
88408840
state:
88418841
stable: "2.1"
88428842
categories: [style]
8843-
hasPublishedDocs: false
8843+
hasPublishedDocs: true
88448844
documentation: |-
88458845
#### Description
88468846
@@ -8912,7 +8912,7 @@ LintCode:
89128912
state:
89138913
stable: "2.0"
89148914
categories: [style]
8915-
hasPublishedDocs: false
8915+
hasPublishedDocs: true
89168916
documentation: |-
89178917
#### Description
89188918
@@ -8980,7 +8980,7 @@ LintCode:
89808980
state:
89818981
stable: "2.14"
89828982
categories: [style]
8983-
hasPublishedDocs: false
8983+
hasPublishedDocs: true
89848984
documentation: |-
89858985
#### Description
89868986
@@ -9137,7 +9137,7 @@ LintCode:
91379137
experimental: "2.0"
91389138
stable: "2.2"
91399139
categories: [style]
9140-
hasPublishedDocs: false
9140+
hasPublishedDocs: true
91419141
documentation: |-
91429142
#### Description
91439143
@@ -10335,7 +10335,7 @@ LintCode:
1033510335
state:
1033610336
stable: "2.0"
1033710337
categories: [publicInterface, style]
10338-
hasPublishedDocs: false
10338+
hasPublishedDocs: true
1033910339
documentation: |-
1034010340
#### Description
1034110341
@@ -11521,7 +11521,7 @@ LintCode:
1152111521
state:
1152211522
stable: "2.12"
1152311523
categories: [style]
11524-
hasPublishedDocs: false
11524+
hasPublishedDocs: true
1152511525
documentation: |-
1152611526
#### Description
1152711527
@@ -11591,7 +11591,7 @@ LintCode:
1159111591
state:
1159211592
stable: "2.0"
1159311593
categories: [effectiveDart, publicInterface]
11594-
hasPublishedDocs: false
11594+
hasPublishedDocs: true
1159511595
documentation: |-
1159611596
#### Description
1159711597
@@ -12867,7 +12867,7 @@ LintCode:
1286712867
state:
1286812868
stable: "2.18"
1286912869
categories: [style]
12870-
hasPublishedDocs: false
12870+
hasPublishedDocs: true
1287112871
documentation: |-
1287212872
#### Description
1287312873
@@ -12926,7 +12926,7 @@ LintCode:
1292612926
state:
1292712927
experimental: "2.12"
1292812928
categories: [brevity, style]
12929-
hasPublishedDocs: false
12929+
hasPublishedDocs: true
1293012930
documentation: |-
1293112931
#### Description
1293212932

pkg/linter/tool/machine/rules.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@
953953
},
954954
{
955955
"name": "discarded_futures",
956-
"description": "Don't invoke asynchronous functions in non-`async` blocks.",
956+
"description": "There should be no `Future`-returning calls in synchronous functions unless they are assigned or returned.",
957957
"categories": [
958958
"errorProne"
959959
],

0 commit comments

Comments
 (0)