From aa619e7ed0aa68f6ff710ed0114e90475770801e Mon Sep 17 00:00:00 2001 From: "duncan.macleod" <duncan.macleod@ligo.org> Date: Mon, 4 Apr 2022 16:29:43 +0100 Subject: [PATCH] ci: always pass flake8 but make sure and review the code quality report! --- .gitlab/ci/analysis.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.gitlab/ci/analysis.yml b/.gitlab/ci/analysis.yml index 6272895..f4b4336 100644 --- a/.gitlab/ci/analysis.yml +++ b/.gitlab/ci/analysis.yml @@ -21,15 +21,20 @@ flake8: # https://computing.docs.ligo.org/gitlab-ci-templates/python/#.python:flake8 - .python:flake8 needs: [] + variables: + # don't fail the pipeline because of linting issues, + # these are presented in the code-quality box in the + # merge_request UI + FLAKE8_OPTIONS: "--exit-zero" before_script: - # pick requirements out of the setup.cfg + # pick requirements out of the metadata - | - REQUIREMENTS=$(python -c " - from configparser import ConfigParser; - cp = ConfigParser(); - cp.read('setup.cfg'); - print(cp['options.extras_require']['lint'].strip())") + REQUIREMENTS=$(${PYTHON} -c " + from setuptools import Distribution + dist = Distribution() + dist.parse_config_files() + for req in dist.extras_require['lint']: + print(req) + ") # install things - !reference [".python:flake8", before_script] - # code quality issues should present a global 'warning' - allow_failure: true -- GitLab