Skip to content

Commit

Permalink
Move UNIGNORABLE_IGNORE from HintCode to WarningCode
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
srawlins authored and Commit Queue committed Sep 12, 2023
1 parent df54b81 commit 252bfcb
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1822,10 +1822,6 @@ HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION:
HintCode.IMPORT_OF_LEGACY_LIBRARY_INTO_NULL_SAFE:
status: noFix
notes: Deprecated
HintCode.UNIGNORABLE_IGNORE:
status: needsFix
notes: |-
Remove the ignore comment (or one code in the comment).
HintCode.UNNECESSARY_CAST:
status: hasFix
HintCode.UNNECESSARY_IMPORT:
Expand Down Expand Up @@ -3727,6 +3723,10 @@ WarningCode.UNDEFINED_REFERENCED_PARAMETER:
Can try to find the correct parameter name.
WarningCode.UNDEFINED_SHOWN_NAME:
status: hasFix
WarningCode.UNIGNORABLE_IGNORE:
status: needsFix
notes: |-
Remove the ignore comment (or one code in the comment).
WarningCode.UNNECESSARY_CAST_PATTERN:
status: needsFix
notes: |-
Expand Down
10 changes: 0 additions & 10 deletions pkg/analyzer/lib/src/dart/error/hint_codes.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,6 @@ class HintCode extends AnalyzerErrorCode {
hasPublishedDocs: true,
);

/// Parameters:
/// 0: the name of the non-diagnostic being ignored
static const HintCode UNIGNORABLE_IGNORE = HintCode(
'UNIGNORABLE_IGNORE',
"The diagnostic '{0}' can't be ignored.",
correctionMessage:
"Try removing the name from the list, or removing the whole comment if "
"this is the only name in the list.",
);

/// No parameters.
@Deprecated("Use 'WarningCode.UNNECESSARY_CAST' instead.")
static const HintCode UNNECESSARY_CAST = HintCode(
Expand Down
10 changes: 10 additions & 0 deletions pkg/analyzer/lib/src/error/codes.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7092,6 +7092,16 @@ class WarningCode extends AnalyzerErrorCode {
hasPublishedDocs: true,
);

/// Parameters:
/// 0: the name of the non-diagnostic being ignored
static const WarningCode UNIGNORABLE_IGNORE = WarningCode(
'UNIGNORABLE_IGNORE',
"The diagnostic '{0}' can't be ignored.",
correctionMessage:
"Try removing the name from the list, or removing the whole comment if "
"this is the only name in the list.",
);

/// This is the new replacement for [HintCode.UNNECESSARY_CAST].
static const HintCode UNNECESSARY_CAST = HintCode.UNNECESSARY_CAST;

Expand Down
2 changes: 1 addition & 1 deletion pkg/analyzer/lib/src/error/error_code_values.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,6 @@ const List<ErrorCode> errorCodeValues = [
HintCode.DIVISION_OPTIMIZATION,
HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION,
HintCode.IMPORT_OF_LEGACY_LIBRARY_INTO_NULL_SAFE,
HintCode.UNIGNORABLE_IGNORE,
HintCode.UNNECESSARY_CAST,
HintCode.UNNECESSARY_IMPORT,
HintCode.UNREACHABLE_SWITCH_CASE,
Expand Down Expand Up @@ -1047,6 +1046,7 @@ const List<ErrorCode> errorCodeValues = [
WarningCode.UNDEFINED_HIDDEN_NAME,
WarningCode.UNDEFINED_REFERENCED_PARAMETER,
WarningCode.UNDEFINED_SHOWN_NAME,
WarningCode.UNIGNORABLE_IGNORE,
WarningCode.UNNECESSARY_CAST_PATTERN,
WarningCode.UNNECESSARY_FINAL,
WarningCode.UNNECESSARY_IGNORE,
Expand Down
2 changes: 1 addition & 1 deletion pkg/analyzer/lib/src/error/ignore_validator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class IgnoreValidator {
// ignores in the Flutter code base have been cleaned up.
// for (var unignorableName in unignorable) {
// var name = unignorableName.name;
// _errorReporter.reportErrorForOffset(HintCode.UNIGNORABLE_IGNORE,
// _errorReporter.reportErrorForOffset(WarningCode.UNIGNORABLE_IGNORE,
// unignorableName.offset, name.length, [name]);
// list.remove(unignorableName);
// }
Expand Down
12 changes: 6 additions & 6 deletions pkg/analyzer/messages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19931,12 +19931,6 @@ HintCode:
If you can't migrate the imported library, then the importing library
needs to have a language version that is before 2.12, when null safety was
enabled by default.
UNIGNORABLE_IGNORE:
problemMessage: "The diagnostic '{0}' can't be ignored."
correctionMessage: Try removing the name from the list, or removing the whole comment if this is the only name in the list.
comment: |-
Parameters:
0: the name of the non-diagnostic being ignored
UNNECESSARY_CAST:
problemMessage: Unnecessary cast.
correctionMessage: Try removing the cast.
Expand Down Expand Up @@ -25179,6 +25173,12 @@ WarningCode:

var x = min(0, 1);
```
UNIGNORABLE_IGNORE:
problemMessage: "The diagnostic '{0}' can't be ignored."
correctionMessage: Try removing the name from the list, or removing the whole comment if this is the only name in the list.
comment: |-
Parameters:
0: the name of the non-diagnostic being ignored
UNNECESSARY_CAST:
aliasFor: HintCode.UNNECESSARY_CAST
comment: This is the new replacement for [HintCode.UNNECESSARY_CAST].
Expand Down

0 comments on commit 252bfcb

Please sign in to comment.