Hi,
Here is a new diff file with the changes.
Donovan Lee Wanhoy
On Mon, Mar 22, 2010 at 12:30 PM, Emile Anclin <[email protected]>wrote:
> On Thursday 18 March 2010 06:33:01 Donovan Lee Wanhoy wrote:
> > Hi,
> >
> > Is there a reason to make it optional, rather than have it enabled at
> > all
> >
> > > times?
> >
> > I assumed that the bug ticket said to make it optional. Attached is the
> > same code except there is no option check.
> > Hope this one is okay.
> >
> > Donovan Lee Wanhoy
>
>
> I don't know to which files belong the diffs you send us.
>
> Could you send us a nice patch, something like
>
> $ hg diff > no-docstring-warning.diff
>
> ?
>
> Sending a mercurial diff makes it very easy to import it:
> we can use it with the mercurial extention mqueue, or with
> $ hg patch (--no-comit) something.diff
>
> --
>
> 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
>
diff -r f5f084e5267a checkers/base.py
--- a/checkers/base.py Thu Mar 04 12:12:32 2010 +0100
+++ b/checkers/base.py Mon Mar 22 13:35:46 2010 -0400
@@ -428,7 +428,14 @@
self._check_name(f_type, node.name, node)
# docstring
if self.config.no_docstring_rgx.match(node.name) is None:
- self._check_docstring(f_type, node)
+ overridden = False
+ # check if node is from a method overridden by its ancestor
+ for ancestor in node.parent.frame().ancestors():
+ if node.name in ancestor and \
+ isinstance(ancestor[node.name], astng.Function):
+ overridden = True
+ if not overridden:
+ self._check_docstring(f_type, node)
# check default arguments'value
self._check_defaults(node)
# check arguments name
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects