From ba90d7a677d7cbd61197c368d76f8c7b2842bf8e Mon Sep 17 00:00:00 2001 From: Aadeesh11 <66922161+Aadeesh11@users.noreply.github.com> Date: Fri, 24 Dec 2021 19:26:24 +0530 Subject: [PATCH] fix(lints): linter rules #149 (#179) * rfrac: enabled unnecessary_parenthesis and avoid_redundant_argument_values rules. * rfrac: Removed unused imports. * enabled unnecessary_parenthesis. --- 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, 5 insertions(+), 7 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 8acc3356..718e36d6 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -8,8 +8,6 @@ linter: # Util classes avoid_classes_with_only_static_members: false - avoid_redundant_argument_values: false - non_constant_identifier_names: false constant_identifier_names: false 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); });