SpecialistOff.NET / Вопросы / Статьи / Фрагменты кода / Резюме / Метки / Помощь / Файлы

Список вопросов Печать

Как подключить линтеры bandit, pylint и pyflakes к GitLab CI?


Метки: gitlab python gitlab ci pylint pyflakes статический анализ кода bandit 

Ответы

RemiZOffAlex  Создано: 2018-11-20 15:21:02.855042  Обновлено: 2018-11-20 15:21:02.855042

Содержимое файла .gitlab-ci.yml

image: python:3.6

stages:
  - build
  - deploy
  - test

before_script:
  - which pip3 && pip3 install pyflakes
  - which pip3 && pip3 install pylint
  - which pip3 && pip3 install bandit

pylint:
  stage: test
  script: |
    FILES=$(find . -name "*.py" | grep -v "ci-scripts/")

    pylint --rcfile=.pylintrc ${FILES}

pyflakes:
  stage: test
  script: |
    FILES=$(find . -name "*.py" | grep -v "ci-scripts/")

    python3.6 -m pyflakes ${FILES}

bandit:
  stage: test
  script: |
    FILES=$(find . -name "*.py" | grep -v "ci-scripts/")

    bandit ${FILES}

Возможно будут интересны и другие вопросы