Skip to content

Commit 1159405

Browse files
aamCommit Queue
authored andcommitted
Revert "[DAS] Trigger incompatible lint for included rules"
This reverts commit 261f819 Reason for revert: it breaks flutter customer testing on hh and on the roller. Original change's description: > [DAS] Trigger incompatible lint for included rules > > Fixes: #60125 > Change-Id: Icc0b8efda0e7e915d7315a1c2e70c1a7a5093057 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/419982 > Auto-Submit: Felipe Morschel <[email protected]> > Reviewed-by: Samuel Rawlins <[email protected]> > Commit-Queue: Konstantin Shcheglov <[email protected]> > Reviewed-by: Brian Wilkerson <[email protected]> > Reviewed-by: Konstantin Shcheglov <[email protected]> Change-Id: I0db90864092760efde1cb02cc792c1de14eabf2d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429381 Reviewed-by: Samuel Rawlins <[email protected]> Commit-Queue: Alexander Aprelev <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]> Bot-Commit: Rubber Stamper <[email protected]> Reviewed-by: Siva Annamalai <[email protected]>
1 parent dabee62 commit 1159405

File tree

16 files changed

+78
-498
lines changed

16 files changed

+78
-498
lines changed

pkg/analysis_server/lib/src/context_manager.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,6 @@ class ContextManagerImpl implements ContextManager {
403403
driver.sourceFactory,
404404
driver.currentSession.analysisContext.contextRoot.root.path,
405405
sdkVersionConstraint,
406-
resourceProvider,
407406
);
408407
var converter = AnalyzerConverter();
409408
convertedErrors = converter.convertAnalysisErrors(

pkg/analysis_server/lib/src/handler/legacy/edit_get_fixes.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ class EditGetFixesHandler extends LegacyHandler
133133
sourceFactory,
134134
analysisContext.contextRoot.root.path,
135135
sdkVersionConstraint,
136-
resourceProvider,
137136
);
138137
var options = _getOptions(sourceFactory, content);
139138
if (options == null) {

pkg/analysis_server/lib/src/lsp/handlers/code_actions/analysis_options.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ class AnalysisOptionsCodeActionsProducer extends AbstractCodeActionsProducer {
8787
sourceFactory,
8888
contextRoot.root.path,
8989
sdkVersionConstraint,
90-
resourceProvider,
9190
);
9291

9392
var codeActions = <CodeActionWithPriority>[];

pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,21 +85,11 @@ AnalysisOptionsWarningCode.INCLUDED_FILE_WARNING:
8585
status: noFix
8686
notes: |-
8787
The fix needs to be made in the included file.
88-
AnalysisOptionsWarningCode.INCOMPATIBLE_INCLUDED_LINT:
89-
status: noFix
90-
notes: |-
91-
Without knowing which rule the user would prefer to use, we cannot remove
92-
the reported one.
9388
AnalysisOptionsWarningCode.INCOMPATIBLE_LINT:
9489
status: noFix
9590
notes: |-
9691
Without knowing which rule the user would prefer to use, we cannot remove
9792
the reported one.
98-
AnalysisOptionsWarningCode.INCOMPATIBLE_LINT_FILE:
99-
status: noFix
100-
notes: |-
101-
Without knowing which rule the user would prefer to use, we cannot remove
102-
the reported one.
10393
AnalysisOptionsWarningCode.INVALID_OPTION:
10494
status: needsFix
10595
notes: |-

pkg/analysis_server/test/services/linter/linter_test.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import 'package:analyzer/source/source.dart';
99
import 'package:analyzer/src/analysis_options/analysis_options_provider.dart';
1010
import 'package:analyzer/src/analysis_options/error/option_codes.dart';
1111
import 'package:analyzer/src/lint/options_rule_validator.dart';
12-
import 'package:analyzer_testing/resource_provider_mixin.dart';
1312
import 'package:linter/src/rules.dart';
1413
import 'package:test/test.dart';
1514
import 'package:test_reflective_loader/test_reflective_loader.dart';
@@ -21,17 +20,14 @@ void main() {
2120
}
2221

2322
@reflectiveTest
24-
class LinterRuleOptionsValidatorTest with ResourceProviderMixin {
23+
class LinterRuleOptionsValidatorTest {
2524
late RecordingErrorListener recorder;
2625

2726
late ErrorReporter reporter;
2827

2928
List<Diagnostic> get errors => recorder.errors;
3029

31-
LinterRuleOptionsValidator get validator => LinterRuleOptionsValidator(
32-
optionsProvider: AnalysisOptionsProvider(),
33-
resourceProvider: resourceProvider,
34-
);
30+
LinterRuleOptionsValidator get validator => LinterRuleOptionsValidator();
3531

3632
void setUp() {
3733
registerLintRules();

pkg/analysis_server/test/src/services/correction/fix/analysis_options/test_support.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class AnalysisOptionsFixTest with ResourceProviderMixin {
5252
sourceFactory,
5353
'/',
5454
dart2_12,
55-
resourceProvider,
5655
);
5756
if (diagnosticFilter != null) {
5857
if (errors.length == 1) {

pkg/analyzer/lib/src/analysis_options/error/option_codes.g.dart

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -149,22 +149,6 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
149149
"The include file '{0}' in '{1}' can't be found when analyzing '{2}'.",
150150
);
151151

152-
/// An error code indicating an incompatible rule.
153-
///
154-
/// Parameters:
155-
/// 0: the rule name
156-
/// 1: the incompatible rule
157-
static const AnalysisOptionsWarningCode
158-
INCOMPATIBLE_INCLUDED_LINT = AnalysisOptionsWarningCode(
159-
'INCOMPATIBLE_LINT',
160-
"This file enables '{0}' that is incompatible with '{1}' enabled in "
161-
"another include.",
162-
correctionMessage:
163-
"Try removing one of the incompatible files or locally disable one of "
164-
"the conflicting rules.",
165-
uniqueName: 'INCOMPATIBLE_INCLUDED_LINT',
166-
);
167-
168152
/// An error code indicating an incompatible rule.
169153
///
170154
/// Parameters:
@@ -177,22 +161,6 @@ class AnalysisOptionsWarningCode extends DiagnosticCode {
177161
correctionMessage: "Try removing one of the incompatible rules.",
178162
);
179163

180-
/// An error code indicating an incompatible rule.
181-
///
182-
/// Parameters:
183-
/// 0: the rule name
184-
/// 1: the incompatible rule
185-
/// 2: the path of the file containing the conflicting rule
186-
static const AnalysisOptionsWarningCode
187-
INCOMPATIBLE_LINT_FILE = AnalysisOptionsWarningCode(
188-
'INCOMPATIBLE_LINT',
189-
"The rule '{0}' is incompatible with the rule '{1}' enabled at '{2}'.",
190-
correctionMessage:
191-
"Try removing the incompatible rule or locally disable the conflicting "
192-
"rule.",
193-
uniqueName: 'INCOMPATIBLE_LINT_FILE',
194-
);
195-
196164
/// An error code indicating that a plugin is being configured with an invalid
197165
/// value for an option and a detail message is provided.
198166
///

pkg/analyzer/lib/src/diagnostic/diagnostic_factory.dart

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import 'package:analyzer/source/source.dart';
1111
import 'package:analyzer/src/dart/ast/ast.dart';
1212
import 'package:analyzer/src/diagnostic/diagnostic.dart';
1313
import 'package:analyzer/src/error/codes.dart';
14-
import 'package:yaml/yaml.dart';
1514

1615
/// A factory used to create diagnostics.
1716
class DiagnosticFactory {
@@ -284,29 +283,6 @@ class DiagnosticFactory {
284283
);
285284
}
286285

287-
Diagnostic incompatibleIncludedLint({
288-
required Source source,
289-
required String referenceRule,
290-
required String incompatibleRule,
291-
required YamlNode reference,
292-
required YamlNode incompatible,
293-
}) => Diagnostic.tmp(
294-
source: source,
295-
offset: incompatible.span.start.offset,
296-
length: incompatible.span.end.offset,
297-
errorCode: AnalysisOptionsWarningCode.INCOMPATIBLE_INCLUDED_LINT,
298-
arguments: [referenceRule, incompatibleRule],
299-
contextMessages: [
300-
DiagnosticMessageImpl(
301-
filePath: source.fullName,
302-
length: reference.span.length,
303-
message: 'The included file with the reference rule.',
304-
offset: reference.span.start.offset,
305-
url: source.uri.toString(),
306-
),
307-
],
308-
);
309-
310286
Diagnostic invalidNullAwareAfterShortCircuit(
311287
Source source,
312288
int offset,

pkg/analyzer/lib/src/error/error_code_values.g.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ const List<DiagnosticCode> errorCodeValues = [
3434
AnalysisOptionsWarningCode.DUPLICATE_RULE,
3535
AnalysisOptionsWarningCode.INCLUDED_FILE_WARNING,
3636
AnalysisOptionsWarningCode.INCLUDE_FILE_NOT_FOUND,
37-
AnalysisOptionsWarningCode.INCOMPATIBLE_INCLUDED_LINT,
3837
AnalysisOptionsWarningCode.INCOMPATIBLE_LINT,
39-
AnalysisOptionsWarningCode.INCOMPATIBLE_LINT_FILE,
4038
AnalysisOptionsWarningCode.INVALID_OPTION,
4139
AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT,
4240
AnalysisOptionsWarningCode.MULTIPLE_PLUGINS,

0 commit comments

Comments
 (0)