Skip to content

Commit 7073a83

Browse files
srawlinsCommit Queue
authored andcommitted
linter: remove unused ignoreSyntheticNodes parameter
This parameter was used once in one lint rule, and otherwise seems like it was designed for testing, but does not need to be used in either place. Change-Id: I95af78a1c69c945b467ed3cb51e9e3a7d7c81491 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423902 Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Johnni Winther <[email protected]> Reviewed-by: Erik Ernst <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 6156dd6 commit 7073a83

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,8 @@ abstract class LintRule {
256256
List<Object> arguments = const [],
257257
List<DiagnosticMessage>? contextMessages,
258258
ErrorCode? errorCode,
259-
bool ignoreSyntheticNodes = true,
260259
}) {
261-
if (node != null && (!node.isSynthetic || !ignoreSyntheticNodes)) {
260+
if (node != null && !node.isSynthetic) {
262261
reporter.atNode(
263262
node,
264263
errorCode ?? lintCode,
@@ -289,9 +288,8 @@ abstract class LintRule {
289288
List<Object> arguments = const [],
290289
List<DiagnosticMessage>? contextMessages,
291290
ErrorCode? errorCode,
292-
bool ignoreSyntheticTokens = true,
293291
}) {
294-
if (token != null && (!token.isSynthetic || !ignoreSyntheticTokens)) {
292+
if (token != null && !token.isSynthetic) {
295293
reporter.atToken(
296294
token,
297295
errorCode ?? lintCode,

pkg/analyzer/test/src/lint/lint_rule_test.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ main() {
2727
rule.reporter = reporter;
2828

2929
rule.reportLintForToken(
30-
Token.eof(0),
30+
SimpleToken(TokenType.SEMICOLON, 0),
3131
errorCode: customCode,
32-
ignoreSyntheticTokens: false,
3332
);
3433
expect(reporter.code, customCode);
3534
});
@@ -41,7 +40,7 @@ main() {
4140
);
4241
rule.reporter = reporter;
4342

44-
rule.reportLintForToken(Token.eof(0), ignoreSyntheticTokens: false);
43+
rule.reportLintForToken(SimpleToken(TokenType.SEMICOLON, 0));
4544
expect(reporter.code, rule.lintCode);
4645
});
4746
test('reportLint (custom)', () {

pkg/linter/lib/src/rules/specify_nonobvious_local_variable_types.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class _Visitor extends SimpleAstVisitor<void> {
7979
if (iterable.hasObviousType) {
8080
return;
8181
}
82-
rule.reportLint(loopParts.loopVariable, ignoreSyntheticNodes: false);
82+
rule.reportLint(loopParts.loopVariable);
8383
}
8484
}
8585

0 commit comments

Comments
 (0)