-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add: utility to format our docs too 📜 #7314
Conversation
ruff check examples tests src utils scripts | ||
ruff format examples tests src utils scripts --check | ||
run: make quality |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes more sense to just run the make quality
command here instead of manually repeating the exact same commands we already have under the quality
alias of our Makefile.
Makefile
Outdated
@@ -42,6 +42,7 @@ repo-consistency: | |||
quality: | |||
ruff check $(check_dirs) setup.py | |||
ruff format --check $(check_dirs) setup.py | |||
doc-builder style src/diffusers tests docs/source --max_len 119 --check_only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Major change 1.
Makefile
Outdated
@@ -55,6 +56,7 @@ extra_style_checks: | |||
style: | |||
ruff check $(check_dirs) setup.py --fix | |||
ruff format $(check_dirs) setup.py | |||
doc-builder style src/diffusers tests docs/source --max_len 119 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Major change 2.
@@ -130,6 +130,7 @@ | |||
"torchvision", | |||
"transformers>=4.25.1", | |||
"urllib3<=2.0.0", | |||
"black", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Major change 3.
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
The failing tests should be fixed with #7329 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for doing this! I left one question
I'm really not too familiar this so I cced @BenjaminBossan for help here
are we not able to use Ruff to format code examples?
Unfortunately not. We rely on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Sayak, the PR looks good. This makes the code much easier to read, so great addition.
* add: utility to format our docs too 📜 * debugging saga * fix: message * checking * should be fixed. * revert pipeline_fixture * remove empty line * make style * fix: setup.py * style.
diffusers commit 4a34307 add: utility to format our docs too 📜 (huggingface/diffusers#7314)
Modify `loaders/unet_loader_utils` according to these commits diffusers commit 4a34307: add: utility to format our docs too 📜 (huggingface/diffusers#7314) diffusers commit 21c747f: Support InstantStyle (huggingface/diffusers#7668)
What does this PR do?
TL;DR: We should be formatting our docs with
hf-doc-builder
utility so that the code examples and other content in our docs are formatted properly.This PR enables this for both in
make style && make quality
and in the CI.Most of the changes in this PR are a result of running
make style && make quality
with the doc-formatting added.hf-doc-builder
needsblack
as an implicit dependency.