Skip to content

test: add RuboCop metric differential baseline#44

Merged
ebihara99999 merged 2 commits into
mainfrom
feature/rubocop-differential-baseline
Jul 10, 2026
Merged

test: add RuboCop metric differential baseline#44
ebihara99999 merged 2 commits into
mainfrom
feature/rubocop-differential-baseline

Conversation

@ebihara99999

Copy link
Copy Markdown
Owner

Purpose

Refs #41. This is stacked on #43 and implements the second PR-plan slice: RuboCop differential checks with an accepted-differences baseline.

Golden snapshots and regeneration tasks remain out of scope for a follow-up PR.

Changes

  • Run the vendored corpus through RuboCop metric cops via RuboCop::Cop::Team with forced in-memory configuration instead of repository .rubocop.yml.
  • Pin TargetRubyVersion explicitly to the running Ruby major/minor used by CodeKeeper parsing.
  • Use test-only wrapper cops to capture raw metric values before RuboCop rounds offense messages.
  • Compare CodeKeeper and RuboCop measurements bidirectionally and uniquely by metric, path, and start line.
  • Fail on value mismatches, duplicate match keys, new unaccepted differences, and stale baseline entries.
  • Seed the baseline with the known singleton-class behavior differences described in Add corpus-based verification for the metric report #41.
  • Include Metrics/ModuleLength in the RuboCop oracle with the same CodeLength settings because CodeKeeper's class_length metric covers module scopes as well.

Impact

This is test-only. It adds CI coverage over the vendored corpus introduced by #43 and does not change runtime library behavior.

Verification

  • bundle exec rspec - 77 examples, 0 failures
  • bundle exec rubocop - 39 files inspected, no offenses
  • git diff --check - no whitespace errors

Scope Out

  • Golden JSON snapshots
  • Snapshot regeneration task

Base automatically changed from feature/corpus-verification to main July 10, 2026 14:58
Run the vendored corpus through RuboCop metric cops with forced in-memory configuration and compare the captured raw values against CodeKeeper measurements. Accepted singleton-class behavior differences are recorded in a baseline that fails on both new and stale entries.
@ebihara99999
ebihara99999 force-pushed the feature/rubocop-differential-baseline branch from f7a0a93 to f337cdc Compare July 10, 2026 15:03
@ebihara99999
ebihara99999 marked this pull request as ready for review July 10, 2026 15:28
@ebihara99999
ebihara99999 merged commit b3902e1 into main Jul 10, 2026
6 checks passed
@ebihara99999
ebihara99999 deleted the feature/rubocop-differential-baseline branch July 10, 2026 15:28
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