disable pubspec linting

Disables the fix in https://dart-review.googlesource.com/c/sdk/+/164249 pending a fix to `sort_pub_dependencies` which is producing a false positive that is blocking the Flutter engine roll.

See: https://github.com/dart-lang/sdk/issues/43529
See: https://github.com/dart-lang/linter/issues/2271

Change-Id: Ica6262153b89259ba67b5a43eeeafe2bdd482b44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166703
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dan Field <dnfield@google.com>
This commit is contained in:
pq 2020-10-08 19:39:55 +00:00 committed by Phil Quitslund
parent 51c6ba0edb
commit c21b906182
2 changed files with 27 additions and 20 deletions

View file

@ -818,26 +818,29 @@ class ContextManagerImpl implements ContextManager {
}
}
}
if (visitors.isNotEmpty) {
var sourceUri = resourceProvider.pathContext.toUri(path);
var pubspecAst = Pubspec.parse(content,
sourceUrl: sourceUri, resourceProvider: resourceProvider);
var listener = RecordingErrorListener();
var reporter = ErrorReporter(listener,
resourceProvider.getFile(path).createSource(sourceUri),
isNonNullableByDefault: false);
for (var entry in visitors.entries) {
entry.key.reporter = reporter;
pubspecAst.accept(entry.value);
}
if (listener.errors.isNotEmpty) {
convertedErrors ??= <protocol.AnalysisError>[];
convertedErrors.addAll(converter.convertAnalysisErrors(
listener.errors,
lineInfo: lineInfo,
options: driver.analysisOptions));
}
}
// todo (pq): re-enable once `sort_pub_dependencies` is fixed
// see: https://github.com/dart-lang/linter/issues/2271
// see: See: https://github.com/dart-lang/sdk/issues/43529
// if (visitors.isNotEmpty) {
// var sourceUri = resourceProvider.pathContext.toUri(path);
// var pubspecAst = Pubspec.parse(content,
// sourceUrl: sourceUri, resourceProvider: resourceProvider);
// var listener = RecordingErrorListener();
// var reporter = ErrorReporter(listener,
// resourceProvider.getFile(path).createSource(sourceUri),
// isNonNullableByDefault: false);
// for (var entry in visitors.entries) {
// entry.key.reporter = reporter;
// pubspecAst.accept(entry.value);
// }
// if (listener.errors.isNotEmpty) {
// convertedErrors ??= <protocol.AnalysisError>[];
// convertedErrors.addAll(converter.convertAnalysisErrors(
// listener.errors,
// lineInfo: lineInfo,
// options: driver.analysisOptions));
// }
// }
}
}
} catch (exception) {

View file

@ -482,6 +482,10 @@ version: 1.3.2
expect(errors, hasLength(0));
}
/// Re-enable once `sort_pub_dependencies` is fixed
/// See: https://github.com/dart-lang/sdk/issues/43529
/// See: https://github.com/dart-lang/linter/issues/2271
@failingTest
Future<void> test_pubspecFile_lint() async {
var optionsPath = join(projectPath, 'analysis_options.yaml');
newFile(optionsPath, content: '''