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

coverage isn't supported out of the box #319

Open
akaihola opened this issue Mar 2, 2022 · 0 comments
Open

coverage isn't supported out of the box #319

akaihola opened this issue Mar 2, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@akaihola
Copy link
Owner

akaihola commented Mar 2, 2022

Problem

Darker doesn't support reporting missing test coverage on modified lines out of the box. The cov_to_lint.py script can be used as a linter with darker --lint cov_to_lint.py and it will convert the .coverage SQLite output to a lint output format which Darker understands. But cov_to_lint.py isn't pip installable, and the Darker command line syntax is a bit ugly.

Solution

darker --coverage . to read the .coverage file and report missing coverage on modified lines.

Maybe we could also support specifying the coverage file e.g. with darker --coverage=mycoverage.sqlite ..

Alternatives

We could package cov_to_lint.py so it would be installable using pip install cov-to-lint or even pip install darker[cov-to-lint], and runnable with darker --lint cov-to-lint.

Other

The usual workflow in CI and locally e.g. with pre-commit would be

  • run pytest --cov=mypackage
  • run darker --coverage .
@akaihola akaihola added the enhancement New feature or request label Mar 2, 2022
@akaihola akaihola added this to the 1.6.0 milestone Mar 2, 2022
@akaihola akaihola self-assigned this Mar 2, 2022
@akaihola akaihola added this to To do in Akaihola's Open source work via automation Mar 2, 2022
@akaihola akaihola changed the title Build in coverage support coverage isn't supported out of the box Apr 6, 2022
@akaihola akaihola modified the milestones: 1.6.0, 1.6.1, 1.8.0 Dec 19, 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
Projects
Development

No branches or pull requests

1 participant