Skip to content

TheDataShed/pre-commit-diff-cover

Repository files navigation

pre-commit-diff-cover

pre-commit

A pre-commit hook to ensure you have adequate test coverage for your new or modified Python code.

Under the hood this uses:

Usage

  - repo: https://github.com/TheDataShed/pre-commit-diff-cover
    rev: v0.0.1
    hooks:
    - id: diff-cover

How to Use Arguments

There are a few different arguments this hook will accept.

    hooks:
    - id: diff-cover
      args: [--quiet, --quick, --fail-under=100]

--quiet

As the name suggests, reduces the output from the underlying tooling.

Note: output is only shown if this pre-commit fails

--quick

Runs pytest with a number of arguments to speed up the execution e.g. --last-failed-no-failures=none which skips unchanged tests that passed last run.

--fail-under

Defaults to 100%

Fail the pre-commit check if the coverage percentage is below the specified threshold.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages