python/flake8¶
Configure a job to scan a Python project for issues using Flake8.
Description¶
This component configures a single job called flake8-code_quality that installs flake8, and then runs the tool to produce a GitLab Code Quality report.
Usage¶
include:
- component: git.ligo.org/computing/gitlab/components/python/flake8@<VERSION>
Inputs¶
| Input | Default value | Description |
|---|---|---|
flake8_options | "" | Extra options to pass to flake8 |
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 flake8 customisation should be handled via the supported configuration files; probably one of pyproject.toml or .flake8.
For details, see https://flake8.pycqa.org/en/stable/user/configuration.html.
Examples¶
Scan a Python project¶
Scan a Python project
include:
- component: git.ligo.org/computing/gitlab/components/python/flake8@<VERSION>
Install extra requirements¶
To install extra requirements, use the requirements input, passing arguments as accepted by pip:
Scan a project with extra requirements
include:
- component: git.ligo.org/computing/gitlab/components/python/flake8@<VERSION>
inputs:
requirements: "-r requirements.txt"