]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
ci: Force python formatting with ruff
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 12 Nov 2025 12:46:51 +0000 (13:46 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Fri, 13 Mar 2026 14:06:11 +0000 (15:06 +0100)
.github/workflows/codeql-analysis.yml
.ruff.toml [new file with mode: 0644]

index a82795b6483514841bc1e9c988c18c9c969756df..8abc12222e5ae0b917f7e2e0e317b0394b73c9de 100644 (file)
@@ -290,3 +290,17 @@ jobs:
         fetch-depth: 2
         persist-credentials: false
     - run: if [[ "$(file -i --dereference $(git diff --name-only HEAD^..HEAD -- . :^fuzzing/corpus) | grep binary | grep -v 'image/' | grep -v 'inode/x-empty' | grep -v 'inode/directory' | grep -v '^modules/lmdbbackend/test-assets/' | grep -v '^website/docs.powerdns.com/website/fonts/' | grep -v '^website/docs.powerdns.com/website/img/' | grep -v '^modules/tinydnsbackend/data.cdb' | tee /dev/stderr)" != "" ]]; then exit 1; fi
+
+  check-python-formatting:
+    runs-on: ubuntu-22.04
+    name: Check formatting of Python scripts
+    if: ${{ github.event_name == 'pull_request' }}
+    steps:
+    - name: Checkout repository
+      uses: actions/checkout@v5
+      with:
+        fetch-depth: 0
+        persist-credentials: false
+    - uses: astral-sh/ruff-action@v3
+      with:
+        args: 'format --check --diff'
diff --git a/.ruff.toml b/.ruff.toml
new file mode 100644 (file)
index 0000000..d8ac7f0
--- /dev/null
@@ -0,0 +1,4 @@
+line-length = 120
+
+[format]
+exclude = ["builder/*"]