Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8e44f42

Browse files
stereotype441Commit Queue
authored and
Commit Queue
committed
[messages] Move removedLint.
Moves the `removedLint` constant from the generated file `pkg/linter/lib/src/lint_codes.g.dart` (where it was a static const inside the `LinterLintCode` class) to the handwritten file `pkg/linter/lib/src/diagnostic.dart` (where it is a top level constant), and adjusts usages. This paves the way for a follow-up CL that will remove the generated file `pkg/linter/lib/src/lint_codes.g.dart` entirely. Change-Id: I6a6a69641554f98b19b1e1c4ef488439da21cca5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/461780 Commit-Queue: Paul Berry <paulberry@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
1 parent ddb128b commit 8e44f42

17 files changed

+38
-38
lines changed

‎pkg/linter/lib/src/diagnostic.dart‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,13 @@ import 'analyzer.dart';
66
import 'diagnostic.dart' as diag;
77

88
part 'package:linter/src/diagnostic.g.dart';
9+
10+
/// A lint code that removed lints can specify as their `lintCode`.
11+
///
12+
/// Avoid other usages as it should be made unnecessary and removed.
13+
const LintCode removedLint = LinterLintCode(
14+
name: 'removed_lint',
15+
problemMessage: 'Removed lint.',
16+
expectedTypes: [],
17+
uniqueName: 'LintCode.removed_lint',
18+
);

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,16 +1103,6 @@ class LinterLintCode extends LintCodeWithExpectedTypes {
11031103
static const LinterLintWithoutArguments removeDeprecationsInBreakingVersions =
11041104
diag.removeDeprecationsInBreakingVersions;
11051105

1106-
/// A lint code that removed lints can specify as their `lintCode`.
1107-
///
1108-
/// Avoid other usages as it should be made unnecessary and removed.
1109-
static const LintCode removedLint = LinterLintCode(
1110-
name: 'removed_lint',
1111-
problemMessage: 'Removed lint.',
1112-
expectedTypes: [],
1113-
uniqueName: 'LintCode.removed_lint',
1114-
);
1115-
11161106
/// No parameters.
11171107
static const LinterLintWithoutArguments requireTrailingCommas =
11181108
diag.requireTrailingCommas;

‎pkg/linter/lib/src/rules/always_require_non_null_named_parameters.dart‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:analyzer/analysis_rule/rule_state.dart';
77
import 'package:analyzer/error/error.dart';
88

99
import '../analyzer.dart';
10+
import '../diagnostic.dart' as diag;
1011

1112
const _desc = r'Specify `@required` on named parameters without defaults.';
1213

@@ -19,5 +20,5 @@ class AlwaysRequireNonNullNamedParameters extends AnalysisRule {
1920
);
2021

2122
@override
22-
DiagnosticCode get diagnosticCode => LinterLintCode.removedLint;
23+
DiagnosticCode get diagnosticCode => diag.removedLint;
2324
}

‎pkg/linter/lib/src/rules/avoid_as.dart‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:analyzer/analysis_rule/rule_state.dart';
77
import 'package:analyzer/error/error.dart';
88

99
import '../analyzer.dart';
10+
import '../diagnostic.dart' as diag;
1011

1112
const _desc = r'Avoid using `as`.';
1213

@@ -19,5 +20,5 @@ class AvoidAs extends AnalysisRule {
1920
);
2021

2122
@override
22-
DiagnosticCode get diagnosticCode => LinterLintCode.removedLint;
23+
DiagnosticCode get diagnosticCode => diag.removedLint;
2324
}

‎pkg/linter/lib/src/rules/avoid_returning_null.dart‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:analyzer/analysis_rule/rule_state.dart';
77
import 'package:analyzer/error/error.dart';
88

99
import '../analyzer.dart';
10+
import '../diagnostic.dart' as diag;
1011

1112
const _desc =
1213
r'Avoid returning null from members whose return type is bool, double, int,'
@@ -21,5 +22,5 @@ class AvoidReturningNull extends AnalysisRule {
2122
);
2223

2324
@override
24-
DiagnosticCode get diagnosticCode => LinterLintCode.removedLint;
25+
DiagnosticCode get diagnosticCode => diag.removedLint;
2526
}

‎pkg/linter/lib/src/rules/avoid_returning_null_for_future.dart‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:analyzer/analysis_rule/rule_state.dart';
77
import 'package:analyzer/error/error.dart';
88

99
import '../analyzer.dart';
10+
import '../diagnostic.dart' as diag;
1011

1112
const _desc = r'Avoid returning null for Future.';
1213

@@ -19,5 +20,5 @@ class AvoidReturningNullForFuture extends AnalysisRule {
1920
);
2021

2122
@override
22-
DiagnosticCode get diagnosticCode => LinterLintCode.removedLint;
23+
DiagnosticCode get diagnosticCode => diag.removedLint;
2324
}

‎pkg/linter/lib/src/rules/avoid_unstable_final_fields.dart‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:analyzer/analysis_rule/rule_state.dart';
77
import 'package:analyzer/error/error.dart';
88

99
import '../analyzer.dart';
10+
import '../diagnostic.dart' as diag;
1011

1112
const _desc =
1213
r'Avoid overriding a final field to return '
@@ -21,5 +22,5 @@ class AvoidUnstableFinalFields extends AnalysisRule {
2122
);
2223

2324
@override
24-
DiagnosticCode get diagnosticCode => LinterLintCode.removedLint;
25+
DiagnosticCode get diagnosticCode => diag.removedLint;
2526
}

‎pkg/linter/lib/src/rules/enable_null_safety.dart‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:analyzer/analysis_rule/rule_state.dart';
77
import 'package:analyzer/error/error.dart';
88

99
import '../analyzer.dart';
10+
import '../diagnostic.dart' as diag;
1011

1112
const _desc = r'Do use sound null safety.';
1213

@@ -19,5 +20,5 @@ class EnableNullSafety extends AnalysisRule {
1920
);
2021

2122
@override
22-
DiagnosticCode get diagnosticCode => LinterLintCode.removedLint;
23+
DiagnosticCode get diagnosticCode => diag.removedLint;
2324
}

‎pkg/linter/lib/src/rules/invariant_booleans.dart‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:analyzer/analysis_rule/rule_state.dart';
77
import 'package:analyzer/error/error.dart';
88

99
import '../analyzer.dart';
10+
import '../diagnostic.dart' as diag;
1011

1112
const _desc =
1213
r'Conditions should not unconditionally evaluate to `true` or to `false`.';
@@ -20,5 +21,5 @@ class InvariantBooleans extends AnalysisRule {
2021
);
2122

2223
@override
23-
DiagnosticCode get diagnosticCode => LinterLintCode.removedLint;
24+
DiagnosticCode get diagnosticCode => diag.removedLint;
2425
}

‎pkg/linter/lib/src/rules/iterable_contains_unrelated_type.dart‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:analyzer/analysis_rule/rule_state.dart';
77
import 'package:analyzer/error/error.dart';
88

99
import '../analyzer.dart';
10+
import '../diagnostic.dart' as diag;
1011

1112
const _desc =
1213
r'Invocation of `Iterable<E>.contains` with references of'
@@ -21,5 +22,5 @@ class IterableContainsUnrelatedType extends AnalysisRule {
2122
);
2223

2324
@override
24-
DiagnosticCode get diagnosticCode => LinterLintCode.removedLint;
25+
DiagnosticCode get diagnosticCode => diag.removedLint;
2526
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /