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

Side by Side Diff: pkg/polymer/lib/src/linter.dart

Issue 23757034: Rearranges the polymer package now that the old compiler is gone. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /** 5 /**
6 * Logic to validate that developers are correctly using Polymer constructs. 6 * Logic to validate that developers are correctly using Polymer constructs.
7 * This is mainly used to produce warnings for feedback in the editor. 7 * This is mainly used to produce warnings for feedback in the editor.
8 */ 8 */
9 library polymer.src.linter; 9 library polymer.src.linter;
10 10
11 import 'dart:io'; 11 import 'dart:io';
12 import 'dart:async'; 12 import 'dart:async';
13 import 'dart:mirrors'; 13 import 'dart:mirrors';
14 import 'dart:convert' show JSON; 14 import 'dart:convert' show JSON;
15 15
16 import 'package:barback/barback.dart'; 16 import 'package:barback/barback.dart';
17 import 'package:html5lib/dom.dart'; 17 import 'package:html5lib/dom.dart';
18 import 'package:html5lib/dom_parsing.dart'; 18 import 'package:html5lib/dom_parsing.dart';
19 19
20 import 'transform/common.dart'; 20 import 'common.dart';
21 21
22 typedef String MessageFormatter(String kind, String message, Span span); 22 typedef String MessageFormatter(String kind, String message, Span span);
23 23
24 /** 24 /**
25 * A linter that checks for common Polymer errors and produces warnings to 25 * A linter that checks for common Polymer errors and produces warnings to
26 * show on the editor or the command line. Leaves sources unchanged, but creates 26 * show on the editor or the command line. Leaves sources unchanged, but creates
27 * a new asset containing all the warnings. 27 * a new asset containing all the warnings.
28 */ 28 */
29 class Linter extends Transformer with PolymerTransformer { 29 class Linter extends Transformer with PolymerTransformer {
30 final TransformOptions options; 30 final TransformOptions options;
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 * <https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custom/index.html#dfn -custom-element-name> 435 * <https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custom/index.html#dfn -custom-element-name>
436 */ 436 */
437 bool _isCustomTag(String name) { 437 bool _isCustomTag(String name) {
438 if (name == null || !name.contains('-')) return false; 438 if (name == null || !name.contains('-')) return false;
439 return !_invalidTagNames.containsKey(name); 439 return !_invalidTagNames.containsKey(name);
440 } 440 }
441 441
442 final String _RED_COLOR = '\u001b[31m'; 442 final String _RED_COLOR = '\u001b[31m';
443 final String _MAGENTA_COLOR = '\u001b[35m'; 443 final String _MAGENTA_COLOR = '\u001b[35m';
444 final String _NO_COLOR = '\u001b[0m'; 444 final String _NO_COLOR = '\u001b[0m';
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698