-
Notifications
You must be signed in to change notification settings - Fork 35
chore: make ruff also format code examples in docstrings #2318
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
base: master
Are you sure you want to change the base?
Conversation
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. |
[tool.ruff.format] | ||
# format code examples in docstrings to avoid users scrolling horizontally | ||
docstring-code-format = true | ||
docstring-code-line-length = 85 |
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.
This is the PR, the rest is auto-fmt-work
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 did not find a way to put these settings into the pre-commit file 😢
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.
Doesn't ruff already parse the pyproject.toml
file already? I tried to check out the first commit in the PR and run pre-commit --files SOME_PYTHON_FILE.PY
, and it did format the docstrings. If I do the same on the master branch, the docstrings are untouched.
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.
If I checkout f1c44291
and then run pre-commit run --all
, I end up with the same state as b57a65f1
✔️
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2318 +/- ##
==========================================
- Coverage 90.80% 90.79% -0.02%
==========================================
Files 168 168
Lines 25014 25014
==========================================
- Hits 22714 22711 -3
- Misses 2300 2303 +3
🚀 New features to boost your workflow:
|
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.
Very nice!
Note: We don't merge before v8 is in
Description
This is nice to have because we can avoid the very tedious horizontal scrolling in the SDK docs.