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

Side by Side Diff: pkg/analyzer_cli/lib/src/error_severity.dart

Issue 2840703002: Refactoring analyzer_cli for code hygiene. (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'package:analyzer/error/error.dart'; 5 import 'package:analyzer/error/error.dart';
6 import 'package:analyzer/source/error_processor.dart'; 6 import 'package:analyzer/source/error_processor.dart';
7 import 'package:analyzer/src/error/codes.dart'; 7 import 'package:analyzer/src/error/codes.dart';
8 import 'package:analyzer/src/generated/engine.dart' hide AnalysisResult; 8 import 'package:analyzer/src/generated/engine.dart' hide AnalysisResult;
9 import 'package:analyzer_cli/src/analyzer_options.dart';
9 import 'package:analyzer_cli/src/error_formatter.dart'; 10 import 'package:analyzer_cli/src/error_formatter.dart';
10 import 'package:analyzer_cli/src/options.dart';
11 11
12 /// Check various configuration options to get a desired severity for this 12 /// Check various configuration options to get a desired severity for this
13 /// [error] (or `null` if it's to be suppressed). 13 /// [error] (or `null` if it's to be suppressed).
14 ProcessedSeverity determineProcessedSeverity(AnalysisError error, 14 ProcessedSeverity determineProcessedSeverity(AnalysisError error,
15 CommandLineOptions commandLineOptions, AnalysisOptions analysisOptions) { 15 CommandLineOptions commandLineOptions, AnalysisOptions analysisOptions) {
16 ErrorSeverity severity = computeSeverity(error, commandLineOptions, 16 ErrorSeverity severity = computeSeverity(error, commandLineOptions,
17 analysisOptions: analysisOptions); 17 analysisOptions: analysisOptions);
18 bool isOverridden = false; 18 bool isOverridden = false;
19 19
20 // Skip TODOs categorically (unless escalated to ERROR or HINT.) 20 // Skip TODOs categorically (unless escalated to ERROR or HINT.)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 if (!commandLineOptions.enableTypeChecks && 63 if (!commandLineOptions.enableTypeChecks &&
64 error.errorCode.type == ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR) { 64 error.errorCode.type == ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR) {
65 return ErrorSeverity.INFO; 65 return ErrorSeverity.INFO;
66 } else if (commandLineOptions.hintsAreFatal && error.errorCode is HintCode) { 66 } else if (commandLineOptions.hintsAreFatal && error.errorCode is HintCode) {
67 return ErrorSeverity.ERROR; 67 return ErrorSeverity.ERROR;
68 } else if (commandLineOptions.lintsAreFatal && error.errorCode is LintCode) { 68 } else if (commandLineOptions.lintsAreFatal && error.errorCode is LintCode) {
69 return ErrorSeverity.ERROR; 69 return ErrorSeverity.ERROR;
70 } 70 }
71 return error.errorCode.errorSeverity; 71 return error.errorCode.errorSeverity;
72 } 72 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698