Skip to content

python/type-checking

Configure a job to run a static type checker against a Python project for issues using mypy.

Description

This component configures a single job called type-checking that installs mypy, and then runs the tool.

Usage

include:
  - component: git.ligo.org/computing/gitlab/components/python/type-checking@<VERSION>

Inputs

Input Default value Description
project_dir "." Python project path to scan
python "python" Name of the Python interpreter to call
requirements None Extra requirements to install with pip.
stage "test" Pipeline stage to add job to.

Customisation

All mypy customisation should be handled via the supported configuration files; probably one of pyproject.toml, setup.cfg or mypy.ini.

For details, see https://mypy.readthedocs.io/en/stable/config_file.html.

Examples

Scan a Python project

include:
  - component: git.ligo.org/computing/gitlab/components/python/type-checking@<VERSION>