-
-
Notifications
You must be signed in to change notification settings - Fork 448
adding ... (the ellipsis) to exclude_lines ignores all source #1042
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
Comments
|
Sure, I wonder if there should be a blacklist of regexes? |
I could make a deny list that included "...", but:
|
|
Since a corrected regular expression hasn't been mentioned yet I'd suggest the following: ellipsis with leading whitespace: Can be added to [tool.coverage.report]
exclude_lines = ['^\s*\.\.\.'] Or [report]
exclude_lines =
^\s*\.\.\. Excludes the def foo():
... # comment But doesn't exclude general uses of foo = ...
def baz(
x = ...,
):
"""..."""
pass # ...
baz(...) The only problematic code I can think of is an ellipsis within a multi-line statement: foo = (
...,
)
bar = (
...
)
"""
...
""" Perhaps the docs could mention this regular expression as the correct way of excluding |
Thanks for the suggestion @HexDecimal. Just adding to this that I had to use |
It looks like |
I'd go far as far to suggest that The Python documentation frequently uses literal Then |
Describe the bug
Adding this to
.coveragerc
results in all source being ignored:To Reproduce
How can we reproduce the problem? Please be specific. Don't just link to a failing CI job. Answer the questions below:
rm -f .coverage && coverage run -m pytest && coverage report
Expected behavior
Only lines of the following form to be excluded from coverage checking:
Additional context
The results of the output from this bug are super confusing:
...but I guess that makes sense in the context of the ellipsis causing all lines to be excluded.
The text was updated successfully, but these errors were encountered: