GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - DeanWay/coverage-threshold: A command line tool for checking coverage reports against configurable coverage minimums.

BranchesTags
Open more actions menu

Latest commit

 

History

101 Commits
101 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
example_project
example_project
 
 
scripts
scripts
 
 
src/coverage_threshold
src/coverage_threshold
 
 
tests
tests
 
 
.bumpversion.cfg
.bumpversion.cfg
 
 
.coveragerc
.coveragerc
 
 
.flake8
.flake8
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
Pipfile
Pipfile
 
 
Pipfile.lock
Pipfile.lock
 
 
README.md
README.md
 
 
mypy.ini
mypy.ini
 
 
pyproject.toml
pyproject.toml
 
 
tox.ini
tox.ini
 
 

Repository files navigation

coverage threshold

A command line tool for checking coverage reports against configurable coverage minimums. Currently built for use around python's coverage

Installation

pip install coverage-threshold

also recommended:

pip install coverage

Usage

Typical execution:

coverage run -m pytest tests/  # or any test runner here
coverage json
coverage-threshold

cli command options:

> coverage-threshold --help
usage: coverage-threshold [-h] [--line-coverage-min LINE_COVERAGE_MIN]
                          [--branch-coverage-min BRANCH_COVERAGE_MIN]
                          [--combined-coverage-min COMBINED_COVERAGE_MIN]
                          [--file-line-coverage-min FILE_LINE_COVERAGE_MIN]
                          [--file-branch-coverage-min FILE_BRANCH_COVERAGE_MIN]
                          [--file-combined-coverage-min FILE_COMBINED_COVERAGE_MIN]
                          [--coverage-json COVERAGE_JSON] [--config CONFIG]

A command line tool for checking coverage reports against configurable coverage minimums

optional arguments:
  -h, --help            show this help message and exit
  --line-coverage-min LINE_COVERAGE_MIN
                        minimum global average line coverage threshold
  --branch-coverage-min BRANCH_COVERAGE_MIN
                        minimum global average branch coverage threshold
  --combined-coverage-min COMBINED_COVERAGE_MIN
                        minimum global average combined line and branch coverage threshold
  --file-line-coverage-min FILE_LINE_COVERAGE_MIN
                        the line coverage threshold for each file
  --file-branch-coverage-min FILE_BRANCH_COVERAGE_MIN
                        the branch coverage threshold for each file
  --file-combined-coverage-min FILE_COMBINED_COVERAGE_MIN
                        the combined line and branch coverage threshold for each file
  --coverage-json COVERAGE_JSON
                        path to coverage json (default: ./coverage.json)
  --config CONFIG       path to config file (default: ./pyproject.toml)

Config

the current expected config file format is toml the default config file used is pyproject.toml but and alternative path can be specified with --config

example config:

[tool.coverage-threshold]
line_coverage_min = 95
file_line_coverage_min = 95
branch_coverage_min = 50

[tool.coverage-threshold.modules."src/cli/"]
file_line_coverage_min = 40

[tool.coverage-threshold.modules."src/cli/my_command.py"]
file_line_coverage_min = 100

[tool.coverage-threshold.modules."src/lib/"]
file_line_coverage_min = 100
file_branch_coverage_min = 100

[tool.coverage-threshold.modules."src/model/"]
file_line_coverage_min = 100

[tool.coverage-threshold.modules."src/__main__.py"]
file_line_coverage_min = 0

Each string key in config.modules is treated as a path prefix, where the longest matching prefix is used to configure the coverage thresholds for each file

About

A command line tool for checking coverage reports against configurable coverage minimums.

Resources

Readme
MIT license
Activity

Stars

17 stars

Watchers

1 watching

Forks

4 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.