forked from openai/parameter-golf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
77 lines (73 loc) · 3.97 KB
/
Copy pathpyproject.toml
File metadata and controls
77 lines (73 loc) · 3.97 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
[tool.ruff]
line-length = 120
target-version = "py310"
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
exclude = ["config.py"]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"D103", # Missing docstring in public function
"ANN101", # Missing type annotation for self
"T201", # Allow print()
"RUF001", "RUF002", "RUF003", # Ambiguous cyrillic characters
"D212", "D213", # Docstring summary position
"ERA001", # Commented-out code
"COM812", # Trailing comma (conflict with formatter)
"ANN204", # Missing return type for special methods (__init__)
"PERF203", # try-except in loop - acceptable for file operations, would complicate code
"FBT003", # Boolean positional value in function call - Tkinter APIs require boolean literals
"E501", # Line length - not critical for training scripts
"N812", # Lowercase imported as non-lowercase - F is standard for torch.nn.functional
"N817", # CamelCase imported as acronym - DDP is standard for DistributedDataParallel
"N803", # Argument name should be lowercase - single-letter math notation is fine
"N806", # Variable in function should be lowercase - tensor notation (X, A, B) is clear
"D101", # Missing docstring in public class - not needed for internal code
"D102", # Missing docstring in public method - not needed for internal code
"D107", # Missing docstring in __init__ - not needed for internal code
"ANN001", # Missing type annotation for function argument - not critical for training
"ANN201", # Missing return type annotation for public function - not critical
"FBT001", # Boolean-typed positional argument in function definition - common in ML APIs
"FBT002", # Boolean default positional argument - common in ML APIs
"C408", # Unnecessary dict() call - minor style preference
"TRY003", # Long exception messages - not worth refactoring
"EM101", # String literal in exception - not worth refactoring
"EM102", # f-string in exception - not worth refactoring
"PTH118", # os.path.join -> Path - pathlib style preference only
"PTH207", # glob -> Path.glob - pathlib style preference only
"PTH103", # os.makedirs -> Path.mkdir - pathlib style preference only
"PTH123", # open() -> Path.open() - pathlib style preference only
"PTH202", # os.path.getsize -> Path.stat - pathlib style preference only
"PLR0913", # Too many arguments - config classes need many params
"C901", # Function too complex - main() in single file is fine
"PLR0912", # Too many branches - main() in single file is fine
"PLR0915", # Too many statements - main() in single file is fine
"RET504", # Unnecessary assignment before return - minor style
"PLR2004", # Magic value comparison - constants not needed for training scripts
"SLF001", # Private member access - internal usage is acceptable
"UP022", # capture_output argument - nice but not critical
"PLW1508", # Invalid env var default type - int/str conversion is fine
"PLC0415", # Import outside top-level - conditional imports are fine
"S607", # Partial executable path - acceptable in this context
"NPY002", # Legacy numpy.random.seed - fine for training scripts
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"S101", # Use of assert detected
"ANN201", # Missing return type for public function
"PLR2004", # Magic value used in comparison
"D100", # Missing docstring in public module
"D104", # Missing docstring in __init__.py of the tests folder
"ANN001", # Mocks' arguments can be untyped
"ARG001", # Unused function argument
"PT011", # Broad ValueError is fine in tests
"PLC0415", # Local imports for cache clearing/mocking are fine
"BLE001", # Allow common exceptions to be caught in tests
"PLR0913", # Allow a large number of arguments (mocks) in tests
]
[tool.pytest.ini_options]
pythonpath = ["."]
testpaths = ["tests"]