Skip to content

Commit 10f5f15

Browse files
stereotype441Commit Queue
authored andcommitted
[messages] Rename LinterLintCode.internal
Removes the deprecated `LinterLintCode` constructor, and renames `LinterLintCode.internal` to `LinterLintCode`. In https://dart-review.googlesource.com/c/sdk/+/459140, `LinterLintCode` was renamed to `LinterLintCode.internal`, but the old `LinterLintCode` constructor was left around because there were still some references to it in google3. This allowed the signature of `LinterLintCode.internal` to be evolved without introducing breakages. Now that google3 code no longer uses the `LinterLintCode` constructor, we can remove it and rename `LinterLintCode.internal` back to `LinterLintCode`. Change-Id: I6a6a6964bb9cd5d129612446cd1f035cd0f6a75e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/459201 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Paul Berry <paulberry@google.com>
1 parent 5ba9507 commit 10f5f15

File tree

3 files changed

+10
-40
lines changed

3 files changed

+10
-40
lines changed

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

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2659,7 +2659,7 @@ class LinterLintCode extends LintCodeWithExpectedTypes {
26592659
/// A lint code that removed lints can specify as their `lintCode`.
26602660
///
26612661
/// Avoid other usages as it should be made unnecessary and removed.
2662-
static const LintCode removedLint = LinterLintCode.internal(
2662+
static const LintCode removedLint = LinterLintCode(
26632663
name: 'removed_lint',
26642664
problemMessage: 'Removed lint.',
26652665
expectedTypes: [],
@@ -3740,21 +3740,7 @@ class LinterLintCode extends LintCodeWithExpectedTypes {
37403740
expectedTypes: [],
37413741
);
37423742

3743-
@Deprecated('Please use LintCode instead')
3744-
const LinterLintCode(
3745-
String name,
3746-
String problemMessage, {
3747-
super.expectedTypes,
3748-
super.correctionMessage,
3749-
super.hasPublishedDocs,
3750-
String? uniqueName,
3751-
}) : super(
3752-
name: name,
3753-
problemMessage: problemMessage,
3754-
uniqueName: 'LintCode.${uniqueName ?? name}',
3755-
);
3756-
3757-
const LinterLintCode.internal({
3743+
const LinterLintCode({
37583744
required super.name,
37593745
required super.problemMessage,
37603746
required super.uniqueName,
@@ -4419,7 +4405,7 @@ final class LinterLintTemplate<T extends Function> extends LinterLintCode
44194405
required super.uniqueName,
44204406
super.correctionMessage,
44214407
super.hasPublishedDocs = false,
4422-
}) : super.internal();
4408+
});
44234409
}
44244410

44254411
final class LinterLintWithoutArguments extends LinterLintCode
@@ -4432,5 +4418,5 @@ final class LinterLintWithoutArguments extends LinterLintCode
44324418
required super.uniqueName,
44334419
super.correctionMessage,
44344420
super.hasPublishedDocs = false,
4435-
}) : super.internal();
4421+
});
44364422
}

pkg/linter/test/lint_code_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ void main() {
2727
});
2828
}
2929

30-
const LintCode _customCode = LinterLintCode.internal(
30+
const LintCode _customCode = LinterLintCode(
3131
name: 'hash_and_equals',
3232
problemMessage: 'Override `==` if overriding `hashCode`.',
3333
correctionMessage: 'Implement `==`.',
3434
expectedTypes: [],
3535
uniqueName: 'LintCode.hash_and_equals',
3636
);
3737

38-
const LintCode _customCodeWithDocs = LinterLintCode.internal(
38+
const LintCode _customCodeWithDocs = LinterLintCode(
3939
name: 'hash_and_equals',
4040
problemMessage: 'Override `==` if overriding `hashCode`.',
4141
correctionMessage: 'Implement `==`.',

pkg/linter/tool/generate_lints.dart

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class LinterLintCode extends LintCodeWithExpectedTypes {
6363
/// A lint code that removed lints can specify as their `lintCode`.
6464
///
6565
/// Avoid other usages as it should be made unnecessary and removed.
66-
static const LintCode $removedLintName = LinterLintCode.internal(
66+
static const LintCode $removedLintName = LinterLintCode(
6767
name: 'removed_lint',
6868
problemMessage: 'Removed lint.',
6969
expectedTypes: [],
@@ -72,23 +72,7 @@ class LinterLintCode extends LintCodeWithExpectedTypes {
7272
''';
7373

7474
memberAccumulator.constructors[''] = '''
75-
@Deprecated('Please use LintCode instead')
76-
const LinterLintCode(
77-
String name,
78-
String problemMessage, {
79-
super.expectedTypes,
80-
super.correctionMessage,
81-
super.hasPublishedDocs,
82-
String? uniqueName,
83-
}) : super(
84-
name: name,
85-
problemMessage: problemMessage,
86-
uniqueName: 'LintCode.\${uniqueName ?? name}',
87-
);
88-
''';
89-
90-
memberAccumulator.constructors['internal'] = '''
91-
const LinterLintCode.internal({
75+
const LinterLintCode({
9276
required super.name,
9377
required super.problemMessage,
9478
required super.uniqueName,
@@ -126,7 +110,7 @@ final class LinterLintTemplate<T extends Function> extends LinterLintCode
126110
required super.uniqueName,
127111
super.correctionMessage,
128112
super.hasPublishedDocs = false,
129-
}) : super.internal();
113+
});
130114
}
131115
132116
final class LinterLintWithoutArguments extends LinterLintCode
@@ -139,7 +123,7 @@ final class LinterLintWithoutArguments extends LinterLintCode
139123
required super.uniqueName,
140124
super.correctionMessage,
141125
super.hasPublishedDocs = false,
142-
}) : super.internal();
126+
});
143127
}
144128
''');
145129
return out.toString();

0 commit comments

Comments
 (0)