-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
143 lines (111 loc) · 4.88 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
[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.flake8]
# SEE: https://flake8.pycqa.org/en/latest/user/options.html
# SEE: http://www.pydocstyle.org/en/stable/usage.html#configuration-files
# SEE: https://github.com/john-hen/Flake8-pyproject
# Set the maximum length that any line (with some exceptions) may be.
max-line-length = 120
# Specify a list of codes to ignore. The list is expected to be
# comma-separated, and does not need to specify an error code exactly.
# D100, D101, D102, D103, D104, D105, D106, D107: don't always need docstrings
ignore = [
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
"D203", # Keep docstring next to the class definition (covered by D211)
"D213", # Summary should be on first line (covered by D212)
"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
"F403", # Wildcard imports are convenient
"F405", # Wildcard imports are convenient
"W503", # Goes against PEP8 line break before binary operator
]
# Specify a list of codes to add to the list of ignored ones. Similar
# considerations as in --ignore apply here with regard to the value.
# The difference to the --ignore option is, that this option can be used to
# selectively add individual codes without overriding the default list entirely.
extend-ignore = [
"E203", # SEE: https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#slices
"E501", # SEE: https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#line-length
]
# Enable PyFlakes syntax checking of doctests in docstrings.
doctests = true
# Set the maximum allowed McCabe complexity value for a block of code.
# SEE: https://github.com/PyCQA/mccabe#plugin-for-flake8
# > According to McCabe, anything that goes beyond 10 is too complex.
max-complexity = 10