diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index cfaeb61c55..fc29f02e6a 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -80,6 +80,11 @@ repos:
     rev: v1.1.2
     hooks:
       - id: doc8
+  - repo: https://github.com/astral-sh/ruff-pre-commit
+    rev: v0.7.3
+    hooks:
+      - id: ruff
+        args: ['--fix', '--unsafe-fixes']
   - repo: local
     hooks:
       - id: check-releasenotes
diff --git a/pyproject.toml b/pyproject.toml
index a9362f7167..99b3dad22e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,3 +4,22 @@ build-backend = "pbr.build"
 
 [tool.doc8]
 ignore = ["D001"]
+
+[tool.ruff]
+line-length = 79
+
+[tool.ruff.lint]
+select = [
+    "E",        # pycodestyle (error)
+    "F",        # pyflakes
+    "G",        # flake8-logging-format
+    "LOG",      # flake8-logging
+]
+
+[tool.ruff.lint.per-file-ignores]
+"ironic/tests/**/*.py" = [
+    "E402",     # module-import-not-at-top-of-file
+]
+"ironic/drivers/modules/drac/raid.py" = [
+    "G003",     # Logging statement uses `+`
+]