Load rubocop-rake and rubocop-rspec plugins (herb-embedded-5g1) - #54
Merged
Conversation
rubocop-rake and rubocop-rspec were already dev dependencies but never actually loaded (require: false, no require/plugins key in .rubocop.yml) - hence RuboCop's own "extension libraries are installed but not loaded" suggestion. Adds a `plugins:` key (the modern mechanism, per docs.rubocop.org/rubocop/plugins.html) to load both. rubocop-rake found nothing (Rakefile/rakelib are small). rubocop-rspec surfaced 136 offenses across 11 cops, addressed as a mix of real fixes and documented configuration - not a blanket disable: Fixed: include_examples -> it_behaves_like (verified safe: the shared example group's bare `subject` still resolves correctly through the nested context); named an anonymous subject; converted a message expectation to the spy pattern; split report_spec.rb's two top-level describes into report_spec.rb and lint_result_spec.rb (also fixes a pre-existing violation of CLAUDE.md's own "one spec file per lib unit" convention); applied safe autocorrects for scattered lets and simple-regex-as-string matchers. Configured, each with a comment explaining why: RSpec/SpecFilePathFormat disabled (this suite's spec/ is deliberately flat, not nested to mirror lib/'s namespace dirs); RSpec/ExampleLength and RSpec/MultipleExpectations raised to 25/8 (picked after checking the actual worst offenders - 22 lines/7 expectations - not arbitrary; this suite favors thorough, narrative examples over one-assertion-per-it); RSpec/DescribeClass excluded for the three specs that describe a scenario or guarantee rather than one Ruby class. One inline disable (not global) for RSpec/LeakyLocalVariable where the flagged pattern is a per-.each-iteration closure local, not the cross-example leak the cop targets. bundle exec rake: 45 files, 0 RuboCop offenses, 206 examples 0 failures, no vulnerabilities found.
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.
Summary
rubocop-rake/rubocop-rspecwere already dev dependencies but never actually loaded (require: false, norequire/pluginskey in.rubocop.yml) — hence RuboCop's own "extension libraries are installed but not loaded" suggestion. Adds aplugins:key (the modern mechanism, per docs.rubocop.org/rubocop/plugins.html) to actually load both.rubocop-rakefound nothing (Rakefile/rakelib are small).rubocop-rspecsurfaced 136 offenses across 11 cops — addressed as a mix of real fixes and documented configuration, not a blanket disable.Fixed:
include_examples→it_behaves_like(verified safe — the shared example group's baresubjectstill resolves correctly through the nested context).subject.allow/have_received).report_spec.rb's two top-leveldescribes intoreport_spec.rbandlint_result_spec.rb— also fixes a pre-existing violation of CLAUDE.md's own "one spec file per lib unit" convention.lets and simple-regex-as-string matchers.Configured (each with a comment explaining why):
RSpec/SpecFilePathFormatdisabled — this suite'sspec/is deliberately flat, not nested to mirrorlib/'s namespace dirs.RSpec/ExampleLength/RSpec/MultipleExpectationsraised to 25/8 — picked after checking the actual worst offenders (22 lines / 7 expectations), not arbitrary; this suite favors thorough, narrative examples over one-assertion-per-it.RSpec/DescribeClassexcluded for the three specs that describe a scenario or guarantee rather than one Ruby class.RSpec/LeakyLocalVariablewhere the flagged pattern is a per-.each-iteration closure local, not the cross-example leak the cop targets.Acceptance criteria
rubocop-rake/rubocop-rspecin the Gemfile dev group andGemfile.lock— already present from a prior bead.plugins:key in.rubocop.yml.bundle exec rakeruns clean — no "extension libraries" nag, and every offense fixed or explicitly configured with reasoning.Test plan
bundle exec rake(RuboCop + full RSpec suite + bundler-audit) passes locally.it_behaves_likeconversion re-verified in isolation (14 examples, 0 failures) to confirm shared-examplesubjectresolution is unchanged.🤖 Generated with Claude Code