From a0c5c09e9b5b22f73e50a599d62ddabaa5c11022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 19 Dec 2024 22:07:46 +0100 Subject: [PATCH] ci: Run ruff check/format on gdctl Use a CI job using ruff that enforces the coding style to follow `ruff format --line-length 80`, and that no new linting issues appear using `ruff check`. Part-of: --- .gitlab-ci.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2fc3b1ec0..9b3081639 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -105,7 +105,7 @@ variables: - .skip-git-clone variables: FDO_DISTRIBUTION_VERSION: 41 - BASE_TAG: '2025-01-28.0' + BASE_TAG: '2025-01-29.0' MUTTER_USER: 'meta-user' FDO_DISTRIBUTION_PACKAGES: clang @@ -124,6 +124,7 @@ variables: zenity python3-dbusmock gnome-desktop-testing + ruff FDO_DISTRIBUTION_EXEC: | set -e @@ -347,7 +348,7 @@ build-fedora-container@aarch64: - !reference [.pipeline-guard, rules] when: manual -check-code-style: +check-c-code-style: extends: - .mutter.distribution-image - .mutter.fedora@x86_64 @@ -367,6 +368,23 @@ check-code-style: rules: - !reference [.only-merge-requests, rules] +check-python-code-style: + extends: + - .mutter.distribution-image + - .mutter.fedora@x86_64 + variables: + PYTHON_FILES: + tools/gdctl + stage: code-review + needs: + - job: build-fedora-container@x86_64 + artifacts: false + script: + - ruff format --line-length 80 --check $PYTHON_FILES + - ruff check $PYTHON_FILES + rules: + - !reference [.only-merge-requests, rules] + .build-mutter-base: variables: BASE_MESON_OPTIONS: