Skip to content

Commit 1c86ca0

Browse files
srawlinsCommit Queue
authored andcommitted
linter: always propagate exceptions
Every caller of analysisOptionsContent passes `propagateLinterExceptions: true`. Good to just simplify. Change-Id: I69d5411a985e58b104086a68c5ba5debc77a9696 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391202 Commit-Queue: Phil Quitslund <[email protected]> Auto-Submit: Samuel Rawlins <[email protected]> Reviewed-by: Phil Quitslund <[email protected]>
1 parent ca8de09 commit 1c86ca0

File tree

2 files changed

+11
-30
lines changed

2 files changed

+11
-30
lines changed

pkg/linter/test/rule_test_support.dart

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,20 @@ export 'package:linter/src/lint_names.dart';
4343
String analysisOptionsContent({
4444
List<String> experiments = const [],
4545
List<String> rules = const [],
46-
bool propagateLinterExceptions = false,
4746
}) {
4847
var buffer = StringBuffer();
4948

50-
if (experiments.isNotEmpty || propagateLinterExceptions) {
51-
buffer.writeln('analyzer:');
52-
buffer.writeln(' enable-experiment:');
53-
for (var experiment in experiments) {
54-
buffer.writeln(' - $experiment');
55-
}
56-
57-
if (propagateLinterExceptions) {
58-
buffer.writeln(' optional-checks:');
59-
buffer.writeln(
60-
' propagate-linter-exceptions: $propagateLinterExceptions',
61-
);
62-
}
49+
buffer.writeln('analyzer:');
50+
buffer.writeln(' enable-experiment:');
51+
for (var experiment in experiments) {
52+
buffer.writeln(' - $experiment');
6353
}
6454

55+
buffer.writeln(' optional-checks:');
56+
buffer.writeln(
57+
' propagate-linter-exceptions: true',
58+
);
59+
6560
buffer.writeln('linter:');
6661
buffer.writeln(' rules:');
6762
for (var rule in rules) {
@@ -140,12 +135,6 @@ class ExpectedLint extends ExpectedDiagnostic {
140135
{Pattern? messageContains})
141136
: super((error) => error.errorCode.name == _lintName, offset, length,
142137
messageContains: messageContains);
143-
144-
ExpectedLint.withLintCode(LintCode lintCode, int offset, int length,
145-
{Pattern? messageContains})
146-
: _lintName = lintCode.uniqueName,
147-
super((error) => error.errorCode == lintCode, offset, length,
148-
messageContains: messageContains);
149138
}
150139

151140
mixin LanguageVersion219Mixin on PubPackageResolutionTest {
@@ -395,11 +384,7 @@ class PubPackageResolutionTest extends _ContextResolutionTest {
395384

396385
newAnalysisOptionsYamlFile(
397386
testPackageRootPath,
398-
analysisOptionsContent(
399-
experiments: experiments,
400-
rules: _lintRules,
401-
propagateLinterExceptions: true,
402-
),
387+
analysisOptionsContent(experiments: experiments, rules: _lintRules),
403388
);
404389
writeTestPackageConfig(
405390
PackageConfigFileBuilder(),

pkg/linter/test/rules/public_member_api_docs_test.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -417,11 +417,7 @@ class PublicMemberApiDocsTestPackageTest extends LintRuleTest {
417417
myPackageRootPath, pubspecYamlContent(name: 'myPackage'));
418418
newAnalysisOptionsYamlFile(
419419
myPackageRootPath,
420-
analysisOptionsContent(
421-
experiments: experiments,
422-
rules: lintRules,
423-
propagateLinterExceptions: true,
424-
),
420+
analysisOptionsContent(experiments: experiments, rules: lintRules),
425421
);
426422
newFolder(fixturePackageLibPath);
427423
writePackageConfig(

0 commit comments

Comments
 (0)