Skip to content

Fix Rubocop Style/DirectiveScope offenses - #579

Merged
etagwerker merged 2 commits into
mainfrom
fix/rubocop-directive-scope
Oct 2, 2026
Merged

etagwerker merged 2 commits into
mainfrom
fix/rubocop-directive-scope

Conversation

@etagwerker

Copy link
Copy Markdown
Collaborator

Why

CI on main started failing the Rubocop job (https://github.com/whitesmith/rubycritic/actions/runs/36947244586/job/110652082252). No code changed — a new Rubocop release added the Style/DirectiveScope cop, which flags # rubocop:disable X / # rubocop:enable X pairs that wrap exactly one statement, in favor of a single # rubocop:disable-next X directive. Since Gemfile.lock isn't checked in, bundle install resolves the newest Rubocop satisfying the gemspec's '>= 1.72.0', '< 2.0' constraint, and that newest release introduced the cop.

What changed

Applied rubocop -A --only Style/DirectiveScope across the 7 flagged offenses (comment-only changes, no logic touched):

  • lib/rubycritic/cli/options/argv.rb
  • lib/rubycritic/cli/options/file.rb
  • lib/rubycritic/source_control_systems/git/churn.rb (2 offenses)
  • lib/rubycritic/source_control_systems/perforce.rb
  • test/fakefs_helper.rb
  • test/integration/integration_test_helper.rb

Verification

  • rubocop (latest, 1.91.0) reports 0 offenses across all 119 files afterward.
  • Diff is comment-only; no behavior change.

🤖 Generated with Claude Code

etagwerker and others added 2 commits October 1, 2026 21:00
A newly released Rubocop version added Style/DirectiveScope, which
flags disable/enable comment pairs wrapping a single statement in
favor of a single disable-next directive. This was breaking CI on
main since Gemfile.lock isn't checked in, so bundle install picks up
the latest Rubocop satisfying the gemspec's '>= 1.72.0, < 2.0' range.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@etagwerker
etagwerker merged commit dd55816 into main Oct 2, 2026
36 checks passed
@etagwerker
etagwerker deleted the fix/rubocop-directive-scope branch October 5, 2026 18:12
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