Skip to content

Commit 44732e8

Browse files
authored
Added ruff settings and pre-commit hook (#33)
Solves #32 Ruff does the following now: - Limits lines to 88 characters - Formats code with double quotes - Uses LF (\n) line endings - Enforces 4-space indentation - Formats code blocks inside docstrings I also added a pre-commit hook to automatically format the code according to Ruff's rules
1 parent 76afd4a commit 44732e8

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.11.0
4+
hooks:
5+
- id: ruff-format
6+
- id: ruff
7+
args: [--fix]

pyproject.toml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@ dependencies = [
1919
[project.optional-dependencies]
2020
dev = [
2121
"ruff>=0.12.0",
22-
"black>=25.0",
23-
"pytest>=8.0.0"
22+
"pytest>=8.0.0",
23+
"pre-commit"
2424
]
25+
26+
[tool.ruff]
27+
line-length = 88
28+
target-version = "py310" # Match your `>=3.10` requirement
29+
30+
# Choose what to check for
31+
select = ["E", "F", "B", "I", "UP", "N", "C4"]
32+
33+
exclude = ["__pycache__", ".venv", "build", "dist", ".git"]
34+
35+
[tool.ruff.format]
36+
quote-style = "double"
37+
line-ending = "lf"
38+
indent-style = "space"
39+
docstring-code-format = true

0 commit comments

Comments
 (0)