Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
Bail early in API analysis if no project is set.
Browse files Browse the repository at this point in the history
  • Loading branch information
pq committed Nov 16, 2015
1 parent 83453a4 commit 74e5478
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.1.7

* Fix to `package_api_docs` (dart-lang/sdk#24947; #154).

# 0.1.6

* Fix to `package_prefixed_library_names` (dart-lang/sdk#24947; #154).
Expand Down
5 changes: 5 additions & 0 deletions lib/src/rules/package_api_docs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ class Visitor extends GeneralizingAstVisitor {
DartProject get project => rule.project;

void check(Declaration node) {
// If no project info is set, bail early.
// https://github.com/dart-lang/linter/issues/154
if (project == null) {
return;
}
if (project.isApi(node.element)) {
if (node.documentationComment == null) {
rule.reportLint(getNodeToAnnotate(node));
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: linter
version: 0.1.6
version: 0.1.7
author: Dart Team <[email protected]>
description: Style linter for Dart.
homepage: https://github.com/dart-lang/linter
Expand Down

0 comments on commit 74e5478

Please sign in to comment.