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

Automatically ignore lines containing just an ellipsis #1476

Closed
nickeldan opened this issue Oct 19, 2022 · 1 comment
Closed

Automatically ignore lines containing just an ellipsis #1476

nickeldan opened this issue Oct 19, 2022 · 1 comment
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@nickeldan
Copy link

It is common practice, when defining a typing.Protocol, to put in an ellipsis as a method stub:

class Proto(typing.Protocol):
    def func(self) -> int:
        ...

Since the stubs are never actually called, I have to manually put # pragma: no cover after each ellipsis.

Would it make sense for coverage to automatically not cover a line that is just an ellipsis?

@nickeldan nickeldan added enhancement New feature or request needs triage labels Oct 19, 2022
@nedbat
Copy link
Owner

nedbat commented Oct 20, 2022

You don't have to add a comment to each line. You can add to your exclude_lines setting:

[report]
exclude_lines:
    ^\s+\.\.\.

Keep in mind that you have to also add the default settings here as well, since your setting will override the defaults.

@nedbat nedbat added wontfix This will not be worked on and removed needs triage labels Oct 20, 2022
@nedbat nedbat closed this as not planned Won't fix, can't repro, duplicate, stale Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants