Skip to content

Commit 2e13d4d

Browse files
parloughCommit Queue
authored andcommitted
[linter] Doc and changelog updates
Change-Id: I64554034fc510afdab1c3e1dab18a3855fd31b09 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406782 Commit-Queue: Marya Belanger <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Reviewed-by: Samuel Rawlins <[email protected]> Auto-Submit: Parker Lougheed <[email protected]>
1 parent 0d03fb8 commit 2e13d4d

File tree

6 files changed

+68
-31
lines changed

6 files changed

+68
-31
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010

1111
### Tools
1212

13+
#### Analyzer
14+
15+
- Added the experimental [`unnecessary_ignore`][] lint rule.
16+
17+
[`unnecessary_ignore`]: http://dart.dev/lints/unnecessary_ignore
18+
1319
#### Dart Development Compiler (dartdevc)
1420

1521
In order to align with dart2js semantics, DDC will now throw a runtime error
@@ -94,7 +100,7 @@ main() {
94100
- Code completion now suggests instance variables when completing inside the
95101
initializer of a _late_ field.
96102
- Assists and quick fixes that add a const keyword now consider the
97-
`prefer_const_declarations` lint rule, prefering to add `const` to a variable
103+
`prefer_const_declarations` lint rule, preferring to add `const` to a variable
98104
declaration rather than the initial value.
99105
- Add a fix to add a missing `on` keyword in an extension declaration.
100106
- Add a fix to wrap an ambiguous property access or method call in an extension
@@ -109,6 +115,7 @@ main() {
109115
- Add the [`unnecessary_underscores`][] lint rule.
110116
- Add the experimental [`specify_nonobvious_property_types`][] lint rule.
111117
- Add the experimental [`omit_obvious_property_types`][] lint rule.
118+
- Add the experimental [`unnecessary_async`][] lint rule.
112119
- Add the experimental [`unsafe_variance`][] lint rule.
113120
- Remove the [`package_api_docs`][] lint rule.
114121
- Remove the [`unsafe_html`][] lint rule.
@@ -117,6 +124,7 @@ main() {
117124
[`unnecessary_underscores`]: https://dart.dev/lints/unnecessary_underscores
118125
[`specify_nonobvious_property_types`]: https://dart.dev/tools/linter-rules/specify_nonobvious_property_types
119126
[`omit_obvious_property_types`]: https://dart.dev/tools/linter-rules/omit_obvious_property_types
127+
[`unnecessary_async`]: http://dart.dev/lints/unnecessary_async
120128
[`unsafe_variance`]: https://dart.dev/tools/linter-rules/unsafe_variance
121129
[`package_api_docs`]: https://dart.dev/tools/linter-rules/package_api_docs
122130
[`unsafe_html`]: https://dart.dev/tools/linter-rules/unsafe_html

pkg/analyzer/messages.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24346,7 +24346,7 @@ WarningCode:
2434624346
The analyzer produces this diagnostic when a comment that appears to be an
2434724347
attempt to specify a language version override doesn't conform to the
2434824348
requirements for such a comment. For more information, see
24349-
[Per-library language version selection](https://dart.dev/guides/language/evolution#per-library-language-version-selection).
24349+
[Per-library language version selection](https://dart.dev/resources/language/evolution#per-library-language-version-selection).
2435024350

2435124351
#### Example
2435224352

pkg/analyzer/tool/diagnostics/diagnostics.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10469,7 +10469,7 @@ directive._
1046910469
The analyzer produces this diagnostic when a comment that appears to be an
1047010470
attempt to specify a language version override doesn't conform to the
1047110471
requirements for such a comment. For more information, see
10472-
[Per-library language version selection](https://dart.dev/guides/language/evolution#per-library-language-version-selection).
10472+
[Per-library language version selection](https://dart.dev/resources/language/evolution#per-library-language-version-selection).
1047310473

1047410474
#### Example
1047510475

@@ -28699,12 +28699,13 @@ ignored._
2869928699

2870028700
#### Description
2870128701

28702-
The analyzer produces this diagnostic when an ignore is specified to ignore a diagnostic that isn't produced.
28702+
The analyzer produces this diagnostic when an ignore is specified to
28703+
ignore a diagnostic that isn't produced.
2870328704

2870428705
#### Example
2870528706

28706-
The following code produces this diagnostic because the `unused_local_variable`
28707-
diagnostic isn't reported at the ignored location:
28707+
The following code produces this diagnostic because the
28708+
`unused_local_variable` diagnostic isn't reported at the ignored location:
2870828709

2870928710
```dart
2871028711
// ignore: [!unused_local_variable!]

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,6 +1641,7 @@ class LinterLintCode extends LintCode {
16411641
"The diagnostic '{0}' isn't produced at this location so it doesn't need "
16421642
"to be ignored.",
16431643
correctionMessage: "Try removing the ignore comment.",
1644+
hasPublishedDocs: true,
16441645
uniqueName: 'unnecessary_ignore',
16451646
);
16461647

pkg/linter/messages.yaml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@ LintCode:
12541254
12551255
**This rule is experimental.** It is being evaluated, and it may be changed
12561256
or removed. Feedback on its behavior is welcome! The main issue is here:
1257-
https://github.com/dart-lang/linter/issues/4622
1257+
https://github.com/dart-lang/sdk/issues/59232.
12581258
avoid_implementing_value_types:
12591259
problemMessage: "Classes that override '==' should not be implemented."
12601260
correctionMessage: "Try removing the class from the 'implements' clause."
@@ -2903,7 +2903,7 @@ LintCode:
29032903
**Known limitations**
29042904
29052905
This rule does not track all patterns of StreamSubscription instantiations and
2906-
cancellations. See [linter#317](https://github.com/dart-lang/linter/issues/317)
2906+
cancellations. See [linter#317](https://github.com/dart-lang/sdk/issues/57387)
29072907
for more information.
29082908
cascade_invocations:
29092909
problemMessage: "Unnecessary duplication of receiver."
@@ -3066,7 +3066,7 @@ LintCode:
30663066
**Known limitations**
30673067
30683068
This rule does not track all patterns of Sink instantiations and
3069-
closures. See [linter#1381](https://github.com/dart-lang/linter/issues/1381)
3069+
closures. See [sdk#57882](https://github.com/dart-lang/sdk/issues/57882)
30703070
for more information.
30713071
collection_methods_unrelated_type:
30723072
problemMessage: "The argument type '{0}' isn't related to '{1}'."
@@ -3248,7 +3248,7 @@ LintCode:
32483248
comment references, which is occasionally distinct from Dartdoc's notion of
32493249
comment references. The lint rule may report comment references which Dartdoc
32503250
can resolve, even though the analyzer cannot. See
3251-
[linter#1142](https://github.com/dart-lang/linter/issues/1142) for more
3251+
[sdk#57783](https://github.com/dart-lang/sdk/issues/57783) for more
32523252
information.
32533253
conditional_uri_does_not_exist:
32543254
problemMessage: "The target of the conditional URI '{0}' doesn't exist."
@@ -7173,7 +7173,7 @@ LintCode:
71737173
71747174
**This rule is experimental.** It is being evaluated, and it may be changed
71757175
or removed. Feedback on its behavior is welcome! The main issue is here:
7176-
https://github.com/dart-lang/linter/issues/3480.
7176+
https://github.com/dart-lang/sdk/issues/58773.
71777177
omit_obvious_property_types:
71787178
problemMessage: "The type annotation isn't needed because it is obvious."
71797179
correctionMessage: "Try removing the type annotation."
@@ -7224,7 +7224,7 @@ LintCode:
72247224
72257225
**This rule is experimental.** It is being evaluated, and it may be changed
72267226
or removed. Feedback on its behavior is welcome! The main issue is here:
7227-
https://github.com/dart-lang/linter/issues/5101.
7227+
https://github.com/dart-lang/sdk/issues/59550.
72287228
one_member_abstracts:
72297229
problemMessage: "Unnecessary use of an abstract class."
72307230
correctionMessage: "Try making '{0}' a top-level function and removing the class."
@@ -10793,7 +10793,7 @@ LintCode:
1079310793
1079410794
**This rule is experimental.** It is being evaluated, and it may be changed
1079510795
or removed. Feedback on its behavior is welcome! The main issue is here:
10796-
https://github.com/dart-lang/linter/issues/3480.
10796+
https://github.com/dart-lang/sdk/issues/58773.
1079710797
specify_nonobvious_property_types:
1079810798
problemMessage: "A type annotation is needed because it isn't obvious."
1079910799
correctionMessage: "Try adding a type annotation."
@@ -10863,14 +10863,15 @@ LintCode:
1086310863
1086410864
**This rule is experimental.** It is being evaluated, and it may be changed
1086510865
or removed. Feedback on its behavior is welcome! The main issue is here:
10866-
https://github.com/dart-lang/linter/issues/5101.
10866+
https://github.com/dart-lang/sdk/issues/59550.
1086710867
strict_top_level_inference_add_type:
1086810868
sharedName: strict_top_level_inference
1086910869
problemMessage: "Missing type annotation."
1087010870
correctionMessage: "Try adding a type annotation."
1087110871
state:
1087210872
stable: "3.7"
1087310873
categories: [style]
10874+
hasPublishedDocs: false
1087410875
deprecatedDetails: |-
1087510876
Do type annotate top-level and class-like member declarations, where types
1087610877
are not inferred from super-interfaces or initializers.
@@ -10913,7 +10914,6 @@ LintCode:
1091310914
}
1091410915
int _sq(int v) => v * v;
1091510916
```
10916-
hasPublishedDocs: false
1091710917
strict_top_level_inference_replace_keyword:
1091810918
sharedName: strict_top_level_inference
1091910919
problemMessage: "Missing type annotation."
@@ -11630,7 +11630,7 @@ LintCode:
1163011630
/// The type [List<int>]
1163111631
/// `<assignment> -> <variable> = <expression>`
1163211632
/// \<assignment\> -> \<variable\> = \<expression\>`
11633-
/// <http://foo.bar.baz>
11633+
/// <https://example.com/example>
1163411634
```
1163511635
unnecessary_async:
1163611636
problemMessage: "Don't make a function 'async' if it doesn't use 'await'."
@@ -11792,7 +11792,7 @@ LintCode:
1179211792
```
1179311793
1179411794
NOTE: This lint only reports unnecessary breaks in libraries with a
11795-
[language version](https://dart.dev/guides/language/evolution#language-versioning)
11795+
[language version](https://dart.dev/resources/language/evolution#language-versioning)
1179611796
of 3.0 or greater. Explicit breaks are still required in Dart 2.19 and below.
1179711797
unnecessary_const:
1179811798
problemMessage: "Unnecessary 'const' keyword."
@@ -12061,16 +12061,17 @@ LintCode:
1206112061
state:
1206212062
experimental: "3.8"
1206312063
categories: [style]
12064-
hasPublishedDocs: false
12064+
hasPublishedDocs: true
1206512065
documentation: |-
1206612066
#### Description
1206712067
12068-
The analyzer produces this diagnostic when an ignore is specified to ignore a diagnostic that isn't produced.
12068+
The analyzer produces this diagnostic when an ignore is specified to
12069+
ignore a diagnostic that isn't produced.
1206912070
1207012071
#### Example
1207112072
12072-
The following code produces this diagnostic because the `unused_local_variable`
12073-
diagnostic isn't reported at the ignored location:
12073+
The following code produces this diagnostic because the
12074+
`unused_local_variable` diagnostic isn't reported at the ignored location:
1207412075
1207512076
```dart
1207612077
// ignore: [!unused_local_variable!]

0 commit comments

Comments
 (0)