-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
67 lines (56 loc) · 2.18 KB
/
pyproject.toml
File metadata and controls
67 lines (56 loc) · 2.18 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
[tool.ruff]
# Files to include in linting (Python source and stub files)
include = ["**/*.py", "**/*.pyi"]
# Folders to exclude from linting (e.g., virtual environments, build folders)
exclude = [
".git",
"__pycache__",
"build",
"dist",
".venv",
"venv",
]
# Maximum allowed characters per line
line-length = 79
# Target Python version (used for version-specific rules)
target-version = "py313"
# Respect `.gitignore` files (e.g., to skip __init__.py or ignored files)
respect-gitignore = true
# Automatically fix issues using `ruff check --fix`
fix = true
[tool.ruff.lint]
# List of enabled rule categories
select = [
"D", # pydocstyle: docstring conventions
"F", # Pyflakes: code correctness errors
"E", # pycodestyle: style errors
"W", # pycodestyle: warnings
"I", # isort: import order checks
"UP", # Python upgrades: modern language features
"N", # pep8-naming: naming conventions
"B", # bugbear: common bug patterns
"A", # flake8-builtins: avoid shadowing built-in names
"C90", # mccabe: cyclomatic complexity
"ARG", # flake8-unused-arguments: unused arguments detection
"DTZ", # datetimez: best practices with datetime usage
"TRY", # tryceratops: exception handling best practices
"SLF", # flake8-self: discourage private attribute access
"ERA", # eradicate: detect commented-out/dead code
"PL", # pylint: extra validations
"RUF", # Ruff-specific rules
]
# Rules to ignore (useful for relaxing or customizing enforcement)
ignore = [
"D102", # Allow missing docstrings in public methods
"D211", # Allow no blank line before class docstrings
"D212", # Allow docstring to start on the second line
"TRY400", # Allow `logger.error()` inside `except` blocks
"N818", # Allow custom exception names without 'Error' suffix
"UP031", # Allow use of `type(x) is T` instead of `isinstance()`
"TRY003", # Allow defining complex error messages outside exceptions
"ARG001", # Allow unused function arguments (e.g., for interface compliance)
"B904", # Allow raising exceptions without using `raise ... from err`
]
[tool.ruff.lint.mccabe]
# Maximum cyclomatic complexity allowed before a warning is raised
max-complexity = 8