Skip to content

Commit 252bfcb

Browse files
srawlinsCommit Queue
authored and
Commit Queue
committed
Move UNIGNORABLE_IGNORE from HintCode to WarningCode
Work towards #50796 Change-Id: Idb8d04eb07beeb4f201ca69d0543d85305d62ea8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325127 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]> Auto-Submit: Samuel Rawlins <[email protected]>
1 parent df54b81 commit 252bfcb

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,10 +1822,6 @@ HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION:
18221822
HintCode.IMPORT_OF_LEGACY_LIBRARY_INTO_NULL_SAFE:
18231823
status: noFix
18241824
notes: Deprecated
1825-
HintCode.UNIGNORABLE_IGNORE:
1826-
status: needsFix
1827-
notes: |-
1828-
Remove the ignore comment (or one code in the comment).
18291825
HintCode.UNNECESSARY_CAST:
18301826
status: hasFix
18311827
HintCode.UNNECESSARY_IMPORT:
@@ -3727,6 +3723,10 @@ WarningCode.UNDEFINED_REFERENCED_PARAMETER:
37273723
Can try to find the correct parameter name.
37283724
WarningCode.UNDEFINED_SHOWN_NAME:
37293725
status: hasFix
3726+
WarningCode.UNIGNORABLE_IGNORE:
3727+
status: needsFix
3728+
notes: |-
3729+
Remove the ignore comment (or one code in the comment).
37303730
WarningCode.UNNECESSARY_CAST_PATTERN:
37313731
status: needsFix
37323732
notes: |-

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,6 @@ class HintCode extends AnalyzerErrorCode {
128128
hasPublishedDocs: true,
129129
);
130130

131-
/// Parameters:
132-
/// 0: the name of the non-diagnostic being ignored
133-
static const HintCode UNIGNORABLE_IGNORE = HintCode(
134-
'UNIGNORABLE_IGNORE',
135-
"The diagnostic '{0}' can't be ignored.",
136-
correctionMessage:
137-
"Try removing the name from the list, or removing the whole comment if "
138-
"this is the only name in the list.",
139-
);
140-
141131
/// No parameters.
142132
@Deprecated("Use 'WarningCode.UNNECESSARY_CAST' instead.")
143133
static const HintCode UNNECESSARY_CAST = HintCode(

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7092,6 +7092,16 @@ class WarningCode extends AnalyzerErrorCode {
70927092
hasPublishedDocs: true,
70937093
);
70947094

7095+
/// Parameters:
7096+
/// 0: the name of the non-diagnostic being ignored
7097+
static const WarningCode UNIGNORABLE_IGNORE = WarningCode(
7098+
'UNIGNORABLE_IGNORE',
7099+
"The diagnostic '{0}' can't be ignored.",
7100+
correctionMessage:
7101+
"Try removing the name from the list, or removing the whole comment if "
7102+
"this is the only name in the list.",
7103+
);
7104+
70957105
/// This is the new replacement for [HintCode.UNNECESSARY_CAST].
70967106
static const HintCode UNNECESSARY_CAST = HintCode.UNNECESSARY_CAST;
70977107

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,6 @@ const List<ErrorCode> errorCodeValues = [
619619
HintCode.DIVISION_OPTIMIZATION,
620620
HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION,
621621
HintCode.IMPORT_OF_LEGACY_LIBRARY_INTO_NULL_SAFE,
622-
HintCode.UNIGNORABLE_IGNORE,
623622
HintCode.UNNECESSARY_CAST,
624623
HintCode.UNNECESSARY_IMPORT,
625624
HintCode.UNREACHABLE_SWITCH_CASE,
@@ -1047,6 +1046,7 @@ const List<ErrorCode> errorCodeValues = [
10471046
WarningCode.UNDEFINED_HIDDEN_NAME,
10481047
WarningCode.UNDEFINED_REFERENCED_PARAMETER,
10491048
WarningCode.UNDEFINED_SHOWN_NAME,
1049+
WarningCode.UNIGNORABLE_IGNORE,
10501050
WarningCode.UNNECESSARY_CAST_PATTERN,
10511051
WarningCode.UNNECESSARY_FINAL,
10521052
WarningCode.UNNECESSARY_IGNORE,

pkg/analyzer/lib/src/error/ignore_validator.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class IgnoreValidator {
119119
// ignores in the Flutter code base have been cleaned up.
120120
// for (var unignorableName in unignorable) {
121121
// var name = unignorableName.name;
122-
// _errorReporter.reportErrorForOffset(HintCode.UNIGNORABLE_IGNORE,
122+
// _errorReporter.reportErrorForOffset(WarningCode.UNIGNORABLE_IGNORE,
123123
// unignorableName.offset, name.length, [name]);
124124
// list.remove(unignorableName);
125125
// }

pkg/analyzer/messages.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19931,12 +19931,6 @@ HintCode:
1993119931
If you can't migrate the imported library, then the importing library
1993219932
needs to have a language version that is before 2.12, when null safety was
1993319933
enabled by default.
19934-
UNIGNORABLE_IGNORE:
19935-
problemMessage: "The diagnostic '{0}' can't be ignored."
19936-
correctionMessage: Try removing the name from the list, or removing the whole comment if this is the only name in the list.
19937-
comment: |-
19938-
Parameters:
19939-
0: the name of the non-diagnostic being ignored
1994019934
UNNECESSARY_CAST:
1994119935
problemMessage: Unnecessary cast.
1994219936
correctionMessage: Try removing the cast.
@@ -25179,6 +25173,12 @@ WarningCode:
2517925173

2518025174
var x = min(0, 1);
2518125175
```
25176+
UNIGNORABLE_IGNORE:
25177+
problemMessage: "The diagnostic '{0}' can't be ignored."
25178+
correctionMessage: Try removing the name from the list, or removing the whole comment if this is the only name in the list.
25179+
comment: |-
25180+
Parameters:
25181+
0: the name of the non-diagnostic being ignored
2518225182
UNNECESSARY_CAST:
2518325183
aliasFor: HintCode.UNNECESSARY_CAST
2518425184
comment: This is the new replacement for [HintCode.UNNECESSARY_CAST].

0 commit comments

Comments
 (0)