-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
159 lines (126 loc) · 5.04 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
[tool.pylint]
# SEE: https://github.com/PyCQA/pylint/blob/master/examples/pylintrc
[tool.pylint.master]
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
# number of processors available to use.
jobs = 0
[tool.pylint.reports]
# Set true to activate the evaluation score.
score = false
[tool.pylint.messages_control]
# Disable the message, report, category or checker with the given id(s).
disable = [
"missing-docstring", # Let pep257 take care of docstrings
"empty-docstring", # Let pep257 take care of docstrings
"too-few-public-methods", # Don't care for this level of linting
"too-many-ancestors", # hw makes heavy use of inheritance
"fixme", # codetags are useful
"too-many-arguments", # Don't care to enforce this
"invalid-name", # Don't care to enforce this
"wrong-import-order", # Rely on isort for this
"ungrouped-imports", # Rely on isort for this
"unused-wildcard-import", # Wildcard imports are convenient
"wildcard-import", # Wildcard imports are convenient
"unsubscriptable-object", # Buggy, SEE: https://github.com/PyCQA/pylint/issues/3637
"logging-fstring-interpolation", # f-strings are convenient
"unused-import", # Let flake8's F401 handle this
]
# Enable the message, report, category or checker with the given id(s).
enable = [
"useless-suppression", # Print unused `pylint: disable` comments
]
[tool.pylint.format]
# Maximum number of characters on a single line.
max-line-length = 120
[tool.pylint.typecheck]
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E1101 when accessed. Python regular
# expressions are accepted.
generated-members = ["torch.*"]
[tool.mypy]
# SEE: http://mypy.readthedocs.io/en/latest/config_file.html#config-file
# Specifies the Python version used to parse and check the target program.
python_version = "3.10"
# Warns about casting an expression to its inferred type.
warn_redundant_casts = true
# Warns about unneeded `# type: ignore` comments.
warn_unused_ignores = true
# Shows a warning when encountering any code inferred to be unreachable or
# redundant after performing type analysis.
warn_unreachable = true
# Warns about per-module sections in the config file that do not match any
# files processed when invoking mypy.
warn_unused_configs = true
# Prefixes each error with the relevant context.
show_error_context = true
# Shows error codes in error messages.
# SEE: https://mypy.readthedocs.io/en/stable/error_codes.html#error-codes
show_error_codes = true
# Shows column numbers in error messages.
show_column_numbers = true
# Enables PEP 420 style namespace packages.
namespace_packages = true
# Use visually nicer output in error messages: use soft word wrap, show source
# code snippets, and show error location markers.
pretty = true
# Shows a short summary line after error messages.
error_summary = false
# A comma-separated list of mypy plugins
plugins = ["numpy.typing.mypy_plugin"]
[tool.ruff]
select = ["ALL"]
ignore = [
"ARG001", # Nice for project
"ANN", # Don't care to enforce typing
"BLE001", # Don't care to enforce blind exception catching
"D100", # D100, D101, D102, D103, D104, D105, D106, D107: don't always need docstrings
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
"D203", # Keep docstring next to the class definition (covered by D211)
"D205", # Loosen docstring conventions for project
"D209", # Conflicts with docformatter config
"D212", # Summary should be on second line (opposite of D213)
"D402", # It's nice to reuse the method name
"D406", # Google style requires ":" at end
"D407", # We aren't using numpy style
"D413", # Blank line after last section. -> No blank line
"DTZ", # Don't care to have timezone safety
"EM", # Overly pedantic
"ERA001", # Nice for project
"FBT001", # FBT001, FBT002: overly pedantic
"FBT002",
"FIX", # Don't care to prevent TODO, FIXME, etc.
"G004", # f-strings are convenient
"N806", # N806, N812, N816: loosen naming for project
"N812",
"N816",
"PL", # Duplicates pylint
"PTH", # Overly pedantic
"S101", # Nice for project
"SLF001", # Overly pedantic
"T201", # Nice for project
"TCH001", # TCH001, TCH002, TCH003: don't care to enforce type checking blocks
"TCH002",
"TCH003",
"TD002", # Don't care for TODO author
"TD003", # Don't care for TODO links
"TRY003", # Overly pedantic
]
unfixable = [
"ERA001", # While debugging, temporarily commenting code can be useful
"F401", # Unused imports are nice for project
"F841", # Unused locals are nice for project
]
# Line length to use when enforcing long-lines violations (like `E501`).
line-length = 97 # ceil(1.1 * 88) makes `E501` equivalent to `B950`
[tool.ruff.flake8-annotations]
mypy-init-return = true
[tool.ruff.pydocstyle]
# Whether to use Google-style or NumPy-style conventions or the PEP257
# defaults when analyzing docstring sections.
convention = "google"