Skip to content

fix: strip one char from wildcard --disable pattern, not two#45

Open
jonbaldie wants to merge 2 commits into
avito-tech:masterfrom
jonbaldie:fix/disable-mutator-pattern
Open

fix: strip one char from wildcard --disable pattern, not two#45
jonbaldie wants to merge 2 commits into
avito-tech:masterfrom
jonbaldie:fix/disable-mutator-pattern

Conversation

@jonbaldie
Copy link
Copy Markdown

The --disable flag strips d[:len(d)-2] when a pattern ends with *, but * is only one character, so a pattern like branch* produces the prefix branc instead of branch and matches nothing.

jonbaldie and others added 2 commits May 14, 2026 11:37
The --disable flag trims d[:len(d)-2] when the pattern ends with '*',
but '*' is only one character, so short names like 'branch*' produce
the wrong prefix ('branc' instead of 'branch').

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extracts the pattern-matching logic into a named function so it can be
tested directly. Adds TestMutatorDisabled which pins the off-by-one
bug: with len(d)-2, a two-char pattern like "b*" produced an empty
prefix and disabled every mutator; len(d)-1 correctly extracts "b".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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