forked from coala/coala-bears
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DocumentationStyleBear: Corrects generated patch
This removes the extra 'r' added in raw docstrings in generated patch in python by DocumentationStyleBear. Fixes coala#2010
- Loading branch information
Showing
4 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
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
51 changes: 51 additions & 0 deletions
51
tests/documentation/test_files/DocumentationStyleBear/bad_file6.py.test
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
def docstring_missing_description(dummy): | ||
r""" | ||
:param dummy:dummy description | ||
:return:nothing""" | ||
return None | ||
|
||
|
||
class docstring_class_testcase(dummy): | ||
r""" | ||
Example raw docstring class. | ||
:param dummy:dummy description | ||
:return:nothing | ||
""" | ||
|
||
def docstring_memberfunction(self, dummy): | ||
r''' | ||
This is a member function. | ||
:param dummy:dummy description | ||
:return:nothing | ||
''' | ||
return None | ||
return None | ||
|
||
|
||
class docstring_if_indented(): | ||
r'''This is if indented function example.''' | ||
|
||
if 1 != 0: | ||
def hello_planet(self): | ||
r""" | ||
This is `if` indented block function. | ||
""" | ||
return None | ||
else: | ||
def hello_venus(self): | ||
r"""This is `if` indented block function.""" | ||
return None | ||
|
||
|
||
def docstring_inner_function(dummy): | ||
r''' | ||
This is docstring inner function example. | ||
:param dummy: dummy description | ||
''' | ||
def check_directory(dummy): | ||
r""" | ||
This is the inner function. | ||
:param dummy: dummy description | ||
:return: nothing | ||
""" | ||
return None |
69 changes: 69 additions & 0 deletions
69
tests/documentation/test_files/DocumentationStyleBear/bad_file6.py.test.correct
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
def docstring_missing_description(dummy): | ||
r""" | ||
:param dummy: | ||
dummy description | ||
:return: | ||
nothing | ||
""" | ||
return None | ||
|
||
|
||
class docstring_class_testcase(dummy): | ||
r""" | ||
Example docstring class. | ||
|
||
:param dummy: | ||
dummy description | ||
:return: | ||
nothing | ||
""" | ||
|
||
def docstring_memberfunction(self, dummy): | ||
r''' | ||
This is a member function. | ||
|
||
:param dummy: | ||
dummy description | ||
:return: | ||
nothing | ||
''' | ||
return None | ||
return None | ||
|
||
|
||
class docstring_if_indented(): | ||
r''' | ||
This is if indented function example. | ||
''' | ||
|
||
if 1 != 0: | ||
def hello_planet(self): | ||
r""" | ||
This is `if` indented block function. | ||
""" | ||
return None | ||
else: | ||
def hello_venus(self): | ||
r""" | ||
This is `if` indented block function. | ||
""" | ||
return None | ||
|
||
|
||
def docstring_inner_function(dummy): | ||
r''' | ||
This is docstring inner function example. | ||
|
||
:param dummy: | ||
dummy description | ||
''' | ||
def check_directory(dummy): | ||
r""" | ||
This is the inner function. | ||
|
||
:param dummy: | ||
dummy description | ||
:return: | ||
nothing | ||
""" | ||
return None |
12 changes: 12 additions & 0 deletions
12
tests/documentation/test_files/DocumentationStyleBear/good_file4.py.test
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
def docstring_accepted(dummy): | ||
r""" | ||
This is the accepted standard of a docstring. | ||
|
||
:param dummy: | ||
first line description | ||
second line description | ||
:return: | ||
first line description | ||
second line description | ||
""" | ||
return None |