From b34333277a687dfc111ecbd7a3cd60893839f768 Mon Sep 17 00:00:00 2001 From: pq Date: Thu, 12 May 2016 06:13:28 -0700 Subject: [PATCH] Linter version 0.1.16. Includes: * Fix for false positive in `overriden_field`s. * New `unrelated_type_equality_checks` lint. * Fix to accept `$` identifiers in string interpolation lint (#214). * Update to new `plugin` API (`0.2.0`). * Strong mode cleanup. BUG= Review URL: https://codereview.chromium.org//1972183002 . --- CHANGELOG.md | 8 ++++++++ lib/src/rules.dart | 4 ++-- ..._equality.dart => unrelated_type_equality_checks.dart} | 8 ++++---- pubspec.yaml | 2 +- ..._equality.dart => unrelated_type_equality_checks.dart} | 2 +- 5 files changed, 16 insertions(+), 8 deletions(-) rename lib/src/rules/{dont_compare_unrelated_types_for_equality.dart => unrelated_type_equality_checks.dart} (94%) rename test/rules/{dont_compare_unrelated_types_for_equality.dart => unrelated_type_equality_checks.dart} (96%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dcab8eb7..b7b188c4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# 0.1.16 + +* Fix for false positive in `overriden_field`s. +* New `unrelated_type_equality_checks` lint. +* Fix to accept `$` identifiers in string interpolation lint (#214). +* Update to new `plugin` API (`0.2.0`). +* Strong mode cleanup. + # 0.1.15 * Fix to allow simple getter/setters when a decl is ``@protected` (#215). diff --git a/lib/src/rules.dart b/lib/src/rules.dart index 55a0a7263..44cef7012 100644 --- a/lib/src/rules.dart +++ b/lib/src/rules.dart @@ -19,7 +19,6 @@ import 'package:linter/src/rules/await_only_futures.dart'; import 'package:linter/src/rules/camel_case_types.dart'; import 'package:linter/src/rules/constant_identifier_names.dart'; import 'package:linter/src/rules/control_flow_in_finally.dart'; -import 'package:linter/src/rules/dont_compare_unrelated_types_for_equality.dart'; import 'package:linter/src/rules/empty_constructor_bodies.dart'; import 'package:linter/src/rules/hash_and_equals.dart'; import 'package:linter/src/rules/implementation_imports.dart'; @@ -43,6 +42,7 @@ import 'package:linter/src/rules/type_annotate_public_apis.dart'; import 'package:linter/src/rules/type_init_formals.dart'; import 'package:linter/src/rules/unnecessary_brace_in_string_interp.dart'; import 'package:linter/src/rules/unnecessary_getters_setters.dart'; +import 'package:linter/src/rules/unrelated_type_equality_checks.dart'; final Registry ruleRegistry = new Registry() ..register(new AlwaysDeclareReturnTypes()) @@ -55,7 +55,7 @@ final Registry ruleRegistry = new Registry() ..register(new AwaitOnlyFutures()) ..register(new CamelCaseTypes()) ..register(new ConstantIdentifierNames()) - ..register(new DontCompareUnrelatedTypesForEquality()) + ..register(new UnrelatedTypeEqualityChecks()) ..register(new EmptyConstructorBodies()) ..register(new TestTypesInEquals()) ..register(new OverridenField()) diff --git a/lib/src/rules/dont_compare_unrelated_types_for_equality.dart b/lib/src/rules/unrelated_type_equality_checks.dart similarity index 94% rename from lib/src/rules/dont_compare_unrelated_types_for_equality.dart rename to lib/src/rules/unrelated_type_equality_checks.dart index fc045604f..3d9e2e83b 100644 --- a/lib/src/rules/dont_compare_unrelated_types_for_equality.dart +++ b/lib/src/rules/unrelated_type_equality_checks.dart @@ -2,7 +2,7 @@ // 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. -library linter.src.rules.dont_compare_unrelated_types_for_equality; +library linter.src.rules.unrelated_type_equality_checks; import 'package:analyzer/dart/ast/ast.dart'; import 'package:analyzer/dart/ast/token.dart'; @@ -126,11 +126,11 @@ class DerivedClass2 extends ClassBase with Mixin {} ``` '''; -class DontCompareUnrelatedTypesForEquality extends LintRule { +class UnrelatedTypeEqualityChecks extends LintRule { _Visitor _visitor; - DontCompareUnrelatedTypesForEquality() : super( - name: 'dont_compare_unrelated_types_for_equality', + UnrelatedTypeEqualityChecks() : super( + name: 'unrelated_type_equality_checks', description: _desc, details: _details, group: Group.errors, diff --git a/pubspec.yaml b/pubspec.yaml index 8a74aacf7..563c00303 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: linter -version: 0.1.15 +version: 0.1.16 author: Dart Team description: Style linter for Dart. homepage: https://github.com/dart-lang/linter diff --git a/test/rules/dont_compare_unrelated_types_for_equality.dart b/test/rules/unrelated_type_equality_checks.dart similarity index 96% rename from test/rules/dont_compare_unrelated_types_for_equality.dart rename to test/rules/unrelated_type_equality_checks.dart index f14abbcfa..d479cc2f1 100644 --- a/test/rules/dont_compare_unrelated_types_for_equality.dart +++ b/test/rules/unrelated_type_equality_checks.dart @@ -2,7 +2,7 @@ // 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. -// test w/ `dart test/util/solo_test.dart dont_compare_unrelated_types_for_equality` +// test w/ `dart test/util/solo_test.dart unrelated_type_equality_checks` void someFunction() { var x = '1';