Skip to content

Commit 00a5041

Browse files
srawlinsCommit Queue
authored andcommitted
analyzer: Remove deprecated LintRule.details
Change-Id: Iaca19cddaf09759579bccd2aaee73e731a377638 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391480 Reviewed-by: Phil Quitslund <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]>
1 parent 72644e4 commit 00a5041

File tree

2 files changed

+0
-92
lines changed

2 files changed

+0
-92
lines changed

pkg/analyzer/lib/src/lint/linter.dart

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,6 @@ abstract class LintRule {
204204
/// visiting nodes.
205205
late ErrorReporter _reporter;
206206

207-
/// Description (in markdown format) suitable for display in a detailed lint
208-
/// description.
209-
///
210-
/// This property is deprecated and will be removed in a future release.
211-
@Deprecated('Use .description for a short description and consider placing '
212-
'long-form documentation on an external website.')
213-
final String details;
214-
215207
/// Short description suitable for display in console output.
216208
final String description;
217209

@@ -230,9 +222,6 @@ abstract class LintRule {
230222
@Deprecated('Lint rule categories are no longer used. Remove the argument.')
231223
this.categories = const <String>{},
232224
required this.description,
233-
@Deprecated("Specify 'details' for a short description and consider "
234-
'placing long-form documentation on an external website.')
235-
this.details = '',
236225
State? state,
237226
}) : state = state ?? State.stable();
238227

pkg/linter/test/validate_rule_description_format_test.dart

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,12 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// ignore_for_file: deprecated_member_use
6-
75
import 'package:analyzer/src/lint/registry.dart';
86
import 'package:test/test.dart';
97

108
import 'util/test_utils.dart';
119

1210
void main() {
13-
const keywords = [
14-
'GOOD',
15-
'BAD',
16-
'NOTE',
17-
'DEPRECATED',
18-
'EXCEPTION',
19-
'EXCEPTIONS',
20-
];
21-
2211
group('rule doc format', () {
2312
setUp(setUpSharedTestEnvironment);
2413

@@ -38,75 +27,5 @@ void main() {
3827
});
3928
}
4029
});
41-
42-
group('details - no leading whitespace', () {
43-
for (var rule in rules) {
44-
test('`${rule.name}` details', () {
45-
expect(rule.details.startsWith(RegExp(r'\s+')), isFalse,
46-
reason:
47-
'Rule details for ${rule.name} should not have leading whitespace.');
48-
});
49-
}
50-
});
51-
52-
group('details - bad first', () {
53-
for (var rule in rules) {
54-
test('`${rule.name}` bad example first', () {
55-
var details = rule.details;
56-
var lines = details.split('\n');
57-
var hasGood = false;
58-
for (var line in lines) {
59-
if (line.startsWith('**BAD:**')) {
60-
if (hasGood) {
61-
fail(
62-
'Rule details for ${rule.name} should have the BAD example before the GOOD one.');
63-
}
64-
break;
65-
} else if (line.startsWith('**GOOD:**')) {
66-
hasGood = true;
67-
}
68-
}
69-
});
70-
}
71-
});
72-
73-
group('details - colon inside stars', () {
74-
for (var rule in rules) {
75-
test('`${rule.name}` colon inside stars', () {
76-
var details = rule.details;
77-
var lines = details.split('\n');
78-
79-
for (var line in lines) {
80-
for (var keyword in keywords) {
81-
var withStars = '**$keyword**';
82-
if (line.contains(withStars)) {
83-
fail(
84-
'Rule details for ${rule.name} should have **$keyword:**, put the colon inside the stars.');
85-
}
86-
}
87-
}
88-
});
89-
}
90-
});
91-
92-
group('details - upper case keywords', () {
93-
for (var rule in rules) {
94-
test('`${rule.name}` upper case keywords', () {
95-
var details = rule.details;
96-
var lines = details.split('\n');
97-
98-
for (var line in lines) {
99-
for (var keyword in keywords) {
100-
var withStars = '**$keyword:**';
101-
if (line.toLowerCase().contains(withStars.toLowerCase()) &&
102-
!line.contains(withStars)) {
103-
fail(
104-
'Rule details for ${rule.name} should have $withStars in upper case.');
105-
}
106-
}
107-
}
108-
});
109-
}
110-
});
11130
});
11231
}

0 commit comments

Comments
 (0)