From 56d932b1a2a530c18930fb7d8fd1c7a6724a6d97 Mon Sep 17 00:00:00 2001 From: Aadeesh11 Date: Sun, 5 Dec 2021 15:04:10 +0530 Subject: [PATCH] rfrac: enable unnecessary_parenthesis rule --- analysis_options.yaml | 2 ++ lib/ui/views/groups/add_assignment_view.dart | 2 +- lib/ui/views/groups/update_assignment_view.dart | 2 +- test/service_tests/assignments_api_test.dart | 4 ++-- test/service_tests/users_api_test.dart | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 8acc3356..e84b1918 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -13,3 +13,5 @@ linter: non_constant_identifier_names: false constant_identifier_names: false + + unnecessary_parenthesis: true diff --git a/lib/ui/views/groups/add_assignment_view.dart b/lib/ui/views/groups/add_assignment_view.dart index 4238e3a3..4c7cc6c8 100644 --- a/lib/ui/views/groups/add_assignment_view.dart +++ b/lib/ui/views/groups/add_assignment_view.dart @@ -146,7 +146,7 @@ class _AddAssignmentViewState extends State { value: _restrictions.contains(name), onChanged: (value) { if (value) { - _restrictions.add((name)); + _restrictions.add(name); } else { _restrictions.remove(name); } diff --git a/lib/ui/views/groups/update_assignment_view.dart b/lib/ui/views/groups/update_assignment_view.dart index 9b717a23..828b9117 100644 --- a/lib/ui/views/groups/update_assignment_view.dart +++ b/lib/ui/views/groups/update_assignment_view.dart @@ -126,7 +126,7 @@ class _UpdateAssignmentViewState extends State { value: _restrictions.contains(name), onChanged: (value) { if (value) { - _restrictions.add((name)); + _restrictions.add(name); } else { _restrictions.remove(name); } diff --git a/test/service_tests/assignments_api_test.dart b/test/service_tests/assignments_api_test.dart index 58893c5e..2c85732e 100644 --- a/test/service_tests/assignments_api_test.dart +++ b/test/service_tests/assignments_api_test.dart @@ -189,7 +189,7 @@ void main() { (_) => Future.value(Response('{"message": "reopened"}', 200))); var _assignmentsApi = HttpAssignmentsApi(); - expect((await _assignmentsApi.reopenAssignment('1')), 'reopened'); + expect(await _assignmentsApi.reopenAssignment('1'), 'reopened'); }); test('When called & http client throws Exceptions', () async { @@ -219,7 +219,7 @@ void main() { Future.value(Response('{"message": "project created"}', 200))); var _assignmentsApi = HttpAssignmentsApi(); - expect((await _assignmentsApi.startAssignment('1')), 'project created'); + expect(await _assignmentsApi.startAssignment('1'), 'project created'); }); test('When called & http client throws Exceptions', () async { diff --git a/test/service_tests/users_api_test.dart b/test/service_tests/users_api_test.dart index fb67f810..af4bee93 100644 --- a/test/service_tests/users_api_test.dart +++ b/test/service_tests/users_api_test.dart @@ -213,7 +213,7 @@ void main() { ApiUtils.client = MockClient((_) => Future.value(Response('{"message": "instructions sent"}', 200))); - expect((await _usersApi.sendResetPasswordInstructions('test@test.com')), + expect(await _usersApi.sendResetPasswordInstructions('test@test.com'), true); });