-
Notifications
You must be signed in to change notification settings - Fork 19
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
Wrap indent docstring in newlines for UnionSnippet #777
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Generate changelog in
|
LorenzoMartini
changed the title
Wrap indent docstring in trailing newline for PythonService
Wrap indent docstring in trailing newline for UnionSnippet
Feb 6, 2024
LorenzoMartini
changed the title
Wrap indent docstring in trailing newline for UnionSnippet
Wrap indent docstring in newlines for UnionSnippet
Feb 6, 2024
Failing on unrelated stuff due to develop of this repo being broken |
Issue that's currently blocking this is fixed in #778 |
👍 |
Released 4.10.0 |
LorenzoMartini
added a commit
that referenced
this pull request
Feb 7, 2024
Wrap indent docstring in newlines for UnionSnippet
johnhany97
pushed a commit
that referenced
this pull request
Feb 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this PR
The
UnionSnippet.emit(PythonPoetWriter poetWriter)
method parses conjure class definitions into python code bindings. As part of the process, it extractsdocs
components from the apis and wraps them in the python docstring format, which is the triple-quote"""
.If a docstring terminates with a
"
(which it shouldn't), that would cause a set of 4 consecutives"
, which is invalid python and that will cause errors when reading from these files.For example, if I define my conjure api like
this will cause the following error when reading the generated conjure python bindings:
After this PR
Fix up UnionSnippet to have newlines wrapping the content and extract the doc-writing into a separate method being reused across all cases.
==COMMIT_MSG==
Wrap indent docstring in newlines for UnionSnippet
==COMMIT_MSG==
Possible downsides?
The pythonic way of doing docstrings has them in the format
but we currently do
I will change that in a separate PR, this is a more time-sensitive fix.