fix style/optionalBooleanParam cop #6211
Open
+6
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE: Please review the pull request process before opening your first PR: https://github.com/WikiEducationFoundation/WikiEduDashboard/blob/master/CONTRIBUTING.md#pull-request-process
What this PR does
This PR attempts to make progress on the issue #5297 by removing the Style/optionalBooleanParameters cop from
.rubocop.yml
and fix the offenses generated by it. This style changes the definition of default boolean parameters inside function definitions fromfunc_name(bool_val = true
) tofunc_name(bool_val: true)
.Screenshots
No UI changes made.
Open questions and concerns
I have only commit changes to function definitions. Even though this fixes all the offenses generated by removing this cop, it's better to add such definition to function calls, i.e,
func_name(true)
tofunc_name(bool_val: true)
so that it is clear for what variable the boolean value is being passed for. However, adding this would require to scan through the codebase and find the exact function calls for those functions which is a little tedious especially for the "email" function as there are many email functions defined in different classes. What are your thoughts on this ?