Files
OpenLLM/ruff.toml
Aaron Pham ea42108e45 chore(service): cleanup API (#579)
* chore(service): cleanup API

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: running tools

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix: tests import

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

---------

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
2023-11-08 02:53:08 -05:00

100 lines
2.7 KiB
TOML

indent-width = 2
extend-exclude = [
"tools",
"examples",
"openllm-python/src/openllm/playground",
"openllm-python/src/openllm/__init__.py",
"openllm-python/src/openllm/_version.py",
"openllm-python/src/openllm/models/__init__.py",
"openllm-client/src/openllm_client/pb/**",
]
extend-include = ["*.ipynb"]
extend-select = [
"I", # isort
"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
"FLY", # flynt
"RUF", # Ruff-specific rules
"YTT", # flake8-2020
]
fix = true
ignore = [
"PLR0911",
"PLR0912",
"PLR0913",
"PLR0915",
"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 = 192
target-version = "py312"
typing-modules = ["openllm_core._typing_compat"]
unfixable = ["TCH004"]
[lint.flake8-type-checking]
exempt-modules = ["typing", "typing_extensions", "openllm_core._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"]
[format]
quote-style = "single"
indent-style = "space"
skip-magic-trailing-comma = true
[lint.pydocstyle]
convention = "google"
[lint.pycodestyle]
ignore-overlong-task-comments = true
[lint.isort]
combine-as-imports = true
force-single-line = true
force-wrap-aliases = false
known-first-party = ["openllm", "bentoml", "openllm_core", "openllm_client"]
known-third-party = [
"transformers",
"click",
"huggingface_hub",
"torch",
"vllm",
"auto_gptq",
"peft",
"click_option_group",
]
lines-after-imports = 1
lines-between-types = 1
no-lines-before = ["future", "standard-library"]
relative-imports-order = "closest-to-furthest"
[lint.flake8-quotes]
avoid-escape = false
multiline-quotes = "single"
inline-quotes = "single"
docstring-quotes = "double"
[lint.extend-per-file-ignores]
"openllm-python/src/openllm/models/**" = ["E", "F", "I001"]
"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"]