mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-24 05:14:30 +00:00
build: configure ruff from pyproject.toml (#1100)
# What does this PR do? - Remove hardcoded configurations from pre-commit. - Allow configuration to be set via pyproject.toml. - Merge .ruff.toml settings into pyproject.toml. - Ensure the linter and formatter use the defined configuration instead of being overridden by pre-commit. Signed-off-by: Sébastien Han <seb@redhat.com> [//]: # (If resolving an issue, uncomment and update the line below) [//]: # (Closes #[issue-number]) ## Test Plan [Describe the tests you ran to verify your changes with result summaries. *Provide clear instructions so the plan can be easily re-executed.*] [//]: # (## Documentation) Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
parent
a3cb039e83
commit
c0ee512980
14 changed files with 78 additions and 62 deletions
|
@ -76,3 +76,66 @@ license-files = []
|
|||
name = "pytorch-cpu"
|
||||
url = "https://download.pytorch.org/whl/cpu"
|
||||
explicit = true
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 120
|
||||
exclude = [
|
||||
"./.git",
|
||||
"./docs/*",
|
||||
"./build",
|
||||
"./scripts",
|
||||
"./venv",
|
||||
"*.pyi",
|
||||
".pre-commit-config.yaml",
|
||||
"*.md",
|
||||
".flake8",
|
||||
]
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = [
|
||||
"B", # flake8-bugbear
|
||||
"B9", # flake8-bugbear subset
|
||||
"C", # comprehensions
|
||||
"E", # pycodestyle
|
||||
"F", # Pyflakes
|
||||
"N", # Naming
|
||||
"W", # Warnings
|
||||
"I", # isort
|
||||
]
|
||||
ignore = [
|
||||
"E203",
|
||||
"E305",
|
||||
"E402",
|
||||
"E501", # line too long
|
||||
"E721",
|
||||
"E741",
|
||||
"F405",
|
||||
"F821",
|
||||
"F841",
|
||||
"C408", # ignored because we like the dict keyword argument syntax
|
||||
"E302",
|
||||
"W291",
|
||||
"E303",
|
||||
"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
|
||||
# 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",
|
||||
"N802", # random naming hints don't need
|
||||
# these ignores are from flake8-bugbear; please fix!
|
||||
"B007",
|
||||
"B008",
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue