Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: pkg/analyzer/lib/src/task/options.dart

Issue 2654043003: add warning for deprecated .analysis_options file name (Closed)
Patch Set: merge Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/task/options.dart
diff --git a/pkg/analyzer/lib/src/task/options.dart b/pkg/analyzer/lib/src/task/options.dart
index 050d3bce27f8843cf8cde03cf5f6bde82a5fa1f5..c23b71e1aeab74fb0a8221e291a5f747bf2169ee 100644
--- a/pkg/analyzer/lib/src/task/options.dart
+++ b/pkg/analyzer/lib/src/task/options.dart
@@ -238,6 +238,18 @@ class GenerateOptionsErrorsTask extends SourceBasedAnalysisTask {
Source initialSource = source;
SourceSpan initialIncludeSpan;
+ // Suggest user rename deprecated .analysis_options file
+ String fullName = target?.source?.fullName;
+ if (fullName != null &&
+ fullName.endsWith(AnalysisEngine.ANALYSIS_OPTIONS_FILE)) {
+ errors.add(new AnalysisError(
+ source,
+ 0, // offset
+ 1, // length
+ AnalysisOptionsWarningCode.DEPRECATED_ANALYSIS_OPTIONS_FILE_NAME,
+ [fullName]));
+ }
+
// Validate the specified options and any included option files
void validate(Source source, Map<String, YamlNode> options) {
List<AnalysisError> validationErrors =
« no previous file with comments | « pkg/analyzer/lib/src/analysis_options/error/option_codes.dart ('k') | pkg/analyzer/test/src/task/options_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698