diff options
| author | cpopa <devnull@localhost> | 2014-07-25 18:06:10 +0200 |
|---|---|---|
| committer | cpopa <devnull@localhost> | 2014-07-25 18:06:10 +0200 |
| commit | 32daab9a97c18d2fd81db232ed7453a8db762afe (patch) | |
| tree | f69b098ea643b054612af32ab698f1501d5a5a81 /test | |
| parent | c8cb305ddcfae15719ac73ffe50979217a7bd004 (diff) | |
| download | pylint-32daab9a97c18d2fd81db232ed7453a8db762afe.tar.gz | |
Don't emit 'missing-docstring' when the actual docstring uses `.format`. Closes issue #281.
Diffstat (limited to 'test')
| -rw-r--r-- | test/functional/docstrings.py (renamed from test/input/func_docstring.py) | 156 | ||||
| -rw-r--r-- | test/functional/docstrings.txt | 8 | ||||
| -rw-r--r-- | test/messages/func_docstring.txt | 8 |
3 files changed, 91 insertions, 81 deletions
diff --git a/test/input/func_docstring.py b/test/functional/docstrings.py index e73d8a3..9ef09f5 100644 --- a/test/input/func_docstring.py +++ b/test/functional/docstrings.py @@ -1,73 +1,83 @@ -# pylint: disable=R0201 - -__revision__ = '' - -def function0(): - """""" - -def function1(value): - # missing docstring - print value - -def function2(value): - """docstring""" - print value - -def function3(value): - """docstring""" - print value - -class AAAA(object): - # missing docstring - -## class BBBB: -## # missing docstring -## pass - -## class CCCC: -## """yeah !""" -## def method1(self): -## pass - -## def method2(self): -## """ yeah !""" -## pass - - def method1(self): - pass - - def method2(self): - """ yeah !""" - pass - - def method3(self): - """""" - pass - - def __init__(self): - pass - -class DDDD(AAAA): - """yeah !""" - - def __init__(self): - AAAA.__init__(self) - - def method2(self): - """""" - pass - - def method3(self): - pass - - def method4(self): - pass - -# pylint: disable=missing-docstring -def function4(): - pass - -# pylint: disable=empty-docstring -def function5(): - """""" - pass +# pylint: disable=R0201
+# -1: [missing-docstring]
+__revision__ = ''
+
+# +1: [empty-docstring]
+def function0():
+ """"""
+
+# +1: [missing-docstring]
+def function1(value):
+ # missing docstring
+ print(value)
+
+def function2(value):
+ """docstring"""
+ print(value)
+
+def function3(value):
+ """docstring"""
+ print(value)
+
+# +1: [missing-docstring]
+class AAAA(object):
+ # missing docstring
+
+## class BBBB:
+## # missing docstring
+## pass
+
+## class CCCC:
+## """yeah !"""
+## def method1(self):
+## pass
+
+## def method2(self):
+## """ yeah !"""
+## pass
+
+ # +1: [missing-docstring]
+ def method1(self):
+ pass
+
+ def method2(self):
+ """ yeah !"""
+ pass
+
+ # +1: [empty-docstring]
+ def method3(self):
+ """"""
+ pass
+
+ def __init__(self):
+ pass
+
+class DDDD(AAAA):
+ """yeah !"""
+
+ def __init__(self):
+ AAAA.__init__(self)
+
+ # +1: [empty-docstring]
+ def method2(self):
+ """"""
+ pass
+
+ def method3(self):
+ pass
+
+ # +1: [missing-docstring]
+ def method4(self):
+ pass
+
+# pylint: disable=missing-docstring
+def function4():
+ pass
+
+# pylint: disable=empty-docstring
+def function5():
+ """"""
+ pass
+
+def function6():
+ """ I am a {} docstring.""".format("good")
diff --git a/test/functional/docstrings.txt b/test/functional/docstrings.txt new file mode 100644 index 0000000..1ea5c7d --- /dev/null +++ b/test/functional/docstrings.txt @@ -0,0 +1,8 @@ +missing-docstring:1::Missing module docstring
+empty-docstring:6:function0:Empty function docstring
+missing-docstring:10:function1:Missing function docstring
+missing-docstring:23:AAAA:Missing class docstring
+missing-docstring:40:AAAA.method1:Missing method docstring
+empty-docstring:48:AAAA.method3:Empty method docstring
+empty-docstring:62:DDDD.method2:Empty method docstring
+missing-docstring:70:DDDD.method4:Missing method docstring
diff --git a/test/messages/func_docstring.txt b/test/messages/func_docstring.txt deleted file mode 100644 index 932df5e..0000000 --- a/test/messages/func_docstring.txt +++ /dev/null @@ -1,8 +0,0 @@ -C: 1: Missing module docstring -C: 5:function0: Empty function docstring -C: 8:function1: Missing function docstring -C: 20:AAAA: Missing class docstring -C: 36:AAAA.method1: Missing method docstring -C: 43:AAAA.method3: Empty method docstring -C: 56:DDDD.method2: Empty method docstring -C: 63:DDDD.method4: Missing method docstring |
