forked from bentoml/OpenLLM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.ruff.toml
100 lines (94 loc) · 2.55 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
extend-exclude = [
"tools",
"examples",
"openllm-python/src/openllm/__init__.py",
"openllm-python/src/openllm/_version.py",
"openllm-python/src/openllm/models/__init__.py",
"openllm-python/src/openllm_cli/playground",
"openllm-client/src/openllm_client/pb/**",
]
extend-include = ["*.ipynb"]
extend-select = [
"E",
"F",
"B",
"PIE",
"G", # flake8-logging-format
"W", # pycodestyle
"Q", # flake8-quotes
"FA", # flake8-future-annotations
"TCH", # flake8-type-checking
"PLW", # pylint-warning
"PLR", # pylint-refactor
"PT", # flake8-pytest-style
"PERF", # perflint
"RUF", # Ruff-specific rules
"YTT", # flake8-2020
]
fix = true
ignore = [
"PLR0911",
"PLR0912",
"PLR0913",
"PLR0915",
"ANN", # Use mypy
"PLR2004", # magic value to use constant
"E501", # ignore line length violation
"E401", # ignore multiple line import
"E702",
"TCH004", # don't move runtime import out, just warn about it
"RUF012", # mutable attributes to be used with ClassVar
"E701", # multiple statement on single line
]
line-length = 119
indent-width = 2
target-version = "py38"
typing-modules = [
"openllm_core._typing_compat",
"openllm_client._typing_compat",
]
unfixable = ["TCH004"]
[lint.flake8-type-checking]
exempt-modules = [
"typing",
"typing_extensions",
"openllm_core._typing_compat",
"openllm_client._typing_compat",
]
runtime-evaluated-base-classes = [
"openllm_core._configuration.LLMConfig",
"openllm_core._configuration.GenerationConfig",
"openllm_core._configuration.SamplingParams",
"openllm_core._configuration.ModelSettings",
"openllm.LLMConfig",
]
runtime-evaluated-decorators = [
"attrs.define",
"attrs.frozen",
"trait",
"attr.attrs",
'attr.define',
'_attr.define',
'attr.frozen',
]
[format]
preview = true
quote-style = "single"
indent-style = "space"
skip-magic-trailing-comma = true
[lint.pydocstyle]
convention = "google"
[lint.pycodestyle]
ignore-overlong-task-comments = true
max-line-length = 119
[lint.flake8-quotes]
avoid-escape = false
inline-quotes = "single"
multiline-quotes = "single"
docstring-quotes = "single"
[lint.extend-per-file-ignores]
"openllm-python/tests/**/*" = ["S101", "TID252", "PT011", "S307"]
"openllm-python/src/openllm/_llm.py" = ["F811"]
"openllm-core/src/openllm_core/utils/import_utils.py" = ["PLW0603", "F811"]
"openllm-core/src/openllm_core/_configuration.py" = ["F811", "Q001"]
"openllm-python/src/openllm/_service_vars_pkg.py" = ["F821"]