Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rubocop] Step 5 #214

Merged
merged 37 commits into from
Feb 24, 2021
Merged

[rubocop] Step 5 #214

merged 37 commits into from
Feb 24, 2021

Conversation

AliSoftware
Copy link
Contributor

@AliSoftware AliSoftware commented Feb 18, 2021

Continuing work on #207 and rubocop.

⚠️ Some of the rules that have been incrementally enabled in this PR were not auto-corrected by rubocop but were corrected manually – so will need more attentive review.

This also includes a small refactor (consisting of the extraction of long portion of code into a separate method, to reduce the code complexity and method length, see f84285d) that might also need careful review – especially to ensure that all the variables used in the original code were all passed to the method and that the extracted code didn't modify any variable that would then later be used after it in the original code, etc.

The corresponding commits are labeled accordingly ([rubocop] fix … (manual) and the like) – in case you want to review commit-per-commit.

Because enabling it, even if it's recommended, require very careful tests and review to avoid accidental runtime crashes
Used RubyMine's refactoring feature to extract the big chunk of code building the entries into its private method, to reduce the self.run(…)'s complexity
@AliSoftware AliSoftware requested review from a team, oguzkocer, jkmassel and loremattei and removed request for a team February 18, 2021 20:48
@AliSoftware AliSoftware self-assigned this Feb 18, 2021
Copy link
Contributor

@jkmassel jkmassel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM – I left a few questions, but nothing blocking

# Enabling the 'frozen_string_literal: true' comment is nice but should be done with extra care
# because enabling it on code that accidentally mutates string literals will crash at runtime
# (e.g. `name = 'Hello'` then later `name << ' world'` will crash if the comment is enabled)
# So we might enable it at some point, be we will need very careful review that this doesn't break everything.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

spec/ios_lint_localizations_spec.rb Show resolved Hide resolved
.rubocop_todo.yml Show resolved Hide resolved
@AliSoftware
Copy link
Contributor Author

Thanks for the review @jkmassel 👍 I should have addressed all your questions and suggestions 🙂

@AliSoftware AliSoftware merged commit 6fffd84 into toolkit-cleanup Feb 24, 2021
@AliSoftware AliSoftware deleted the cleanup/rubocop/step5 branch February 24, 2021 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants