forked from facebook/fboss
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruff.toml
More file actions
54 lines (47 loc) · 1.54 KB
/
ruff.toml
File metadata and controls
54 lines (47 loc) · 1.54 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
# Ruff configuration for all Python code in fboss/
# This configuration aligns with Meta's internal Python standards
line-length = 88 # Black's default line length
[lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"W", # pycodestyle warnings
"I", # isort - import sorting
"N", # pep8-naming conventions
"UP", # pyupgrade - modern Python idioms
"B", # flake8-bugbear - likely bugs
"A", # flake8-builtins - shadowing built-ins
"C4", # flake8-comprehensions
"T10", # flake8-debugger - no debugger statements
"RET", # flake8-return - return statement issues
"SIM", # flake8-simplify
"ARG", # flake8-unused-arguments
"PL", # pylint
"RUF", # ruff-specific rules
]
ignore = [
"E501", # Line too long - handled by formatter
"B904", # Allow raising exceptions without 'from' for cleaner error messages
"PLR0913", # Allow more than 5 arguments
"PLR2004", # Allow magic values in comparisons
"PLW0603", # Allow global statement usage
]
[lint.per-file-ignores]
# Tests may have unused mock arguments and use assert statements
"**/tests/*.py" = ["ARG002", "S101"]
"**/test_*.py" = ["ARG002", "S101"]
"**/*_test.py" = ["ARG002", "S101"]
# Scripts may use print statements
"**/scripts/*.py" = ["T201"]
"**/oss/scripts/**/*.py" = ["T201"]
[lint.isort]
known-first-party = ["fboss"]
force-single-line = false
combine-as-imports = true
[lint.pylint]
max-args = 8
[format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"