Skip to content

Fix CI failures: configure new RuboCop 1.85/1.86 cops and fix genignore test#805

Closed
dfl wants to merge 2 commits into
standardrb:dependabot/bundler/rubocop-1.86.1from
dfl:dependabot/bundler/rubocop-1.86.1
Closed

Fix CI failures: configure new RuboCop 1.85/1.86 cops and fix genignore test#805
dfl wants to merge 2 commits into
standardrb:dependabot/bundler/rubocop-1.86.1from
dfl:dependabot/bundler/rubocop-1.86.1

Conversation

@dfl
Copy link
Copy Markdown

@dfl dfl commented May 7, 2026

Summary

Fixes the two CI failures in #801.

  • config/base.yml: Adds 13 new cops introduced in RuboCop 1.85/1.86 that were in pending state, causing the test_configures_all_rubocop_cops assertion to fail. Each is set to Enabled: true or false consistent with how similar cops are configured.
  • genignore_test.rb: RuboCop 1.85+ changed path reporting — when Dir.chdir is used, paths are now reported relative to the process CWD rather than the chdir directory. The fix passes an explicit file list so RuboCop doesn't accidentally scan unrelated project files, and normalizes paths to basenames in the assertion for version compatibility. Also asserts todo["ignore"] is present before normalizing so a regression fails clearly instead of with NoMethodError.

New cops configured

Cop Enabled
Lint/DataDefineOverride true
Lint/UnreachablePatternBranch true
Style/FileOpen true
Style/MapJoin false
Style/OneClassPerFile false
Style/PartitionInsteadOfDoubleSelect false
Style/PredicateWithKind true
Style/ReduceToHash false
Style/RedundantMinMaxBy true
Style/RedundantStructKeywordInit false
Style/SelectByKind false
Style/SelectByRange false
Style/TallyMethod true

Happy to adjust any of the enabled/disabled decisions — these are judgment calls based on how similar cops are already configured.

dfl added 2 commits May 7, 2026 11:03
Add 13 new pending cops to config/base.yml so they are explicitly
enabled or disabled rather than silently ignored.

Also fix genignore_test to pass explicit file paths (preventing
RuboCop from scanning the entire project), and normalize paths in
the assertion to handle RuboCop 1.85+ reporting paths relative to
the process CWD rather than Dir.chdir.
…ore test

- Flip Style/PartitionInsteadOfDoubleSelect to false for consistency with
  other refactor-style cops (Style/MapToHash, Style/MapIntoArray, etc.)
- Add assert todo["ignore"] before normalizing so a regression that
  produces an empty todo fails clearly instead of with NoMethodError
- Note that the basename normalization can be dropped once the rubocop
  floor reaches 1.85
@dependabot dependabot Bot deleted the branch standardrb:dependabot/bundler/rubocop-1.86.1 May 19, 2026 08:06
@dependabot dependabot Bot closed this May 19, 2026
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