Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support mutating changed lines only #316

Open
NouemanKHAL opened this issue Apr 9, 2024 · 7 comments
Open

Support mutating changed lines only #316

NouemanKHAL opened this issue Apr 9, 2024 · 7 comments

Comments

@NouemanKHAL
Copy link

NouemanKHAL commented Apr 9, 2024

It would be more convenient to run something like mutmut run --diff-only without having to manually generate the patch file and use the --use-patch flag.

Some kind of wrapper on top of the --use-patch implementation.

Related to #43

@boxed
Copy link
Owner

boxed commented Apr 9, 2024

Mutmut already does this if you have run a complete mutmut round first.

@NouemanKHAL
Copy link
Author

NouemanKHAL commented Apr 9, 2024

Is that necessary? It's definitely not practical / feasible for large projects...

@boxed
Copy link
Owner

boxed commented Apr 9, 2024

I guess you could argue for a command that fills the entire mutmut cache with "skipped" for all mutants. Then after that you would get the change mode automatically.

@NouemanKHAL
Copy link
Author

I like the idea! However, does that require generating all the mutants? I assume there would be some kind of hashing mechanism to keep track of each mutant.

@boxed
Copy link
Owner

boxed commented Apr 9, 2024

Well.. yea all the mutants are "generated" on startup in memory. Then they get IDs based on the cache db.

@NouemanKHAL
Copy link
Author

Would be done in reasonable time in large projects?

@boxed
Copy link
Owner

boxed commented Apr 10, 2024

I don't know what you mean by reasonable or large :) But you can try it. If you do mutmut run and suppy --test-time-base it won't run the initial test run. So as soon as you get the number of mutants starting to count up from zero it will have done this work.

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

No branches or pull requests

2 participants