-
-
Notifications
You must be signed in to change notification settings - Fork 707
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
Autocorrect Rubocop issues #12026
Autocorrect Rubocop issues #12026
Conversation
Inspecting 1530 files .....................................................................................................................................................................................................................................................................................................................................................W.................................................................................................................................................................................................................................................W..........................................................................................................................................................................................................................................................W....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... Offenses: app/models/spree/preferences/preferable_class_methods.rb:73:9: W: [Corrected] Lint/SymbolConversion: Unnecessary symbol conversion; use :"preferred_#{name}" instead. "preferred_#{name}".to_sym ^^^^^^^^^^^^^^^^^^^^^^^^^^ app/models/spree/preferences/preferable_class_methods.rb:77:9: W: [Corrected] Lint/SymbolConversion: Unnecessary symbol conversion; use :"preferred_#{name}=" instead. "preferred_#{name}=".to_sym ^^^^^^^^^^^^^^^^^^^^^^^^^^^ app/models/spree/preferences/preferable_class_methods.rb:81:9: W: [Corrected] Lint/SymbolConversion: Unnecessary symbol conversion; use :"prefers_#{name}?" instead. "prefers_#{name}?".to_sym ^^^^^^^^^^^^^^^^^^^^^^^^^ app/models/spree/preferences/preferable_class_methods.rb:85:9: W: [Corrected] Lint/SymbolConversion: Unnecessary symbol conversion; use :"prefers_#{name}=" instead. "prefers_#{name}=".to_sym ^^^^^^^^^^^^^^^^^^^^^^^^^ app/models/spree/preferences/preferable_class_methods.rb:89:9: W: [Corrected] Lint/SymbolConversion: Unnecessary symbol conversion; use :"preferred_#{name}_default" instead. "preferred_#{name}_default".to_sym ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ app/models/spree/preferences/preferable_class_methods.rb:93:9: W: [Corrected] Lint/SymbolConversion: Unnecessary symbol conversion; use :"preferred_#{name}_type" instead. "preferred_#{name}_type".to_sym ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ app/models/spree/preferences/preferable_class_methods.rb:97:9: W: [Corrected] Lint/SymbolConversion: Unnecessary symbol conversion; use :"preferred_#{name}_description" instead. "preferred_#{name}_description".to_sym ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ app/services/sets/product_set.rb:121:28: W: [Corrected] Lint/SymbolConversion: Unnecessary symbol conversion; use :"variant_#{error.attribute}" instead. product.errors.add("variant_#{error.attribute}".to_sym, error.message) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lib/spree/core/environment_extension.rb:11:24: W: [Corrected] Lint/SymbolConversion: Unnecessary symbol conversion; use :"#{name}=" instead. create_method( "#{name}=".to_sym ) { |val| ^^^^^^^^^^^^^^^^^ 1530 files inspected, 9 offenses detected, 9 offenses corrected
Inspecting 1530 files .................................................................................................................................................................................C................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C....................................................................................................................... Offenses: app/helpers/shop_helper.rb:48:43: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected. no_open_order_cycles?(order_cycles) && ^ app/helpers/shop_helper.rb:48:44: C: [Corrected] Style/RedundantLineContinuation: Redundant line continuation. no_open_order_cycles?(order_cycles) && \ ... ^ spec/system/admin/configuration/content_spec.rb:35:64: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected. expect(page).to have_selector :link, "markdown link", href: ^ spec/system/admin/configuration/content_spec.rb:35:65: C: [Corrected] Style/RedundantLineContinuation: Redundant line continuation. expect(page).to have_selector :link, "markdown link", href: \ ... ^ 1530 files inspected, 4 offenses detected, 4 offenses corrected
Interestingly, a couple of the fixes didn't commit with the script. I don't know why, I don't think I was doing anything else at the time.
But there was a changed file, so I manually committed it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, it's so cool that we can now easily harness Rubocop to improve our code quality.
Fast forward to 2026 and Rubocop will solve all deprecation warnings for us while Dependabot bumps the Rails version without issues.
What? Why?
I tried running the autocorrect script one more time, because it's been a couple of months. It looped through about 20, and only a few had corrections, so I think it's safe to say it
What should we test?
No testing needed for safe autocorrects