Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
49 lines (41 loc) · 2.34 KB
/
Copy pathpyproject.toml
File metadata and controls
49 lines (41 loc) · 2.34 KB
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
[tool.ruff]
line-length = 119
extend-exclude = [
"src/diffusers/pipelines/flux2/system_messages.py",
]
[tool.ruff.lint]
# Never enforce `E501` (line length violations).
ignore = ["C901", "E501", "E721", "E741", "F402", "F823"]
select = ["C", "E", "F", "I", "W", "TID251"]
# `utils/tests_fetcher.py` selects the tests a PR runs from the import graph. `auto_pipeline.py` imports every
# pipeline, so a test that imports an AutoPipeline is selected on every pipeline change. Tests use the concrete
# pipeline class instead; the auto pipelines' own test is the one exception.
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"diffusers.AutoPipelineForText2Image".msg = "AutoPipeline imports are not allowed in tests because they interfere with the test fetcher's selection logic. Use the specific pipeline class instead (e.g. `FluxPipeline`)."
"diffusers.AutoPipelineForImage2Image".msg = "AutoPipeline imports are not allowed in tests because they interfere with the test fetcher's selection logic. Use the specific pipeline class instead (e.g. `FluxPipeline`)."
"diffusers.AutoPipelineForInpainting".msg = "AutoPipeline imports are not allowed in tests because they interfere with the test fetcher's selection logic. Use the specific pipeline class instead (e.g. `FluxPipeline`)."
"diffusers.AutoPipelineForText2Audio".msg = "AutoPipeline imports are not allowed in tests because they interfere with the test fetcher's selection logic. Use the specific pipeline class instead (e.g. `FluxPipeline`)."
# Ignore import violations in all `__init__.py` files.
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402", "F401", "F403", "F811"]
"src/diffusers/utils/dummy_*.py" = ["F401"]
# The AutoPipeline ban only concerns test selection; everything outside tests/ may use them.
"tests/pipelines/test_pipelines_auto.py" = ["TID251"]
"src/**" = ["TID251"]
"examples/**" = ["TID251"]
"benchmarks/**" = ["TID251"]
"scripts/**" = ["TID251"]
"utils/**" = ["TID251"]
"docs/**" = ["TID251"]
[tool.ruff.lint.isort]
lines-after-imports = 2
known-first-party = ["diffusers"]
[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"