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

Side by Side Diff: pkg/analyzer/lib/src/generated/error.dart

Issue 841813002: Linter analyzer plumbing. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library engine.error; 5 library engine.error;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'ast.dart' show AstNode; 9 import 'ast.dart' show AstNode;
10 import 'element.dart'; 10 import 'element.dart';
(...skipping 2901 matching lines...) Expand 10 before | Expand all | Expand 10 after
2912 */ 2912 */
2913 static const ErrorType ANGULAR = 2913 static const ErrorType ANGULAR =
2914 const ErrorType('ANGULAR', 7, ErrorSeverity.INFO); 2914 const ErrorType('ANGULAR', 7, ErrorSeverity.INFO);
2915 2915
2916 /** 2916 /**
2917 * Polymer specific semantic problems. 2917 * Polymer specific semantic problems.
2918 */ 2918 */
2919 static const ErrorType POLYMER = 2919 static const ErrorType POLYMER =
2920 const ErrorType('POLYMER', 8, ErrorSeverity.INFO); 2920 const ErrorType('POLYMER', 8, ErrorSeverity.INFO);
2921 2921
2922 /**
2923 * Lint warnings describe style and best practice recommendations that can be used to formalize a project's style
2924 * guidelines.
2925 */
2926 static const ErrorType LINT = const ErrorType('LINT', 9, ErrorSeverity.INFO);
2927
2922 static const List<ErrorType> values = const [ 2928 static const List<ErrorType> values = const [
2923 TODO, 2929 TODO,
2924 HINT, 2930 HINT,
2925 COMPILE_TIME_ERROR, 2931 COMPILE_TIME_ERROR,
2926 CHECKED_MODE_COMPILE_TIME_ERROR, 2932 CHECKED_MODE_COMPILE_TIME_ERROR,
2927 STATIC_WARNING, 2933 STATIC_WARNING,
2928 STATIC_TYPE_WARNING, 2934 STATIC_TYPE_WARNING,
2929 SYNTACTIC_ERROR, 2935 SYNTACTIC_ERROR,
2930 ANGULAR, 2936 ANGULAR,
2931 POLYMER]; 2937 POLYMER,
2938 LINT];
2932 2939
2933 /** 2940 /**
2934 * The severity of this type of error. 2941 * The severity of this type of error.
2935 */ 2942 */
2936 final ErrorSeverity severity; 2943 final ErrorSeverity severity;
2937 2944
2938 /** 2945 /**
2939 * Initialize a newly created error type to have the given severity. 2946 * Initialize a newly created error type to have the given severity.
2940 * 2947 *
2941 * @param severity the severity of this type of error 2948 * @param severity the severity of this type of error
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
3311 : super(name, message, correction); 3318 : super(name, message, correction);
3312 3319
3313 @override 3320 @override
3314 ErrorSeverity get errorSeverity => ErrorSeverity.WARNING; 3321 ErrorSeverity get errorSeverity => ErrorSeverity.WARNING;
3315 3322
3316 @override 3323 @override
3317 ErrorType get type => ErrorType.STATIC_WARNING; 3324 ErrorType get type => ErrorType.STATIC_WARNING;
3318 } 3325 }
3319 3326
3320 /** 3327 /**
3328 * Defines style and best practice recommendations.
3329 *
3330 * Unlike [HintCode]s, which are akin to traditional static warnings from a comp iler, lint recommendations focus on
3331 * matters of style and practices that might aggregated to define a project's st yle guide.
3332 */
3333 class LintCode extends ErrorCode {
3334
3335 const LintCode(String name, String message, [String correction])
3336 : super(name, message, correction);
3337
3338 @override
3339 ErrorSeverity get errorSeverity => ErrorSeverity.LINT;
3340
3341 @override
3342 ErrorType get type => ErrorType.LINT;
3343 }
3344
3345 /**
3321 * The enumeration `PolymerCode` defines Polymer specific problems. 3346 * The enumeration `PolymerCode` defines Polymer specific problems.
3322 */ 3347 */
3323 class PolymerCode extends ErrorCode { 3348 class PolymerCode extends ErrorCode {
3324 static const PolymerCode ATTRIBUTE_FIELD_NOT_PUBLISHED = const PolymerCode( 3349 static const PolymerCode ATTRIBUTE_FIELD_NOT_PUBLISHED = const PolymerCode(
3325 'ATTRIBUTE_FIELD_NOT_PUBLISHED', 3350 'ATTRIBUTE_FIELD_NOT_PUBLISHED',
3326 "Field '{0}' in '{1}' must be @published"); 3351 "Field '{0}' in '{1}' must be @published");
3327 3352
3328 static const PolymerCode DUPLICATE_ATTRIBUTE_DEFINITION = const PolymerCode( 3353 static const PolymerCode DUPLICATE_ATTRIBUTE_DEFINITION = const PolymerCode(
3329 'DUPLICATE_ATTRIBUTE_DEFINITION', 3354 'DUPLICATE_ATTRIBUTE_DEFINITION',
3330 "The attribute '{0}' is already defined"); 3355 "The attribute '{0}' is already defined");
(...skipping 1759 matching lines...) Expand 10 before | Expand all | Expand 10 after
5090 * Initialize a newly created error code to have the given [name]. 5115 * Initialize a newly created error code to have the given [name].
5091 */ 5116 */
5092 const TodoCode(String name) : super(name, "{0}"); 5117 const TodoCode(String name) : super(name, "{0}");
5093 5118
5094 @override 5119 @override
5095 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 5120 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
5096 5121
5097 @override 5122 @override
5098 ErrorType get type => ErrorType.TODO; 5123 ErrorType get type => ErrorType.TODO;
5099 } 5124 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698