Skip to content
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

Properly dedent doc strings after parsing in the proc-macro #1899

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

badboy
Copy link
Member

@badboy badboy commented Dec 13, 2023

Fixes #1884


I changed both docstring tests. We can unify those tests in a followup.

@badboy badboy requested a review from a team as a code owner December 13, 2023 12:58
@badboy badboy requested review from mhammond and removed request for a team December 13, 2023 12:58
@@ -36,7 +36,13 @@
assert AssociatedErrorTest.Test2.__doc__ == "<docstring-associated-error-variant-2>"

# Test objects
assert ObjectTest.__doc__ == "<docstring-object>"
expected_object_doc = """
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it wasn't immediately clear to me why this was expected. Can you please see if a test in fixtures/procmacros isn't too difficult, and there you can test the string without the language-specific indents added by languages, and also comment about exactly why the value is what it is (ie, describe in words the intent of the dedent). Ideally here you'd also explain the same (but in this case, IIUC, Python has added an indent to match the indent of the object definition in the generated .py code?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Properly strip/dedent parsed comments
2 participants