On Friday 26 March 2010 17:32:32 Donovan Lee Wanhoy wrote:
> Hi,
>
> Here is my new patch. Made the changes that you (Emile) requested. Ran
> all the pylint tests and.called the test file
> func_noerror_no_docstring_warning.
>
Thank you very much! I did a slight modication since I think that
methods can also be conditionally defined (e.g. with 'if' like in the 
modified test) and that we should not warn in that case either.

Here is what I changed :

diff -r b10165e57c2f checkers/base.py
--- a/checkers/base.py  Mon Mar 29 10:19:00 2010 +0200
+++ b/checkers/base.py  Mon Mar 29 10:29:34 2010 +0200
@@ -432,7 +432,7 @@
         self._check_name(f_type, node.name, node)
         # docstring
         if self.config.no_docstring_rgx.match(node.name) is None:
-            if isinstance(node.parent, astng.Class):
+            if isinstance(node.parent.frame(), astng.Class):
                 overridden = False
                 # check if node is from a method overridden by its 
ancestor
                 for ancestor in node.parent.frame().ancestors():
diff -r b10165e57c2f test/input/func_noerror_no_warning_docstring.py
--- a/test/input/func_noerror_no_warning_docstring.py   Mon Mar 29 
10:19:00 2010 +0200
+++ b/test/input/func_noerror_no_warning_docstring.py   Mon Mar 29 
10:29:34 2010 +0200
@@ -33,6 +33,10 @@
         BBBB.__init__(self)
     
     # should ignore docstring since CCCC is inherited from BBBB which is 
-    # inherited from AAAA containing method3
-    def method2(self):
-        AAAA.method2(self)
+    # inherited from AAAA containing method2
+    if __revision__:
+        def method2(self):
+            AAAA.method2(self)
+    else:
+        def method2(self):
+            AAAA.method1(self)


-- 

Emile Anclin <[email protected]>
http://www.logilab.fr/   http://www.logilab.org/ 
Informatique scientifique & et gestion de connaissances
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to