Linters#
This is a “sub-pipeline” for linting new changes that have been made to python files of a specific GitLab project.
Triggers#
All jobs from python “sub-pipeline” stages are triggered only on merge requests and only if changes have been made to python files. Right now such files are detected by these patterns:
**/*.py
.
Jobs overview#
check:python:black#
This job executes black only on changed python files (not diff, but files) which will diagnose and fix style violations.
- ARTIFACTS
Job will generate a patch file with corrected lines.
ENVIRONMENT
Name |
Necessity |
---|---|
BPROTO_CI_LINTER_TRACE |
Optional |
BPROTO_CI_MERGE_REQUEST_CHANGED_FILES |
Mandatory |
- IMAGES
- STAGE
- TRIGGERS
Job is triggered only on merge requests when any file from trigger list is changed.
check:python:flake8#
This job executes flake8 only on changed python files (not diff, but files) which will diagnose and fix style violations, or bugs that can be deduced via static analysis.
- ARTIFACTS
Job will generate a simple log file with all found issues.
- CONFIG
Configuration file is located at the root of the repository and has
.flake8
name.
ENVIRONMENT
Name |
Necessity |
---|---|
BPROTO_CI_LINTER_TRACE |
Optional |
BPROTO_CI_MERGE_REQUEST_CHANGED_FILES |
Mandatory |
- IMAGES
- STAGE
- TRIGGERS
Job is triggered only on merge requests when any file from trigger list is changed.
check:python:isort#
This job executes isort only on changed python files (not diff, but files) which will diagnose and fix issues related to python imports.
Different configuration options can be found on official page
- ARTIFACTS
Job will generate a patch file with corrected lines.
- CONFIG
isort
for each input file will try to find the.isort.cfg
file located in the closest parent directory of the input file.
ENVIRONMENT
Name |
Necessity |
---|---|
BPROTO_CI_LINTER_TRACE |
Optional |
BPROTO_CI_MERGE_REQUEST_CHANGED_FILES |
Mandatory |
- IMAGES
- STAGE
- TRIGGERS
Job is triggered only on merge requests when any file from trigger list is changed.