-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathruff.toml
More file actions
61 lines (51 loc) · 1.6 KB
/
ruff.toml
File metadata and controls
61 lines (51 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Ruff configuration file
# Documentation: https://docs.astral.sh/ruff/
# Exclude a variety of commonly ignored directories
exclude = [
".git",
".git-rewrite",
".ipynb_checkpoints",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".venv",
".vscode",
"_build",
"build",
"site-packages",
"venv",
]
# Same as Black
line-length = 88
indent-width = 4
target-version = "py311"
# [lint]
# E pycodestyle
# F pyflakes
# I import sorting (isort-compatible)
# B flake8-bugbear (common bug patterns)
# W warnings
# UP pyupgrade (modernize syntax)
lint.select = ["E","F","I","B","W","UP"]
# Rules to ignore:
# E203 whitespace before ':' (Black-compatible)
# E501 line length (Black handles line wrapping)
# UP006 keep typing.List instead of converting to list (PEP 585)
# UP007 keep typing.Dict instead of converting to dict (PEP 585)
# UP035 keep typing.Optional instead of converting to | None (PEP 604)
# UP045 keep Optional[X] instead of converting to X | None
lint.ignore = ["E203","E501","UP006","UP007","UP035","UP045", "B006"]
# Prevent autofix from applying these rules even when using --fix
lint.unfixable = ["UP006", "UP007", "UP035", "UP045"]
[format]
# Like Black, use double quotes for strings
quote-style = "double"
# Like Black, respect magic trailing commas
# When false, trailing commas force multi-line formatting
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending
line-ending = "auto"
# Prefer multi-line formatting for collections
# This prevents collapsing dictionaries/lists that fit on one line
preview = true