Skip to content

Commit

Permalink
Improve docstring.py. (#786)
Browse files Browse the repository at this point in the history
* Improve `docstring.py`.

* Format fixes by ruff

---------

Co-authored-by: knutnergaard <knutnergaard@users.noreply.github.com>
  • Loading branch information
knutnergaard and knutnergaard authored Nov 22, 2024
1 parent 8870400 commit cb9abed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions documentation/tools/docstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
NORMALIZATION_MODULE = "normalizers"
DEPRECATION_ID = "This method is deprecated."
INDENT = " " * 4
LINE_LENGTH = 72
LINE_LENGTH = 80

FORMAT_STRINGS: Dict[str, str] = {
"implementationNote": ("This is the environment implementation of {baseObject}."),
Expand Down Expand Up @@ -989,7 +989,7 @@ def insertDocstring(obj: Any, newDocstring: str, preserveVariadics: bool = True)
)
updatedSourceCode = (
"\n".join(sourceLines[: signatureEnd + 1])
+ f"\n{indent}{formattedDocstring}\n"
+ f"\n{indent * 2}{formattedDocstring}\n"
+ "\n".join(sourceLines[signatureEnd + 1 :])
)

Expand Down

0 comments on commit cb9abed

Please sign in to comment.