-
Notifications
You must be signed in to change notification settings - Fork 9
/
ruff.toml
126 lines (105 loc) · 3 KB
/
ruff.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
src = ["lumigator"]
target-version = "py311"
# Group violations by containing file
output-format = "grouped"
# Exclude a variety of commonly ignored directories.
# don't include notebooks
include = ["*.py", "*.pyi"]
fix = true
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".github",
".hg",
".mypy_cache",
".nox",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"build",
"dist",
"node_modules",
"venv",
"archive",
"bazel-*",
]
line-length = 100
[lint]
select = [
"E", # pycodestyle
"F", # pyflakes
"UP", # pyupgrade
"D", # pydocstyle
"I001", # import sorting
"B", # flake8-bugbear
"N", # pep8 naming
"ISC", # flake8 implicit string concat
"PTH", # flake8-use-pathlib use Path library
"PD", # pandas-vet
# "ANN", # flake8-annotations; disbled for now
]
# Avoid trying to fix flake8-bugbear (`B`) violations.
unfixable = ["B", "SIM", "TRY", "RUF"]
ignore = [
# TODO: remove D101, D102, D103 after we get settled
"D101", # missing docstrings in public class
"D102", # missing docstrings in public method
"D103", # missing docstrings in public function
"D104", # missing docstrings in public packages
"D107", # missing docstrings in __init__.py
"D417", # documentation for every function parameter.
"N806", # ignore uppercased variables
"N812", # import as uppercased
"N803", # lowercased args
"N817", # imported as acryonym
"B023", # doesn't bind loop var, we do this a lot in torch
"D100", # module-level docstrings
"D417", # documentation for every function parameter.
"N806", # ignore uppercased variables
"N812", # import as uppercased
"N803", # lowercased args
"N805", # first param needs to be self; pydantic breaks this sometimes
"D415", # First line should end with a period, question mark, or exclamation point
"D205", # 1 blank line required between summary line and description
"B905", # `zip()` without an explicit `strict=` parameter
]
[lint.per-file-ignores]
"__init__.py" = [
"E402", # import violations
"D104", # missing docstrings in public packages
"F401", # import unused
]
"**/tests/**" = [
"D101", # missing docstrings in public class
"D102", # missing docstrings in public method
"D103", # missing docstrings in public function
"D104", # missing docstrings in public packages
"E402", # import violations
"F401", # import unused
"E501", # line too long
"B905", # `zip()` without an explicit `strict=` parameter
]
[lint.pydocstyle]
convention = "google"
[lint.isort]
known-first-party = ["mzai"]
# allow unused *args, **kwargs
[lint.flake8-unused-arguments]
ignore-variadic-names = true
[format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
docstring-code-format = true