From de5538a40f5d706a1f7dee7a2361be32ff2760c1 Mon Sep 17 00:00:00 2001 From: Joakim Saario Date: Sun, 21 Aug 2022 22:16:52 +0200 Subject: [PATCH] ci(lint): Use pre-commit --- .gitlab-ci.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 98f99ae3..7134673c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,18 +13,16 @@ variables: LOG_CONFIG: logging.test.conf lint: - variables: - # Space-separated list of directories that should be linted. - REQUIRES_LINT: "aurweb test migrations" stage: .pre before_script: - pacman -Sy --noconfirm --noprogressbar --cachedir .pkg-cache archlinux-keyring - pacman -Syu --noconfirm --noprogressbar --cachedir .pkg-cache - python python-isort flake8 + git python python-pre-commit script: - - bash -c 'flake8 --count $(echo "$REQUIRES_LINT" | xargs); exit $?' - - bash -c 'isort --check-only $(echo "$REQUIRES_LINT" | xargs); exit $?' + # https://github.com/pre-commit/pre-commit/issues/2178#issuecomment-1002163763 + - export SETUPTOOLS_USE_DISTUTILS=stdlib + - pre-commit run -a test: stage: test