fix: wire --regex-pattern through the CLI (#175)#180
Open
patchwright wants to merge 1 commit into
Open
Conversation
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.
Fixes #175.
Problem
The CLI defines
--regex-patterninparse_args, butslugify_params()never passesregex_patterntoslugify()— every other argument is wired except that one. So the flag is silently dropped:(@peter-bloomfield reported it; @jdevera confirmed the missing wiring.)
Fix
Add
regex_pattern=args.regex_patternto theslugify_params()dict.argparsealready defaults it toNonewhen the flag is absent, which matchesslugify()'s own default, so existing behavior is unchanged.Tests
regex_patterntoTestCommandParams.DEFAULTSsotest_defaultsnow covers it.test_regex_pattern: the flag flows through to params.test_regex_pattern_end_to_end: reproduces the exact example from --regex-pattern option ignored by CLI #175 and asserts___this-is-a-test___.Both new tests fail on the current
main(KeyError / wrong output) and pass with the fix. Full suite: 84 passed.