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

Unified Diff: tool/rule.dart

Issue 1407283008: Verify type annotations on public APIs (#24). (Closed) Base URL: https://github.com/dart-lang/linter.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « test/rules/type_annotate_public_apis.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/rule.dart
diff --git a/tool/rule.dart b/tool/rule.dart
index 216a711e4afb4e82591b6a7d1c788c42afaa4b0c..f309fa08fe326de90d6bfd1fa27600708b8e916b 100644
--- a/tool/rule.dart
+++ b/tool/rule.dart
@@ -83,7 +83,7 @@ ${parser.usage}
String toClassName(String libName) =>
libName.split('_').map((bit) => capitalize(bit)).join();
-String _generateStub(String libName, String className) => '''
+String _generateStub(String libName, String className) => """
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -96,27 +96,40 @@ import 'package:linter/src/linter.dart';
const desc = r' ';
-const details = r' ';
+const details = r'''
+
+**DO** ...
+
+**BAD:**
+```
+
+```
+
+**GOOD:**
+```
+
+```
+
+''';
class $className extends LintRule {
$className() : super(
name: '$libName',
- description: desc,
- details: details,
- group: Group.STYLE_GUIDE,
- kind: Kind.AVOID);
+ description: desc,
+ details: details,
+ group: Group.style);
@override
AstVisitor getVisitor() => new Visitor(this);
}
class Visitor extends SimpleAstVisitor {
- LintRule rule;
+ final LintRule rule;
Visitor(this.rule);
}
-''';
+""";
String _generateTest(String libName, String className) => '''
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
« no previous file with comments | « test/rules/type_annotate_public_apis.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698