Commit c058ca44 authored by Ruben ten Hove's avatar Ruben ten Hove
Browse files

fix: path exclusion

parent a7fdd296
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -84,6 +84,20 @@ jobs:python:
      changes:
        - python/**/*

jobs:python:no-exclude:
  stage: test
  variables:
    PYTHON_EXCLUDE_PATHS: ""
    PYTHON_EXCLUDE_REGEX: ""
  trigger:
    include:
      - local: tests/jobs/python.yml
    strategy: depend
  rules:
    - if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
      changes:
        - python/**/*

jobs:python:old:
  stage: test
  variables:
+4 −2
Original line number Diff line number Diff line
@@ -14,8 +14,10 @@ python:bandit:
    JOB_PACKAGE: bandit
  script:
    - !reference [".python:pre", script]
    - BANDIT_EXCLUDE_PATHS="./$(echo ${PYTHON_EXCLUDE_PATHS} | sed
      's/\,/\,\.\//g')"
    - |
      if [ "${PYTHON_EXCLUDE_PATHS}" != "" ]; then
        BANDIT_EXCLUDE_PATHS="./$(echo ${PYTHON_EXCLUDE_PATHS} | sed 's/\,/\,\.\//g')"
      fi
    - bandit --version
    - bandit --verbose --recursive . --exclude "${BANDIT_EXCLUDE_PATHS}" --skip
      "${BANDIT_SKIP_CHECK}" ${BANDIT_EXTRA_ARGS}
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ include:
  - local: python/generic.yml

variables:
  LIZARD_DEFAULT_ARGS: --verbose -Eduplicate --exclude ${PYTHON_EXCLUDE_PATHS}
  LIZARD_DEFAULT_ARGS: --verbose -Eduplicate --exclude "${PYTHON_EXCLUDE_PATHS}"

python:lizard:
  extends: .python:pre
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ python:mypy:
    - mypy --version
    - mypy --install-types --non-interactive --junit-xml
      ${CI_PROJECT_DIR}/mypy-report.xml ${MYPY_DEFAULT_ARGS} ${MYPY_EXTRA_ARGS}
      ${MYPY_TARGET:-.} --exclude "${PYTHON_EXCLUDE_REGEX}"
      ${MYPY_TARGET:-.} --exclude "${PYTHON_EXCLUDE_REGEX:-(?!)}"
  artifacts:
    reports:
      junit: mypy-report.xml
+8 −3
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ include:
  - local: python/generic.yml

variables:
  PYCLN_DEFAULT_ARGS: --check --all
  PYCLN_DEFAULT_ARGS: --all --expand-stars
  PYCLN_EXTRA_ARGS: ""

python:pycln:
@@ -15,6 +15,11 @@ python:pycln:
  script:
    - !reference [".python:pre", script]
    - pycln --version
    - pycln ${PYCLN_DEFAULT_ARGS} ${PYCLN_EXTRA_ARGS} . || (echo "[!] Problems
      found. Run 'pycln .' in your source directory to fix these." && exit 1)
    - pycln --check --diff ${PYCLN_DEFAULT_ARGS} ${PYCLN_EXTRA_ARGS}
      --extend-exclude "${PYTHON_EXCLUDE_REGEX:-($^)}" .
  after_script:
    - |
      if [ ${CI_JOB_STATUS} != "success" ]; then
        echo "Run 'pycln ${PYCLN_DEFAULT_ARGS} ${PYCLN_EXTRA_ARGS} --extend-exclude "${PYTHON_EXCLUDE_REGEX:-($^)}" .' in your source directory to fix these."
      fi
  needs: []
Loading