stages: - stylecheck .conda_env: &conda_env before_script: # update conda - conda config --set always_yes yes - conda update -q conda # create and activate environment - conda create -q -n testenv_${CI_PIPELINE_ID}_${CI_JOB_NAME}_py${PYTHON_VERSION_TO_USE//./} python=${PYTHON_VERSION_TO_USE} - source activate testenv_${CI_PIPELINE_ID}_${CI_JOB_NAME}_py${PYTHON_VERSION_TO_USE//./} after_script: # remove environment - conda env remove --name testenv_${CI_PIPELINE_ID}_${CI_JOB_NAME}_py${PYTHON_VERSION_TO_USE//./} style_check: <<: *conda_env stage: stylecheck only: - triggers - master - schedules variables: PYTHON_VERSION_TO_USE: "3.7" script: # install packages - conda install -q pycodestyle pylint # check style using pep8 - pycodestyle --show-source --show-pep8 . # check style using pylint (without taking into account) - find . -name "*.py" | xargs pylint --rcfile=$CI_PROJECT_DIR/.pylintrc || true