Skip to content

Latest commit

 

History

History
49 lines (32 loc) · 1.29 KB

README.md

File metadata and controls

49 lines (32 loc) · 1.29 KB

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.