Skip to content

Only bump files inside the given directory - #1038

Open
RaphaelFakhri wants to merge 1 commit into
Shopify:mainfrom
RaphaelFakhri:fix-bump-directory-prefix
Open

RaphaelFakhri wants to merge 1 commit into
Shopify:mainfrom
RaphaelFakhri:fix-bump-directory-prefix

Conversation

@RaphaelFakhri

Copy link
Copy Markdown

spoom srb bump DIRECTORY filters files with file.start_with?(directory). Because the check doesn't require a path separator, spoom srb bump lib/b also bumps files under lib/bb/ or lib/b_legacy/.

This change keeps a file only if it is DIRECTORY itself or sits below DIRECTORY/. Passing a single file path still works.

Tests

Added test_bump_doesnt_change_sigils_in_sibling_directory_with_same_prefix. It fails on main (Bumped 2 files, including lib/bb/file.rb) and passes with this change. bin/test test/spoom/cli/srb/bump_test.rb passes (33 tests), and rubocop and srb tc are clean.

Fixes #1037

`spoom srb bump DIRECTORY` selected files with a plain string prefix
check, so `spoom srb bump lib/b` also bumped files under `lib/bb/`.
Match the directory itself or paths below it instead.
@RaphaelFakhri
RaphaelFakhri requested a review from a team as a code owner October 21, 2026 06:47
@RaphaelFakhri

Copy link
Copy Markdown
Author

I have signed the CLA.

This branch has not been deployed

No deployments
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.

spoom srb bump DIRECTORY bumps files outside DIRECTORY

1 participant