Fix CI failures: configure new RuboCop 1.85/1.86 cops and fix genignore test#805
Closed
dfl wants to merge 2 commits into
Closed
Conversation
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
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
Fixes the two CI failures in #801.
config/base.yml: Adds 13 new cops introduced in RuboCop 1.85/1.86 that were inpendingstate, causing thetest_configures_all_rubocop_copsassertion to fail. Each is set toEnabled: trueorfalseconsistent with how similar cops are configured.genignore_test.rb: RuboCop 1.85+ changed path reporting — whenDir.chdiris 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 assertstodo["ignore"]is present before normalizing so a regression fails clearly instead of withNoMethodError.New cops configured
Lint/DataDefineOverrideLint/UnreachablePatternBranchStyle/FileOpenStyle/MapJoinStyle/OneClassPerFileStyle/PartitionInsteadOfDoubleSelectStyle/PredicateWithKindStyle/ReduceToHashStyle/RedundantMinMaxByStyle/RedundantStructKeywordInitStyle/SelectByKindStyle/SelectByRangeStyle/TallyMethodHappy to adjust any of the enabled/disabled decisions — these are judgment calls based on how similar cops are already configured.