Skip to content

Fix RuboCop offenses and run RuboCop in CI - #114

Merged
paracycle merged 3 commits into
mainfrom
ufuk/rubocop-ci
Oct 27, 2026
Merged

paracycle merged 3 commits into
mainfrom
ufuk/rubocop-ci

Conversation

@paracycle

@paracycle paracycle commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

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 rake task fails. CI runs only RSpec, so CI does not show these offenses, and new offenses can merge without notice.

Changes

  • Autocorrect 60 offenses:

    • Apply the safe autocorrections from rubocop -a. Most of them are Layout/ArgumentAlignment changes.
    • Freeze the spec constants for Style/MutableConstant. RuboCop marks this correction as unsafe, but the constants are string literals that the specs do not change.
  • Add .rubocop_todo.yml for the 5 remaining offenses:

    • Style/ClassMethodsDefinitions in lib/oktakit.rb and lib/oktakit/error.rb.
    • Lint/RedundantCopDisableDirective in spec/client/apps_spec.rb.
    • Gemspec/DevelopmentDependencies in oktakit.gemspec.

    RuboCop marks the first two cops as correctable, but rubocop -A does not change these offenses. The third cop has no autocorrection.

  • Add a RuboCop job to the CI workflow. The job runs bundle exec rubocop one time with the Ruby version from .ruby-version.

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.
@paracycle
paracycle merged commit 3102a26 into main Oct 27, 2026
5 checks passed
@paracycle
paracycle deleted the ufuk/rubocop-ci branch October 27, 2026 22:19
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.

1 participant