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

When using --source, --include is silently ignored #265

Closed
nedbat opened this issue Sep 18, 2013 · 13 comments
Closed

When using --source, --include is silently ignored #265

nedbat opened this issue Sep 18, 2013 · 13 comments
Labels
bug Something isn't working

Comments

@nedbat
Copy link
Owner

nedbat commented Sep 18, 2013

Once --source is specified, --include is ignored. If the user specifies both, this shouldn't happen silently. A warning or error is appropriate.


@nedbat
Copy link
Owner Author

nedbat commented Oct 10, 2013

Original comment by Aldo Longhi (Bitbucket: alonghi, GitHub: alonghi)


Would an appropriate fix be to issue a warning (but then still return True) in CoverageScript.args_ok?

@nedbat
Copy link
Owner Author

nedbat commented Oct 11, 2013

@ALonghi Unfortunately, the conflict could be in the configuration file also. And run uses with --source or --include, but "report" uses only --include. I'll have to think more about what is a problem here, and what to do about it.

@nedbat
Copy link
Owner Author

nedbat commented Jun 2, 2016

Original comment by alsopape (Bitbucket: alsopape, GitHub: Unknown)


addressed this issue on the github mirror with a proposed PR #9

@nedbat
Copy link
Owner Author

nedbat commented Dec 16, 2016

Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary)


For the record https://bitbucket.org/ned/coveragepy/pull-requests/105/source-and-include-are-mutually-exclusive/diff should fix this issue

@nedbat
Copy link
Owner Author

nedbat commented Dec 17, 2016

--source and --include are mutually exclusive #265

Add a sanity_check function to CoverageConfig to perform sanity checks
after configuration values have been collected from files, arguments
etc.

Raise an error if --source and --include are both set.

The config tests are amended because some of them have both source and
include set.

Based on the original patch from Nathan Land

close #265

→ <<cset 4aced78ac2a1 (bb)>>

@nedbat
Copy link
Owner Author

nedbat commented Dec 17, 2016

Fixed in 4aced78ac2a1 (bb)

@nedbat
Copy link
Owner Author

nedbat commented Dec 27, 2016

This fix was released as part of Coverage.py 4.3.

@nedbat
Copy link
Owner Author

nedbat commented Dec 28, 2016

Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary)


The fix was incorrect and the regression was reported at https://bitbucket.org/ned/coveragepy/issues/541/coverage-43-breaks-nosetest-with-coverage. It should be re-opened. A proper implementation should separate --include into --run-include & --report-include because the options are not unique to a command / action.

@nedbat
Copy link
Owner Author

nedbat commented Dec 28, 2016

Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary)


Reverted by https://bitbucket.org/ned/coveragepy/commits/d427811cbc79c4845ae2983c12b8775ee3c7859c

@nedbat
Copy link
Owner Author

nedbat commented Dec 28, 2016

Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary)


New draft implementation at https://bitbucket.org/ned/coveragepy/pull-requests/119/source-and-include-are-mutually-exclusive/diff

@nedbat
Copy link
Owner Author

nedbat commented Oct 24, 2017

close #265
close #101

→ <<cset 9519784205ba (bb)>>

@nedbat
Copy link
Owner Author

nedbat commented Oct 24, 2017

Belatedly add a test for #541, so we can fix #265 for real

→ <<cset c986bd0295a9 (bb)>>

@nedbat
Copy link
Owner Author

nedbat commented Oct 24, 2017

This is fixed again in 9519784205ba (bb).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant