From b5d3fa9e85ea000ad57bb86c6446b852deff5f80 Mon Sep 17 00:00:00 2001 From: Pierre Le Marre Date: Fri, 12 Jul 2024 10:36:33 +0200 Subject: [PATCH] ci: Add ruff-format check - Add CI step - Fix errors --- .github/workflows/linux.yml | 5 ++++- scripts/perfect_hash.py | 1 + test/symbols-leak-test.py | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 46fae9fe0..799be4cd1 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -26,7 +26,7 @@ jobs: python-version: '3.12' - name: Install dependencies run: | - python -m pip install --upgrade meson PyYAML + python -m pip install --upgrade meson PyYAML ruff sudo apt update sudo apt install -y \ doxygen libxcb-xkb-dev valgrind ninja-build \ @@ -81,3 +81,6 @@ jobs: name: doxygen-docs path: | build/html/ + - name: Ruff format + run: + ruff format --line-length=88 --check --diff . diff --git a/scripts/perfect_hash.py b/scripts/perfect_hash.py index a017bb659..f70adf8ae 100644 --- a/scripts/perfect_hash.py +++ b/scripts/perfect_hash.py @@ -75,6 +75,7 @@ with a new graph, and thereby discarding the vertex values from the failed attempt. """ + from __future__ import absolute_import, division, print_function import sys diff --git a/test/symbols-leak-test.py b/test/symbols-leak-test.py index 4fee7475e..6915780d1 100755 --- a/test/symbols-leak-test.py +++ b/test/symbols-leak-test.py @@ -4,6 +4,7 @@ If this fails, please update the appropriate .map file (adding new version nodes as needed). """ + import os import pathlib import re