Minimal docker images for linting Python files in CI based on Alpine Linux.
This container can be pulled with:
docker pull linedwell/pylint
Tag Name | Dockerfile | Compressed Size |
---|---|---|
py2 | py2/Dockerfile | Size: 27 MB |
py3 | py3/Dockerfile | Size: 39 MB |
This container is designed for running python lint checks on GitLab CI and similars. The following packages are installed:
- python 2.7.17 (for py2) or python 3.8.1 (for py3)
- pylint
- pylint-exit
docker run --rm -v $(pwd):/code -w "/code" linedwell/pylint:py2 \
pylint --output-format=colorized --reports=y \
path/to/python/files
As pylint uses exit code to report analysis results (such as refactoring advices) you can first redirect your pylint exit to pylint-exit in order to have 0 as exit code if no fatal error has been found:
docker run --rm -v $(pwd):/code -w "/code" linedwell/pylint:py2 \
pylint --output-format=colorized --reports=y \
path/to/python/files || pylint-exit $?