add new lints of linter-0.1.44 and enable unnecessary_parenthesis (#15585)

This commit is contained in:
Alexandre Ardhuin 2018-03-21 07:10:14 +01:00 committed by GitHub
parent d518bd2dc8
commit 217b2bdaa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 8 deletions

View File

@ -63,6 +63,7 @@ linter:
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
# - avoid_positional_boolean_parameters # not yet tested
# - avoid_relative_lib_imports # not yet tested
- avoid_return_types_on_setters
# - avoid_returning_null # we do this commonly
# - avoid_returning_this # https://github.com/dart-lang/linter/issues/842
@ -141,6 +142,7 @@ linter:
- unnecessary_null_aware_assignments
- unnecessary_null_in_if_null_operators
- unnecessary_overrides
- unnecessary_parenthesis
# - unnecessary_statements # not yet tested
- unnecessary_this
- unrelated_type_equality_checks

View File

@ -56,6 +56,7 @@ linter:
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
# - avoid_positional_boolean_parameters # not yet tested
# - avoid_relative_lib_imports # not yet tested
- avoid_return_types_on_setters
# - avoid_returning_null # we do this commonly
# - avoid_returning_this # https://github.com/dart-lang/linter/issues/842
@ -134,6 +135,7 @@ linter:
- unnecessary_null_aware_assignments
- unnecessary_null_in_if_null_operators
- unnecessary_overrides
- unnecessary_parenthesis
# - unnecessary_statements # not yet tested
- unnecessary_this
- unrelated_type_equality_checks

View File

@ -754,7 +754,7 @@ class PaddleSliderValueIndicatorShape extends SliderComponentShape {
if (bottomRight.dx > parentBox.size.width - edgeMargin) {
shift = parentBox.size.width - bottomRight.dx - edgeMargin;
}
shift = (scale == 0.0 ? 0.0 : shift / scale);
shift = scale == 0.0 ? 0.0 : shift / scale;
return shift;
}

View File

@ -248,7 +248,7 @@ Future<XcodeBuildResult> buildXcodeProject({
appIosDirectory: appDirectory,
iosEngineDir: flutterFrameworkDir(buildInfo.mode),
isSwift: app.isSwift,
flutterPodChanged: (previousGeneratedXcconfig != currentGeneratedXcconfig),
flutterPodChanged: previousGeneratedXcconfig != currentGeneratedXcconfig,
);
}

View File

@ -155,7 +155,7 @@ class VsCode {
static List<VsCode> _findInstalled(
List<_VsCodeInstallLocation> allLocations) {
final Iterable<_VsCodeInstallLocation> searchLocations =
final Iterable<_VsCodeInstallLocation> searchLocations =
_includeInsiders
? allLocations
: allLocations.where((_VsCodeInstallLocation p) => p.isInsiders != true);
@ -175,7 +175,7 @@ class VsCode {
@override
String toString() =>
'VS Code ($version)${(_extensionVersion != Version.unknown ? ', Dart Code ($_extensionVersion)' : '')}';
'VS Code ($version)${_extensionVersion != Version.unknown ? ', Dart Code ($_extensionVersion)' : ''}';
static String _getVersionFromPackageJson(String packageJsonPath) {
if (!fs.isFileSync(packageJsonPath))

View File

@ -42,7 +42,7 @@ void main() {
MockAndroidSdk.createSdkDirectory();
when(sdk.sdkManagerPath).thenReturn('/foo/bar/sdkmanager');
final AndroidWorkflow androidWorkflow = new AndroidWorkflow();
final LicensesAccepted result = await(androidWorkflow.licensesAccepted);
final LicensesAccepted result = await androidWorkflow.licensesAccepted;
expect(result, equals(LicensesAccepted.unknown));
expect(processManager.commands.first, equals('/foo/bar/sdkmanager'));
expect(processManager.commands.last, equals('--licenses'));
@ -63,7 +63,7 @@ void main() {
]);
final AndroidWorkflow androidWorkflow = new AndroidWorkflow();
final LicensesAccepted result = await(androidWorkflow.licensesAccepted);
final LicensesAccepted result = await androidWorkflow.licensesAccepted;
expect(result, equals(LicensesAccepted.all));
}, overrides: <Type, Generator>{
AndroidSdk: () => sdk,
@ -83,7 +83,7 @@ void main() {
]);
final AndroidWorkflow androidWorkflow = new AndroidWorkflow();
final LicensesAccepted result = await(androidWorkflow.licensesAccepted);
final LicensesAccepted result = await androidWorkflow.licensesAccepted;
expect(result, equals(LicensesAccepted.some));
}, overrides: <Type, Generator>{
AndroidSdk: () => sdk,
@ -103,7 +103,7 @@ void main() {
]);
final AndroidWorkflow androidWorkflow = new AndroidWorkflow();
final LicensesAccepted result = await(androidWorkflow.licensesAccepted);
final LicensesAccepted result = await androidWorkflow.licensesAccepted;
expect(result, equals(LicensesAccepted.none));
}, overrides: <Type, Generator>{
AndroidSdk: () => sdk,