Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add allow_missing_func_desc
when this option in set to ``True`` this will ignore the warning. Allowing docstrings to start with params. Add setting ``indent_size``. Add subsequent test case.
- Loading branch information
Showing
15 changed files
with
209 additions
and
64 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
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
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
def hello_there(x): | ||
def improper_indents(indents): | ||
""" | ||
hello and no following empty lines | ||
:param x: | ||
Contains improper indents and no following empty line below. | ||
:param indents: | ||
5 space indent | ||
just a second test | ||
4 space indent | ||
|
||
:return: | ||
3 space indent | ||
following lines are 4 space indented | ||
4 space indent | ||
""" | ||
return None |
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
def hello_there(x): | ||
def improper_indents(indents): | ||
""" | ||
hello and no following empty lines | ||
Contains improper indents and no following empty line below. | ||
|
||
:param x: | ||
:param indents: | ||
5 space indent | ||
just a second test | ||
4 space indent | ||
:return: | ||
3 space indent | ||
following lines are 4 space indented | ||
4 space indent | ||
""" | ||
return None |
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 |
---|---|---|
@@ -1,15 +1,21 @@ | ||
def x(): | ||
return 55 | ||
def docstring_missing(): | ||
return None | ||
|
||
|
||
def qr(): | ||
def docstring_testcase(dummy): | ||
""" | ||
this is heavy | ||
Improper 3 indents. | ||
|
||
:param x: | ||
ss | ||
:return:abc"""; return 88 | ||
:param dummy: | ||
dummy description | ||
:return:nothing""" return None | ||
|
||
|
||
def w(): | ||
""" Hello world """ | ||
def docstring_singleliner(): | ||
""" This is singleliner docstring. """ | ||
|
||
|
||
def docstring_inline(): | ||
""" | ||
Docstring followed by an inline docstring. | ||
""" # This is inline docstring |
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 |
---|---|---|
@@ -1,19 +1,25 @@ | ||
def x(): | ||
return 55 | ||
def docstring_missing(): | ||
return None | ||
|
||
|
||
def qr(): | ||
def docstring_testcase(dummy): | ||
""" | ||
this is heavy | ||
Improper 3 indents. | ||
|
||
:param x: | ||
ss | ||
:param dummy: | ||
dummy description | ||
:return: | ||
abc | ||
"""; return 88 | ||
nothing | ||
""" return None | ||
|
||
|
||
def w(): | ||
def docstring_singleliner(): | ||
""" | ||
Hello world | ||
This is singleliner docstring. | ||
""" | ||
|
||
|
||
def docstring_inline(): | ||
""" | ||
Docstring followed by an inline docstring. | ||
""" # This is inline docstring |
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 |
---|---|---|
@@ -1,3 +1,49 @@ | ||
""" | ||
:param t:xyz | ||
:return:123""" | ||
def docstring_missing_description(dummy): | ||
""" | ||
:param dummy:dummy description | ||
:return:nothing""" | ||
return None | ||
|
||
|
||
class docstring_class_testcase(dummy): | ||
""" | ||
Example docstring class. | ||
:param dummy:dummy description | ||
:return:nothing | ||
""" | ||
|
||
def docstring_memberfunction(self, dummy): | ||
""" | ||
This is a member function. | ||
:param dummy:dummy description | ||
:return:nothing | ||
""" | ||
return None | ||
return None | ||
|
||
|
||
class docstring_if_indented(): | ||
"""This is if indented function example.""" | ||
|
||
if 1 != 0: | ||
def hello_planet(self): | ||
""" | ||
This is `if` indented block function. | ||
""" | ||
else: | ||
def hello_venus(self): | ||
"""This is `if` indented block function.""" | ||
|
||
|
||
def docstring_inner_function(dummy): | ||
""" | ||
This is docstring inner function example. | ||
:param dummy: dummy description | ||
""" | ||
def check_directory(dummy): | ||
""" | ||
This is the inner function. | ||
:param dummy: dummy description | ||
:return: nothing | ||
""" | ||
return None |
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 |
---|---|---|
@@ -1,6 +1,67 @@ | ||
""" | ||
:param t: | ||
xyz | ||
:return: | ||
123 | ||
""" | ||
def docstring_missing_description(dummy): | ||
""" | ||
:param dummy: | ||
dummy description | ||
:return: | ||
nothing | ||
""" | ||
return None | ||
|
||
|
||
class docstring_class_testcase(dummy): | ||
""" | ||
Example docstring class. | ||
|
||
:param dummy: | ||
dummy description | ||
:return: | ||
nothing | ||
""" | ||
|
||
def docstring_memberfunction(self, dummy): | ||
""" | ||
This is a member function. | ||
|
||
:param dummy: | ||
dummy description | ||
:return: | ||
nothing | ||
""" | ||
return None | ||
return None | ||
|
||
|
||
class docstring_if_indented(): | ||
""" | ||
This is if indented function example. | ||
""" | ||
|
||
if 1 != 0: | ||
def hello_planet(self): | ||
""" | ||
This is `if` indented block function. | ||
""" | ||
else: | ||
def hello_venus(self): | ||
""" | ||
This is `if` indented block function. | ||
""" | ||
|
||
|
||
def docstring_inner_function(dummy): | ||
""" | ||
This is docstring inner function example. | ||
|
||
:param dummy: | ||
dummy description | ||
""" | ||
def check_directory(dummy): | ||
""" | ||
This is the inner function. | ||
|
||
:param dummy: | ||
dummy description | ||
:return: | ||
nothing | ||
""" | ||
return None |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
def myfunc(a, b, x): | ||
def docstring_missing_descriptions(a, b, x): | ||
""" | ||
|
||
:param a:slope | ||
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
def myfunc(a, b, x): | ||
def docstring_missing_descriptions(a, b, x): | ||
""" | ||
|
||
:param a: | ||
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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
def empty(): | ||
def docstring_improper_alignment(): | ||
""" | ||
first line not correctly aligned. | ||
First line not correctly aligned. | ||
But second can be aligned differently. | ||
Tabs are used here instead of spaces. | ||
|
||
:param x: | ||
:return: | ||
"""; return 88 | ||
""" return None |
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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
def empty(): | ||
def docstring_improper_alignment(): | ||
""" | ||
first line not correctly aligned. | ||
First line not correctly aligned. | ||
But second can be aligned differently. | ||
Tabs are used here instead of spaces. | ||
|
||
:param x: | ||
:return: | ||
"""; return 88 | ||
""" return None |
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
def hello_there(x): | ||
def docstring_accepted(dummy): | ||
""" | ||
hello | ||
This is the accepted standard of a docstring. | ||
|
||
:param x: | ||
4 space indent | ||
just a second test | ||
:param dummy: | ||
first line description | ||
second line description | ||
:return: | ||
4 space indent | ||
following lines are 4 space indented | ||
first line description | ||
second line description | ||
""" | ||
return None |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
def empty(): | ||
def docstring_missing_descriptions(dummy): | ||
""" | ||
this is heavy | ||
This contains missing descriptions of parsed metadata. | ||
|
||
:param x: | ||
:param dummy: | ||
:return: | ||
"""; return 88 | ||
""" return None |
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,6 @@ | ||
def docstring_missing_description(dummy): | ||
""" | ||
:param dummy: | ||
a function starting with `param` | ||
in this case allow_missing_func_desc = True | ||
""" |