#!/usr/bin/env python3

pre_commit_check.py - Run a series of checks that should all pass before submitting a pull request

In a perfect world, these would also pass before every commit.

Imports

These are listed in the order prescribed by PEP 8.

Standard library

None.

Third-party imports

None.

Local application imports

from webperf3.ci_utils import xqt, pushd
 
 

Checks

def checks():
    xqt(

fmt: off

        "black --check .",
        "flake8",
        "mypy --install-types --non-interactive",
        "pytest",

fmt: on

    )
    with pushd(".."):
        xqt(

Check the docs. Again, these only require fixes to comments, and should still be relatively easy to correct.

Force a full build:

-E

Don’t use a saved environment (the structure caching all cross-references), but rebuild it completely.

-a

If given, always write all output files.

            "sphinx-build -E -a . _build",
        )


if __name__ == "__main__":
    checks()