-
Notifications
You must be signed in to change notification settings - Fork 13
/
pyproject.toml
97 lines (84 loc) · 3.16 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
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[tool.mypy]
ignore_missing_imports = true
show_error_codes = true
disable_error_code = ["attr-defined", "var-annotated"]
follow_imports = "skip" # Don't follow imports into other files. This should be removed once all type errors have been resolved.
exclude = [
"^dandiapi/api/tests/",
"^dandiapi/api/views/",
"^dandiapi/zarr/tests/",
]
# Re-enable these when https://github.com/typeddjango/django-stubs/issues/417 is fixed.
# plugins = ["mypy_django_plugin.main", "mypy_drf_plugin.main"]
# [tool.django-stubs]
# django_settings_module = "dandiapi.settings"
[tool.ruff]
line-length = 100
target-version = "py311"
[tool.ruff.lint]
select = ["ALL"]
ignore = [
# Incompatible with formatter
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"COM812", # missing-trailing-comma
"COM819", # prohibited-trailing-comma
"D206", # indent-with-spaces
"D300", # triple-single-quotes
"E111", # indentation-with-invalid-multiple
"E114", # indentation-with-invalid-multiple-comment
"E117", # over-indented
"ISC001", # single-line-implicit-string-concatenation
"ISC002", # multi-line-implicit-string-concatenation
"Q", # flake8-quotes
"W191", # tab-indentation
"A003", # Class attribute is shadowing a Python builtin
"ANN", # flake8-annotations
"ARG001", # Unused function argument
"ARG002", # Unused method argument
"D1", # Missing docstring
"EM101", # Exception must not use a string literal, assign to variable first
"EM102", # Exception must not use an f-string literal, assign to variable first
"ERA001", # Found commented-out code
"FIX", # flake8-fixme
"TD002", # Missing author in TODO
"TD003", # Missing issue link on the line following this TODO
"TRY003", # Avoid specifying long messages outside the exception class
# Try to fix upstream
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
# Fix in DANDI codebase. PR that will fix this:
# https://github.com/dandi/dandi-archive/pull/1782
"PTH119", # TODO: re-enable this when it's fixed
]
[tool.ruff.lint.per-file-ignores]
"scripts/**" = [
"INP001", # File is part of an implicit namespace package
]
"**/migrations/**" = [
"N806", # Variable in function should be lowercase
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
]
"**/management/commands/**" = [
"INP001", # File is part of an implicit namespace package
]
"**/tests/**" = [
"DJ007", # Do not use `__all__`
"DJ008", # Model does not define `__str__` method
"PLR0913", # Too many arguments to function call
"PLR2004", # Magic value used in comparison
"S", # flake8-bandit
"SLF001", # Private member accessed
]
[tool.ruff.format]
quote-style = "single"
[tool.ruff.lint.flake8-self]
extend-ignore-names = ["_base_manager", "_default_manager", "_meta"]
[tool.ruff.lint.isort]
# Sort by name, don't cluster "from" vs "import"
force-sort-within-sections = true
# Deferred annotations allows TCH rules to move more imports into TYPE_CHECKING blocks
required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.pydocstyle]
convention = "pep257"