mutmut
mutmut copied to clipboard
[FEATURE] Any plans to make mutmut available as pre-commit hook?
The title is self-explanatory. I'm wondering, Anders, if mutmut can be available as a pre-commit hook.
I think that's a bad idea. Mutmuts incremental mode isn't nearly solid enough for that to work well. It's better to think of mutation testing as something you do once in a while.
If you want to run mutmut as a pre-commit hook you can write your own "system" hook. Here is an example of a pytest hook:
- repo: local
hooks:
- id: run-pytest
description: run pytest
name: run pytest # displayed when hook is executed
entry: python3
args: [-m, pytest, processor/test]
language: system
types: [python]
pass_filenames: false
exclude:
(?x)(
^.vscode/|
^Pipfile.lock$|
^external/ |
^scripts/
)
stages: [push]
Have you tried that? Seems totally crazy to me. Mutmut is just WAY WAY too slow to run as a precommit hook.
No I haven't tried that. Just offering a workaround so this issue can be closed.
Honestly, I should have closed this as "huh what? doesn't make sense" :P