-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathpyproject.toml
More file actions
114 lines (108 loc) · 4.28 KB
/
pyproject.toml
File metadata and controls
114 lines (108 loc) · 4.28 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
[tool.pytest.ini_options]
python_files = "tests.py test_*.py"
asyncio_default_fixture_loop_scope = "function"
# Disable warnings from third-party libraries
filterwarnings = "ignore::DeprecationWarning"
[tool.ruff]
# Format to 120 characters, but don't complain about longer lines for things like log messages
line-length = 120
exclude = ["**/migrations", "**/node_modules", "tests/rebuild_patch_data"]
lint.extend-ignore = [
"ARG002", # Unused method args like args and kwargs are ok
"DTZ003",
"DTZ007",
"E401", # multiple imports on one line
"E501", # Line too long - format to 120 but don't complain about longer
"FURB157", # Quotes in Decimal calls are ok
"N817", # D for decimal
"PERF401", # Don't force list comprehensions
"PLR0911", # Don't complain about too many return statements
"PLR0912", # Don't complain about too many branches
"PLR0913", # don't complain about too many arguments
"PLR0915", # Don't complain about too many statements in a method
"PLR2004", # Don't force every magic value to be a constant
"PLW0120", # else without a break is fine (I use return with for-else)
"RET505", # Allow for return values to be set outside of if/else blocks
"RET506", # Allow for return values to be set after raising an exception
"RET507", # Allow for return values to be set after continue
"RET508", # Allow for return values to be set after break
"RUF001", # Don't complain about ambiguous text in strings
"RUF002", # Don't complain about × (multiplication sign) in docstrings
"RUF003", # Don't complain about × (multiplication sign)
"RUF012", # Don't force annotations of mutable class attributes
"RUF013", # Optional args are ok
"RUF010", # Don't force f-strings everywhere
"RUF005", # Don't force iterable unpacking over concatenation
"RUF100", # Allow unused imports
"S101", # assert
"S105", # possible hardcoded password
"S106", # possible hardcoded password
"S308", # Trust us with mark_safe
"S311", # Trust us with random
"S324", # Trust us with hashlib
"S603", # subprocess call
"S607", # subprocess with partial executable path
"SIM102", # Nested ifs are ok
"SIM108", # Don't force ternary operators
"SIM105", # try/except/pass is fine
"TRY300", #
"TRY301", # Let me raise errors how I want to
"TRY003", # long messages in exceptions are ok
]
# https://beta.ruff.rs/docs/rules/#ruff-specific-rules-ruf
lint.select = [
"A", # builtins
"ARG", # unused arguments
"B", # bugbear
"DTZ", # datetimez
"E", # pycodestyle
"EXE", # executable settings
"F", # pyflakes
"FURB", # modernize codebase
"I", # Isort
"INP", # implicit namespace packages
"ISC", # string concatenation
"N", # pep8 naming
"NPY", # numpy
"PD", # pandas checking
"PERF", # Perflint
"PGH", # explicit noqa
"PIE", # flake8 pie
"PLC", # pylint convention
"PLE", # pylint errors
"PLR", # pylint refactor
"PLW", # pylint warnings
"PTH", # Use path library
"RET", # return statements
"RSE", # raise statements
"RUF", # ruff
"S", # flake8-bandit
"SIM", # flake8 simplify
"SLF", # self
"SLOT",
"T10", # debug statements
"T20", # print statements
"TRY", # try/except
"UP", # pyupgrade
"W", # pycodestyle warnings
"YTT", # flake8 2020
]
target-version = "py313"
format.docstring-code-format = true
# Certain errors we don't want to fix because they are too aggressive,
# especially in the editor (removing variables we haven't used yet)
lint.unfixable = ["F401", "F841"]
[tool.ruff.lint.per-file-ignores]
"test_*.py" = [
"PLR0915", # Pylint: Too many statements (tests can be long)
"ARG001", # Ruff: Unused function argument (common with pytest fixtures)
"ARG005", # Ruff: Unused argument in lambda expression
"SLF001", # Ruff: Private member accessed (tests may need to inspect internals)
"F841", # Ruff: Local variable assigned but never used (common in test setup)
"T201", # Allow print statements in tests
]
"*/conftest.py" = [
"ARG001", # Allow unused arguments in pytest hooks and fixtures
]
[tool.semantic_release]
version_variable = "aicodebot:version"