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

[mutmut3] --paths-to-mutate support? #339

Open
przybylop opened this issue Oct 24, 2024 · 5 comments
Open

[mutmut3] --paths-to-mutate support? #339

przybylop opened this issue Oct 24, 2024 · 5 comments

Comments

@przybylop
Copy link

mutmut 2.x. had --paths-to-mutate argument support:

mutmut/mutmut/__main__.py

Lines 317 to 318 in bdd8c37

if paths_to_mutate is None:
paths_to_mutate = guess_paths_to_mutate()

whereas it was removed in mutmut 3.x:

mutmut/mutmut/__main__.py

Lines 150 to 151 in e8e0960

def walk_all_files():
paths = [guess_paths_to_mutate()]

but README still mentions it:

mutmut/README.rst

Lines 55 to 59 in e8e0960

.. code-block:: ini
[mutmut]
paths_to_mutate=src/
tests_dir=tests/

and the error message in guess_paths_to_mutate() as well:

mutmut/mutmut/__main__.py

Lines 128 to 131 in e8e0960

raise FileNotFoundError(
'Could not figure out where the code to mutate is. '
'Please specify it on the command line using --paths-to-mutate, '
'or by adding "paths_to_mutate=code_dir" in setup.cfg to the [mutmut] section.')

is the argument going to be reintroduced?

@boxed
Copy link
Owner

boxed commented Oct 24, 2024

No. Arguments for conf was a mistake I think. All the conf should always go into the conf file.

Thanks for the heads up on the docs issue. I will fix that.

@przybylop
Copy link
Author

Thanks for the quick response!

What about the paths_to_mutate argument from config file? mutmut 3.x ignores it as well

@boxed
Copy link
Owner

boxed commented Oct 24, 2024

Oh. Well that is a mistake then. It should make good guesses, but when it fails it should read that.

@awgymer
Copy link

awgymer commented Oct 24, 2024

It should make good guesses, but when it fails it should read that.

Would it not make more sense for it to short-circuit to the conf value if it's set, rather than fall back to it. If it's only used as a fallback it means you can't ever run mutmut in a repo which had e.g. a src folder which did not contain the paths to mutate

@boxed
Copy link
Owner

boxed commented Oct 24, 2024

Sorry, yea I was sloppy with my language. The conf should override for sure.

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

3 participants