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

Option to omit empty files (e.g. __init__.py) #315

Closed
nedbat opened this issue Jul 10, 2014 · 3 comments
Closed

Option to omit empty files (e.g. __init__.py) #315

nedbat opened this issue Jul 10, 2014 · 3 comments
Labels
enhancement New feature or request run

Comments

@nedbat
Copy link
Owner

nedbat commented Jul 10, 2014

Originally reported by Daniel Hahler (Bitbucket: blueyed, GitHub: blueyed)


It would be nice if empty files (especially __init__.py) could be ignored, e.g. via an option omit-empty.

Ref: #1/empty-__init__py-files-are-reported-as-1


@nedbat
Copy link
Owner Author

nedbat commented Jul 10, 2014

Original comment by Alexander Walters (Bitbucket: sdamon, GitHub: sdamon)


The referenced issue is resolved, and I have not seen empty files as being reported. Coverage covers lines, if there are no lines, then there is nothing to hit or miss with. I think you have stumbled onto either a new bug or found some smell in your own code.

@nedbat
Copy link
Owner Author

nedbat commented Jul 10, 2014

@sdamon Issue #1 was about empty files claiming to have one statement, the fix made them have zero statements, but they are still reported. I suspect @blueyed is using the --source option, which makes completely unexecuted files appear in reports. I like the idea of skipping empty files if they are pulled in via the --source switch.

@nedbat
Copy link
Owner Author

nedbat commented Nov 23, 2014

Changeset b7762d1a6614 (bb) introduces the report --skip-covered option, which will skip any file with 100% coverage. Since empty __init__.py files are 100% covered, does this satisfy your use case?

@nedbat nedbat closed this as completed Jan 22, 2015
@nedbat nedbat added major enhancement New feature or request run labels Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request run
Projects
None yet
Development

No branches or pull requests

1 participant