-
Notifications
You must be signed in to change notification settings - Fork 38
/
pyproject.toml
123 lines (109 loc) · 3.08 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
[tool.pytest.ini_options]
testpaths = ["tests"]
log_cli = true
log_cli_level = "INFO"
markers = """
long_test: marks tests as long (select with '-m "long_test"')
serial
"""
[tool.coverage.run]
source = ["pdb2pqr"]
omit = [
"tests/",
]
[tool.pyright]
typeCheckingMode = "standard"
useLibraryCodeForTypes = true
autoImportCompletions = true
pythonVersion = "3.8"
# pythonPlatform = "Linux"
reportDuplicateImport = true
[tool.ruff]
namespace-packages = ["tests"] # for INP rule, suppress on these directories
line-length = 79
[tool.ruff.lint]
# OPTIONALLY ADD MORE LATER
select = [
# flake8
"E",
"F",
"W",
"B", # Bugbear
"D", # Docstring
"N", # Naming
"C4", # flake8-comprehensions
"UP", # pyupgrade
"SIM", # simplify
"RUF", # ruff-specific
"RET501", # return
"RET502", # return
"PTH", # path
"NPY", # numpy
"PD", # pandas
"PYI", # type stubs for pyright/pylance
"PT", # pytest
"PIE", #
"LOG", # logging
"COM818", # comma misplaced
"COM819", # comma
"DTZ", # datetime
"YTT",
"ASYNC",
"FBT", # boolean trap
"A", # Shadowing python builtins
"EXE", # executable (shebang)
"FA", # future annotations
"ISC", # Implicit string concatenation
"ICN", # Import convention
"INP", # Implicit namespace package (no __init__.py)
"Q", # Quotes
"RSE", # raise
"SLOT", # __slots__
"PL", # Pylint
"TRY", # try
"FAST", # FastAPI
"AIR", # airflow
"DOC", # docstring
"TID", # tidy-imports
# Not important
"T20", # print statements
]
ignore = [
"E402", # Module level import not at top of file
"W293", # Blank line contains whitespace
"W291", # Trailing whitespace
"D10", # Missing docstring in public module / function / etc.
"D200", # One-line docstring should fit on one line with quotes
"D417", # require documentation for every function parameter.
"D400", # First line should end with a period
"D401", # require an imperative mood for all docstrings.
"DOC201", # missing Return field in docstring
"PTH123", # Path.open should be used instead of built-in open
"PT006", # Pytest parameterize style
"N812", # Lowercase `functional` imported as non-lowercase `F` (import torch.nn.functional as F)
"NPY002", # legacy numpy random
"UP017", # datetime.timezone.utc -> datetime.UTC
"SIM108", # use ternary operator instead of if-else
"TRY003", # long message in except
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
"F401", # Ignore seemingly unused imports (they're meant for re-export)
]
[tool.ruff.lint.pydocstyle]
convention = "pep257"
[tool.ruff.lint.pycodestyle]
# ruff formatter will enforce line length to be 79, except for docstrings and comments.
# We set it to 120 so we have more space for docstrings and comments.
max-line-length = 120
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"os.system".msg = "Use subprocess.run or subprocess.Popen instead"
[tool.ruff.lint.pylint]
max-args = 10
max-bool-expr = 10
max-statements = 100
max-returns = 10
max-public-methods = 30
max-nested-blocks = 10
max-locals = 30
max-branches = 24