[PATCH 3 of 3 RFC] current failings for "undefined name"

Matt Mackall mpm at selenic.com
Tue May 3 15:51:58 CDT 2011


On Sun, 2011-05-01 at 14:17 -0500, timeless wrote:
> # HG changeset patch
> # User timeless <timeless at mozdev.org>
> # Date 1304276834 -7200
> # Node ID 70f98098faeef0e71c3163c518138641c05af416
> # Parent  d4ae94b08329cba945c387014583238217765807
> current failings for "undefined name"
> 
> diff --git a/tests/filterpyflakes.py b/tests/filterpyflakes.py
> --- a/tests/filterpyflakes.py
> +++ b/tests/filterpyflakes.py
> @@ -24,6 +24,7 @@ for line in sys.stdin:
>              r"unable to detect undefined names",
>              r"redefinition of function",
>              r"redefinition of unused",
> +            r"undefined name",
>             ]
>      if not re.search('|'.join(pats), line):
>          continue
> diff --git a/tests/test-check-pyflakes.t b/tests/test-check-pyflakes.t
> --- a/tests/test-check-pyflakes.t
> +++ b/tests/test-check-pyflakes.t
> @@ -46,5 +46,8 @@
>    mercurial/context.py:*: redefinition of unused 'stat' from line * (glob)
>    hgext/convert/subversion.py:*: redefinition of unused 'svn' from line * (glob)
>    mercurial/keepalive.py:*: redefinition of unused 'time' from line * (glob)
> +  mercurial/py3kcompat.py:*: undefined name 'bytes' (glob)
> +  mercurial/py3kcompat.py:*: undefined name 'bytes' (glob)
> +  mercurial/py3kcompat.py:*: undefined name 'bytes' (glob)

..and 'bytes' is of course a built-in in insipid versions of Python. 

Did this one catch anything interesting? Basically, a good lint test
should a) catch some things we're -currently- doing wrong and b) catch
more of those than false positives by a good margin.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list