Skip to content

Add configurable mutation type filtering - #579

Open
nabi-noor wants to merge 1 commit into
boxed:mainfrom
nabi-noor:feat/configurable-mutation-types
Open

nabi-noor wants to merge 1 commit into
boxed:mainfrom
nabi-noor:feat/configurable-mutation-types

Conversation

@nabi-noor

Copy link
Copy Markdown

Adds stable dotted names to the mutation registry and a disable_mutation_types configuration option. Exact names disable one mutation, while prefixes disable a group; for example, string.lower removes only lowercase literal mutations and string removes every string mutation.

The filtering happens before an operator runs. Configuration changes also invalidate cached mutant verdicts because removing a mutation can shift the numeric IDs of later mutants in the same function.

This PR intentionally focuses on disabling types, which solves the reported equivalent-mutant problem without defining potentially surprising precedence between simultaneous allow and deny lists. An enable/override policy can be added separately once those semantics are agreed.

Documentation lists the available names and shows how to disable the two case-flip mutations. Unit coverage exercises exact, grouped, unrelated, invalid, and cache-change behavior; the existing config E2E project verifies that both case flips disappear while the useful string-wrap mutant remains.

Verified with uv run pytest (403 passed, 2 skipped) and uv run pre-commit run --all-files (all hooks passed).

AI assistance disclosure: I used OpenAI Codex while implementing and reviewing this change. The commit includes the corresponding co-author attribution.

Closes #577

Co-Authored-By: OpenAI Codex <codex@openai.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.

String mutations: the two case flips are equivalent wherever the consumer is case-insensitive, and no option turns them off

1 participant