Skip to content

Commit

Permalink
Linter de-linting.
Browse files Browse the repository at this point in the history
A pass through with the linter shakes out a few offenders.

Nothing like a little dogfood! ;)

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1988933002 .
  • Loading branch information
pq committed May 17, 2016
1 parent 0480c2c commit 601f7f9
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 16 deletions.
5 changes: 2 additions & 3 deletions .analysis_options
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
analyzer:
strong-mode: true
exclude:
- test/_data/p4/lib/lib1.dart
- test/_data/p5/p5.dart
- test/_data/**
- test/rules/**
linter:
rules:
- annotate_overrides

2 changes: 1 addition & 1 deletion lib/src/analysis.dart
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class DriverOptions {

/// If non-null, the function to use to run pub list. This is used to mock
/// out executions of pub list when testing the linter.
RunPubList runPubList = null;
RunPubList runPubList;

/// Whether to show SDK warnings.
bool showSdkWarnings = false;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/pub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:source_span/source_span.dart';
import 'package:yaml/yaml.dart';

PSEntry _findEntry(YamlMap map, String key) {
PSEntry entry = null;
PSEntry entry;
map.nodes.forEach((k, v) {
if (k is YamlScalar && key == k.toString()) {
entry = _processScalar(k, v);
Expand Down
4 changes: 2 additions & 2 deletions lib/src/rules/prefer_is_not_empty.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ class Visitor extends SimpleAstVisitor {

@override
visitSimpleIdentifier(SimpleIdentifier identifier) {
AstNode isEmptyAccess = null;
SimpleIdentifier isEmptyIdentifier = null;
AstNode isEmptyAccess;
SimpleIdentifier isEmptyIdentifier;

AstNode parent = identifier.parent;
if (parent is PropertyAccess) {
Expand Down
10 changes: 3 additions & 7 deletions lib/src/sdk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,7 @@ class HtmlElement {}
final resource.MemoryResourceProvider provider =
new resource.MemoryResourceProvider();

/**
* The [AnalysisContextImpl] which is used for all of the sources.
*/
/// The [AnalysisContextImpl] which is used for all of the sources.
AnalysisContextImpl _analysisContext;

MockSdk() {
Expand Down Expand Up @@ -274,7 +272,7 @@ class HtmlElement {}
}
if (filePath.startsWith("$libraryPath/")) {
String pathInLibrary = filePath.substring(libraryPath.length + 1);
String path = '${library.shortName}/${pathInLibrary}';
String path = '${library.shortName}/$pathInLibrary';
try {
resource.File file = provider.getResource(uri.path);
Uri dartUri = new Uri(scheme: 'dart', path: path);
Expand Down Expand Up @@ -362,9 +360,7 @@ class _MockSdkLibrary implements SdkLibrary {
UnimplementedError get unimplemented => new UnimplementedError();
}

/**
* An [AnalysisContextImpl] that only contains sources for a Dart SDK.
*/
/// An [AnalysisContextImpl] that only contains sources for a Dart SDK.
class _SdkAnalysisContext extends AnalysisContextImpl {
final DartSdk sdk;

Expand Down
2 changes: 1 addition & 1 deletion lib/src/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class _ErrorListener implements AnalysisErrorListener {
}

void throwIfErrors() {
if (!errors.isEmpty) {
if (errors.isNotEmpty) {
throw new Exception(errors);
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/rule_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ Annotation extractAnnotation(String line) {
if (msgIndex < 1) {
msgIndex = annotation.indexOf('T') + 1;
}
String msg = null;
String msg;
if (msgIndex < line.length) {
msg = line.substring(index + msgIndex).trim();
if (msg.isEmpty) {
Expand Down

0 comments on commit 601f7f9

Please sign in to comment.