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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
This commit is contained in:
Jonas Ådahl 2024-12-19 22:07:46 +01:00 committed by Marge Bot
parent 3cc5d201a2
commit a0c5c09e9b

View File

@ -105,7 +105,7 @@ variables:
- .skip-git-clone - .skip-git-clone
variables: variables:
FDO_DISTRIBUTION_VERSION: 41 FDO_DISTRIBUTION_VERSION: 41
BASE_TAG: '2025-01-28.0' BASE_TAG: '2025-01-29.0'
MUTTER_USER: 'meta-user' MUTTER_USER: 'meta-user'
FDO_DISTRIBUTION_PACKAGES: FDO_DISTRIBUTION_PACKAGES:
clang clang
@ -124,6 +124,7 @@ variables:
zenity zenity
python3-dbusmock python3-dbusmock
gnome-desktop-testing gnome-desktop-testing
ruff
FDO_DISTRIBUTION_EXEC: | FDO_DISTRIBUTION_EXEC: |
set -e set -e
@ -347,7 +348,7 @@ build-fedora-container@aarch64:
- !reference [.pipeline-guard, rules] - !reference [.pipeline-guard, rules]
when: manual when: manual
check-code-style: check-c-code-style:
extends: extends:
- .mutter.distribution-image - .mutter.distribution-image
- .mutter.fedora@x86_64 - .mutter.fedora@x86_64
@ -367,6 +368,23 @@ check-code-style:
rules: rules:
- !reference [.only-merge-requests, 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: .build-mutter-base:
variables: variables:
BASE_MESON_OPTIONS: BASE_MESON_OPTIONS: