Skip to content

Conversation

@kartiki975
Copy link
Contributor

@kartiki975 kartiki975 commented Apr 16, 2025

This pull request includes updates to the .rubocop.yml configuration, upgrades the rubocop gem in the Gemfile, and applies various code improvements across multiple controllers in the Shipit API. The changes focus on improving code readability, modernizing syntax, and disabling select RuboCop rules. Some rules were disabled to find the fastest way to do the Rails 8.0 upgrade.

RuboCop Configuration and Gem Updates:

  • Removed the inherit_gem directive for rubocop-shopify and added exclusions for Layout/LineLength in .rubocop.yml.
  • Disabled several RuboCop rules (e.g., Metrics/ClassLength, Style/Documentation, Metrics/AbcSize) in .rubocop.yml.
  • Upgraded the rubocop gem from version 1.18.3 to ~> 1.48.0 in the Gemfile.

Syntax Modernization:

  • Replaced hash rockets with Ruby 2.7+ shorthand syntax for keyword arguments in methods like render_resources and trigger_deploy. [1] [2]
  • Simplified conditional assignments and method calls, e.g., commits.newer_than(stack.last_deployed_commit) is now inline.

Code Readability Improvements:

  • Standardized array formatting for permissions (e.g., %i[index show]%i[index show]). [1] [2]
  • Improved method naming for clarity, such as renaming has_basic_credentials? to basic_credentials?.

Controller Enhancements:

  • Refactored logic in StacksController to streamline repository filtering and parameter handling. [1] [2]
  • Updated MergeRequestsController to handle edge cases more concisely, including merged pull requests and cancellations.

Note for reviewers

I will squash all the commits down before merging the PR.

@kartiki975 kartiki975 requested a review from casperisfine April 16, 2025 22:17
Copy link

@bostonou bostonou left a comment

Choose a reason for hiding this comment

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

Approved, with another top-hat cycle expected

@kartiki975
Copy link
Contributor Author

A final top-hat has been completed with smoke testing. Everything is behaving as expected.

@kartiki975 kartiki975 force-pushed the update-rubocop-to-support-ruby-3.2 branch from 3c4a9fe to d187b84 Compare April 17, 2025 16:05
Remove rubocop-shopify gem

Update .rubocop.yml

Rubocop: auto-correct basic things

Suppress warnings that are time-consuming to fix

Add minor tweaks

Suppress rubocop warnings for redeploy_state and deploy_state

Minor rubocop tweaks

Update file_system_test.rb

Update stack.rb

Update command.rb

Update dev.rake
@kartiki975 kartiki975 force-pushed the update-rubocop-to-support-ruby-3.2 branch from d187b84 to 8222b23 Compare April 17, 2025 16:23
@kartiki975 kartiki975 merged commit 2978264 into main Apr 17, 2025
15 checks passed
@kartiki975 kartiki975 deleted the update-rubocop-to-support-ruby-3.2 branch April 17, 2025 16:37
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