[analyzer] enable implicit-casts: false for several projects

Change-Id: Idd7ed77756d93a94f637dcc4abd7e0403a2f6d81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112703
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Devon Carew 2019-08-13 16:26:41 +00:00 committed by commit-bot@chromium.org
parent 20407e28db
commit f53388b50d
9 changed files with 42 additions and 7 deletions

View file

@ -1,4 +1,7 @@
analyzer:
# This currently finds ~1,200 implicit-casts issues when enabled.
# strong-mode:
# implicit-casts: false
exclude:
- test/mock_packages/**

View file

@ -0,0 +1,10 @@
analyzer:
#strong-mode:
# implicit-casts: false
linter:
rules:
- empty_constructor_bodies
- empty_statements
- unnecessary_brace_in_string_interps
- valid_regexps

View file

@ -99,7 +99,7 @@ class _Handler with NotificationHandler, ConnectionHandler {
if (errorCount == 0) {
print('No issues found.');
} else {
print('Found ${errorCount} errors/warnings/hints');
print('Found $errorCount errors/warnings/hints');
}
errorCount = 0;
print('--------- ctrl-c to exit ---------');

View file

@ -32,13 +32,14 @@ class JenkinsSmiHash {
}
/// Combines together two hash codes.
static int hash2(a, b) => finish(combine(combine(0, a), b));
static int hash2(int a, int b) => finish(combine(combine(0, a), b));
/// Combines together three hash codes.
static int hash3(a, b, c) => finish(combine(combine(combine(0, a), b), c));
static int hash3(int a, int b, int c) =>
finish(combine(combine(combine(0, a), b), c));
/// Combines together four hash codes.
static int hash4(a, b, c, d) =>
static int hash4(int a, int b, int c, int d) =>
finish(combine(combine(combine(combine(0, a), b), c), d));
int _hash = 0;

View file

@ -0,0 +1,10 @@
analyzer:
strong-mode:
implicit-casts: false
linter:
rules:
- empty_constructor_bodies
- empty_statements
- unnecessary_brace_in_string_interps
- valid_regexps

View file

@ -1,3 +1,8 @@
analyzer:
# This currently finds ~4,500 implicit-casts issues when enabled.
# strong-mode:
# implicit-casts: false
linter:
rules:
- empty_constructor_bodies # pedantic

View file

@ -194,8 +194,10 @@ class WrappedCompilationUnitElement implements CompilationUnitElement {
.accept(visitor); // ignore: deprecated_member_use_from_same_package
@override
String computeDocumentationComment() =>
wrappedUnit.computeDocumentationComment();
String computeDocumentationComment() {
// ignore: deprecated_member_use_from_same_package
return wrappedUnit.computeDocumentationComment();
}
@deprecated
@override

View file

@ -1,5 +1,9 @@
include: package:pedantic/analysis_options.1.8.0.yaml
analyzer:
strong-mode:
implicit-casts: false
linter:
rules:
directives_ordering: true

View file

@ -52,7 +52,7 @@ class Options {
pedanticFixes = results[pedanticOption] as bool,
requiredFixes = results[requiredOption] as bool,
sdkPath = _getSdkPath(),
serverSnapshot = results[_serverSnapshot],
serverSnapshot = results[_serverSnapshot] as String,
showHelp = results[_helpOption] as bool || results.arguments.isEmpty,
targets = results.rest,
useColor = results.wasParsed(_colorOption)