chore: make ruff also format code examples in docstrings#2318
chore: make ruff also format code examples in docstrings#2318
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.
This is the PR, the rest is auto-fmt-work
There was a problem hiding this comment.
I did not find a way to put these settings into the pre-commit file 😢
There was a problem hiding this comment.
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.
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:
|
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.