diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..b6911b2d09cab85aa2c7383dfb7596795fd3e490
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,14 @@
+repos:
+  - repo: https://github.com/astral-sh/ruff-pre-commit
+    # Ruff version.
+    rev: v0.1.15
+    hooks:
+      # Run the linter.
+      - id: ruff
+        args:
+          - --fix
+          - --preview
+      # Run the formatter.
+      - id: ruff-format
+        args:
+          - --preview