Add Ruff as a formatter

It's complimented by `add-trailing-comma` for better readability and
uses a double run to settle one the final format seamlessly.
This commit is contained in:
Sviatoslav Sydorenko
2025-07-22 00:43:55 +02:00
parent 4bca5f6b0b
commit cd93380190
2 changed files with 30 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
---
ci:
autoupdate_schedule: quarterly # low frequency to reduce maintenance noise
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit.git
rev: v0.12.4
hooks:
- id: ruff-format
alias: ruff-format-first-pass
name: ruff-format (first pass)
- repo: https://github.com/asottile/add-trailing-comma.git
rev: v3.2.0
hooks:
- id: add-trailing-comma
- repo: https://github.com/astral-sh/ruff-pre-commit.git
rev: v0.12.4
hooks:
- id: ruff-format
alias: ruff-format-second-pass
name: ruff-format (second pass)
...
+4
View File
@@ -0,0 +1,4 @@
line-length = 79 # Accessibility-friendly
[format]
quote-style = "single"