scripts: Add helper scripts for ruff baseline excludes

Add simple scripts to convert ruff check and ruff format output to
toml exclude sections.

These sections can be used to ignore baseline violations for an existing
codebase.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
diff --git a/scripts/ruff/gen_format_exclude.py b/scripts/ruff/gen_format_exclude.py
new file mode 100755
index 0000000..6f3b093
--- /dev/null
+++ b/scripts/ruff/gen_format_exclude.py
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+
+# Copyright (c) 2024 Basalte bv
+# SPDX-License-Identifier: Apache-2.0
+
+import sys
+
+# A very simple script to convert ruff format output to toml
+# For example:
+# ruff format --check | ./scripts/ruff/gen_format_exclude.py >> .ruff-excludes.toml
+
+if __name__ == "__main__":
+    sys.stdout.write("[format]\n")
+    sys.stdout.write("exclude = [\n")
+    for line in sys.stdin:
+        if line.startswith("Would reformat: "):
+            sys.stdout.write(f'    "./{line[16:-1]}",\n')
+    sys.stdout.write("]\n")