mirror of
https://github.com/open-webui/open-webui.git
synced 2026-06-14 03:30:25 +00:00
feat: add ruff linter & formatter (#22576)
* chore: add ruff linter with base config * ci: add ruff pre-commit hook * ci: add ruff github actions workflow * ci: run ruff only on changed files
This commit is contained in:
@@ -213,4 +213,31 @@ ignore-words-list = 'ans'
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"pytest-asyncio>=1.0.0",
|
||||
"ruff>=0.15.5",
|
||||
]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 120
|
||||
|
||||
[tool.ruff.format]
|
||||
quote-style = "single"
|
||||
docstring-code-format = false
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = [
|
||||
"E", # pycodestyle errors
|
||||
"F", # pyflakes
|
||||
"W", # pycodestyle warnings
|
||||
"I", # isort
|
||||
"UP", # pyupgrade
|
||||
"C90", # mccabe
|
||||
"Q", # flake8-quotes
|
||||
"ICN", # flake8-import-conventions
|
||||
]
|
||||
|
||||
# Plugin configs:
|
||||
flake8-import-conventions.banned-from = [ "ast", "datetime" ]
|
||||
flake8-import-conventions.aliases = { datetime = "dt" }
|
||||
flake8-quotes.inline-quotes = "single"
|
||||
mccabe.max-complexity = 10
|
||||
pydocstyle.convention = "google"
|
||||
|
||||
Reference in New Issue
Block a user