---
# pylint checks the quality of your code
# https://www.pylint.org

# Use pyproject.toml to configure pylint. For example:
# [tool.pylint.messages_control]
# disable = ["C0114", "C0115", "unsubscriptable-object", "too-many-lines"]
image: registry.gitlab.com/notno/python-tests

python:pylint:
  stage: test
  variables:
    PYLINT_THRESHOLD: "6"
    EXTRA_ARGS: ""
  script:
    - pip install . || true  # installs package only if available
    - pip install pylint pylint-junit
    - |
      if [ -z "${PYTHON_PACKAGE}" ]; then
        CHECK="$(find ./ -type f -name '*.py' -print)"
      else
        CHECK="${PYTHON_PACKAGE}"
      fi
    - pylint --output-format=pylint_junit.JUnitReporter:${CI_PROJECT_DIR}/pylint-report.xml,colorized --fail-under ${PYLINT_THRESHOLD} ${EXTRA_ARGS} ${CHECK}
  artifacts:
    reports:
      junit: pylint-report.xml
