Skip to content

Add configurable mutants_dir option - #648

Open
danrneal wants to merge 1 commit into
boxed:mainfrom
danrneal:feat/mutants-dir
Open

danrneal wants to merge 1 commit into
boxed:mainfrom
danrneal:feat/mutants-dir

Conversation

@danrneal

Copy link
Copy Markdown

Hardcoding ./mutants/ pollutes project roots, lets pytest accidentally collect generated files, and blocks running against read-only source directories or out-of-tree caches.

Add a mutants_dir option in pyproject.toml and setup.cfg (defaulting to "mutants") and default log_file_path under it when unset. Route generation, execution, coverage, cache, and CLI paths through get_mutants_dir(), which returns the loaded config value when available and otherwise reads mutants_dir directly without requiring source_paths resolution.

Key edge cases handled:

  • Resolve paths consistently for coverage.py and pass source when mutants_dir lives outside the project root (including ../ and symlinked paths such as /tmp on macOS).
  • Exclude in-repo mutants_dir paths from git dependency-change detection so unignored caches do not invalidate incremental runs.
  • Reject empty, non-string, project-root, ancestor, or source_paths/also_copy-overlapping mutants_dir values.

Hardcoding ./mutants/ pollutes project roots, lets pytest accidentally collect generated files, and blocks running against read-only source directories or out-of-tree caches.

Add a mutants_dir option in pyproject.toml and setup.cfg (defaulting to "mutants") and default log_file_path under it when unset. Route generation, execution, coverage, cache, and CLI paths through get_mutants_dir(), which returns the loaded config value when available and otherwise reads mutants_dir directly without requiring source_paths resolution.

Key edge cases handled:
- Resolve paths consistently for coverage.py and pass source when mutants_dir lives outside the project root (including ../ and symlinked paths).
- Exclude in-repo mutants_dir paths from git dependency-change detection so unignored caches do not invalidate incremental runs.
- Reject empty, non-string, project-root, ancestor, or source_paths/also_copy-overlapping mutants_dir values.
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