-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
80 lines (71 loc) · 2.09 KB
/
pyproject.toml
File metadata and controls
80 lines (71 loc) · 2.09 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
[tool.ruff]
# Exclude commonly ignored directories and add pattern for test files
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
"solutions/",
"**/*_data.py", # Ignore all files ending in _data.py recursively
"**/*_test.py", # Ignore all files ending in _test.py recursively
]
# Line length bumped to 88 (Black default) for modern readability; aligns with PEP 8 flexibility
line-length = 88
indent-width = 4
# Set target version to Python 3.12
target-version = "py312"
[tool.ruff.lint]
# Expanded selection for better PEP coverage: E/W (PEP 8 style), F (flakes), D (PEP 257 docstrings),
# I (imports), UP (upgrades), B (bugbear), TYP (typing for PEP 484)
select = ["E", "W", "F", "D", "I", "UP", "B", "TYP"]
# Ignore optional docstring rules (e.g., no module/package docstrings for simple exercises)
ignore = ["D100", "D104", "D106"]
# Allow fixes for all enabled rules when --fix is provided
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.pydocstyle]
# Explicitly use PEP 257 convention for docstrings
convention = "pep257"
[tool.ruff.format]
# Enable formatter settings, similar to Black
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
# Enable auto-formatting of code examples in docstrings
docstring-code-format = true
docstring-code-line-length = "dynamic"
# Add mypy for PEP 484 type hint checking
[tool.mypy]
python_version = "3.12"
files = ["."]
exclude = ["solutions/", "\\.venv/", "venv/"]
strict = false # Lenient for Exercism; set to true for stricter checks later
warn_return_any = true
warn_unused_configs = true
check_untyped_defs = true
disallow_any_generics = true