forked from phoenix-oss/llama-stack-mirror
Fix precommit check after moving to ruff (#927)
Lint check in main branch is failing. This fixes the lint check after we moved to ruff in https://github.com/meta-llama/llama-stack/pull/921. We need to move to a `ruff.toml` file as well as fixing and ignoring some additional checks. Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
This commit is contained in:
parent
4773092dd1
commit
34ab7a3b6c
217 changed files with 981 additions and 2681 deletions
37
.ruff.toml
Normal file
37
.ruff.toml
Normal file
|
@ -0,0 +1,37 @@
|
|||
# Suggested config from pytorch that we can adapt
|
||||
lint.select = ["B", "C", "E" , "F" , "N", "W", "B9"]
|
||||
|
||||
line-length = 120
|
||||
|
||||
# C408 ignored because we like the dict keyword argument syntax
|
||||
# E501 is not flexible enough, we're using B950 instead
|
||||
# N812 ignored because import torch.nn.functional as F is PyTorch convention
|
||||
# N817 ignored because importing using acronyms is convention (DistributedDataParallel as DDP)
|
||||
# E731 allow usage of assigning lambda expressions
|
||||
# E701 let black auto-format statements on one line
|
||||
# E704 let black auto-format statements on one line
|
||||
lint.ignore = [
|
||||
"E203", "E305", "E402", "E501", "E721", "E741", "F405", "F821", "F841",
|
||||
"C408", "E302", "W291", "E303", "N812", "N817", "E731", "E701",
|
||||
# These are the additional ones we started ignoring after moving to ruff. We should look into each one of them later.
|
||||
"C901", "C405", "C414", "N803", "N999", "C403", "C416", "B028", "C419", "C401", "B023",
|
||||
# shebang has extra meaning in fbcode lints, so I think it's not worth trying
|
||||
# to line this up with executable bit
|
||||
"EXE001",
|
||||
# random naming hints don't need
|
||||
"N802",
|
||||
# these ignores are from flake8-bugbear; please fix!
|
||||
"B007", "B008"
|
||||
]
|
||||
|
||||
exclude = [
|
||||
"./.git",
|
||||
"./docs/*",
|
||||
"./build",
|
||||
"./scripts",
|
||||
"./venv",
|
||||
"*.pyi",
|
||||
".pre-commit-config.yaml",
|
||||
"*.md",
|
||||
".flake8"
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue