You can select the docstring and format it using Edit -> Fill paragraph.
Alternatively the only automated tool I can think of (in Pycharm) is the option which automatically wraps the text after the line length reaches certain number of characters; It is available under Code Style settings (Hard wrap at & Wrap on typing). However, this setting is applied on everything (code included), not just docstring.
python - How can I auto-format a docstring in PyCharm? - Stack Overflow
Change docstring style for a project's entire codebase
What style does PyCharm / IntelliJ use for Python docstrings? - Stack Overflow
No More Docstring Despair: Highlight Them in VSCode!
Videos
Hi Everyone,
I was looking at my code and realized the default docstring isn't my type. I have pretty much all my classes/methods documented in that type. I'm wondering is there any way to change the docstring type (e.g: numpy/google) for each module/class/function in my project automatically.
Would really appreciate, thanks in advance :D
Those are the Sphinx style doc strings.
Python has some strong opinions about doc strings, see PEP257.
Here is a full description of all of the doc string types in Python: What is the standard Python docstring format?
Found this in townie's link:
https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
I'm pretty sure restructured text is the default in PyCharm 2024.2