-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpyproject.toml
133 lines (130 loc) · 3.55 KB
/
pyproject.toml
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# code formatter
[tool.black]
target-version = ['py38']
line-length = 120
skip-string-normalization = false
skip-magic-trailing-comma = false
extend-exclude = '''
/(
| docs
| setup.py
)/
'''
# Static type checker
# configs: https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
# Platform configuration
python_version = "3.8"
# imports related
ignore_missing_imports = true
follow_imports = "silent"
# None and Optional handling
no_implicit_optional = true
strict_optional = false
# Configuring warnings
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
warn_return_any = false
# Untyped definitions and calls
check_untyped_defs = true
disallow_untyped_calls = false
disallow_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
# Disallow dynamic typing
disallow_subclassing_any = false
disallow_any_unimported = false
disallow_any_expr = false
disallow_any_decorated = false
disallow_any_explicit = false
disallow_any_generics = false
# Miscellaneous strictness flags
allow_untyped_globals = false
allow_redefinition = false
local_partial_types = false
implicit_reexport = true
strict_equality = true
# Configuring error messages
show_error_context = true
show_column_numbers = true
show_error_codes = true
exclude = ["examples"]
# https://docs.astral.sh/ruff/
# https://docs.astral.sh/ruff/settings/#explicit-preview-rules
# https://docs.astral.sh/ruff/rules/
[tool.ruff]
target-version = "py38"
select = ["F", "E", "I", "D", "PL"]
extend-select = ["W", "C90", "YTT", "ANN", "ASYNC", "A", "C4", "RET", "SIM", "PLC", "PLE", "PLR", "PLW", "FLY", "PERF", "RUF"]
ignore = ["E402","E501", "B905", "SIM300", "PD901","ANN101"]
fixable = ["W", "C90", "YTT", "ANN", "ASYNC", "A", "C4", "RET", "SIM", "PLC", "PLE", "PLR", "PLW", "FLY", "PERF", "RUF", "F401", "D205", "D403", "D200", "D202", "D209","I001"]
unfixable = ["SIM"]
line-length = 120
extend-exclude = ["tests", "test"]
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.isort]
force-single-line = true
force-sort-within-sections = false
lines-after-imports = 1
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
known-third-party = [
"numpy",
"pandas",
"keras",
"tensorflow",
"sklearn",
"matplotlib",
"scipy",
"h5py",
"seaborn",
"numba",
"gym",
"PyQt6",
"PyQt5",
"pyqtgraph",
"torch",
"tqdm"
]
known-first-party = []
known-local-folder = []
[tool.ruff.mccabe]
max-complexity = 24
[tool.ruff.pycodestyle]
ignore-overlong-task-comments = true
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.flake8-annotations]
allow-star-arg-any = true
ignore-fully-untyped = true
[tool.ruff.pylint]
max-branches = 24
max-returns = 12
max-statements = 100
max-args = 15
allow-magic-value-types = ["str", "bytes", "complex", "float", "int", "tuple"]
# Static type checker
[tool.pyright]
pythonVersion = "3.8"
typeCheckingMode = "basic"
# enable subset of "strict"
reportDuplicateImport = true
reportInvalidStubStatement = true
reportOverlappingOverload = true
reportPropertyTypeMismatch = true
reportUntypedClassDecorator = true
reportUntypedFunctionDecorator = true
reportUntypedNamedTuple = true
reportUnusedImport = true
# disable subset of "basic"
reportGeneralTypeIssues = false
reportMissingModuleSource = false
reportOptionalCall = false
reportOptionalIterable = false
reportOptionalMemberAccess = false
reportOptionalOperand = false
reportOptionalSubscript = false
reportPrivateImportUsage = false
reportUnboundVariable = true