Repository navigation
Fix RuboCop offenses and run RuboCop in CI - #114
Merged
Merged
Conversation
Apply the safe autocorrections from rubocop -a, and freeze the spec constants for Style/MutableConstant.
RuboCop cannot autocorrect these offenses, so list them in .rubocop_todo.yml to fix later.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
The lockfile update in #107 moved RuboCop from 1.23 to 1.92 and rubocop-shopify from 2.3 to 3.1. The new versions report 65 offenses, so the default
raketask fails. CI runs only RSpec, so CI does not show these offenses, and new offenses can merge without notice.Changes
Autocorrect 60 offenses:
rubocop -a. Most of them areLayout/ArgumentAlignmentchanges.Style/MutableConstant. RuboCop marks this correction as unsafe, but the constants are string literals that the specs do not change.Add
.rubocop_todo.ymlfor the 5 remaining offenses:Style/ClassMethodsDefinitionsinlib/oktakit.rbandlib/oktakit/error.rb.Lint/RedundantCopDisableDirectiveinspec/client/apps_spec.rb.Gemspec/DevelopmentDependenciesinoktakit.gemspec.RuboCop marks the first two cops as correctable, but
rubocop -Adoes not change these offenses. The third cop has no autocorrection.Add a
RuboCopjob to the CI workflow. The job runsbundle exec rubocopone time with the Ruby version from.ruby-version.