-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Fixed dedent
for tab indent.
#4870
Conversation
dedent
for tab indent.dedent
for tab indent.
Actually, that breaks the backward compatibility with the older dedent. I don't get why the second line's tabulation should be removed. |
We use diff --git a/tests/test_description.py b/tests/test_description.py
index 001a3ea..54a2aab 100644
--- a/tests/test_description.py
+++ b/tests/test_description.py
@@ -82,6 +82,24 @@ class TestViewNamesAndDescriptions(TestCase):
assert MockView().get_view_description() == DESCRIPTION
+ class MockViewTabs(APIView):
+ """an example docstring
+\t\t\t====================
+
+\t\t\t* list
+\t\t\t* list
+
+\t\t\tanother header
+\t\t\t--------------
+
+\t\t\t\tcode block
+
+\t\t\tindented
+
+\t\t\t# hash style header #"""
+
+ assert MockViewTabs().get_view_description() == DESCRIPTION.replace(' ', '\t')
+
def test_view_description_can_be_empty(self):
"""
Ensure that if a view has no docstring, |
Depending on whether or not result = 'first string\n\nsecond string'
assert dedent(" first string\n\n second string") == result Passes or fails on the latest master should determine whether or not the equivalent tab case should pass or fail. Ultimately we want to be consistent, but we also don't want to break backwards compatibility when we don't need to. Unfortunately I didn't get the chance to test this out on the latest master, which is why I'm leaving this as a comment. |
assert dedent(" first string\n\n second string") == 'first string\n\nsecond string' passes on the latest master, please take a look also at related test I wouldn't say that PR breaks backward compatibility, because |
I was not sure what the expected behavior from dedent was. #4345 clearly states it isn't working as expected for tabs. Will requalify this once I have access to my computer. Thanks for the clarifications. |
Thanks for taking the time to fix it and supporting it. |
Refs #4869