Commit Graph

13 Commits

Author SHA1 Message Date
FUJIWARA Katsunori
6e07d94050 tests: make filterpyflakes.py read target files relatively to cwd
Before this patch, 'filterpyflakes.py' reads target files relatively
to own location.

But this prevents third party tools from using it in own source tree,
because their files are placed separately from 'filterpyflakes.py'.

In fact, 'test-check-pyflakes.t', which is the only user of
'filterpyflakes.py', changes current working directory (cwd) to the
root of "test target" source tree before using it. Therefore,
composing the root of source tree in 'filterpyflakes.py' is redundant.

This patch makes 'filterpyflakes.py' read target files relatively to
cwd by invoking 'open()' without any path composition. This also
removes importing 'os' module, because there is no user of it after
this patch.

This is a one of preparation of issue4677.
2015-08-13 22:10:52 +09:00
Matt Mackall
89a3b43f20 filterpyflakes: filter WindowsError unconditionally 2014-05-13 19:29:45 -05:00
Matt Mackall
88809bfcbd filterpyflakes: make memoryview filtering unconditional 2014-05-13 19:22:40 -05:00
FUJIWARA Katsunori
6750e4199f tests: ignore "undefined name 'memoryview'" pyflakes error on earlier Python
Before this patch, "test-check-pyflakes.t" shows unexpected "undefined
name 'memoryview'" error for "mercurial/util.py" on Python 2.6.x or
earlier, because they don't define symbol 'memoryview'.

This patch introduces excluding patterns into "filterpyflakes.py" to
ignore "undefined name 'memoryview'" pyflakes error on Python 2.6.x or
earlier
2014-05-09 08:44:53 +09:00
Yuya Nishihara
2e43b76140 test-pyflakes: detect undefined name error
It should be able to catch the following mistakes at 764c0874d3c8:

    mercurial/exchange.py:590: undefined name 'UnknownPartError'
    mercurial/match.py:346: undefined name 'pat'
    mercurial/win32.py:365: undefined name '_ERROR_NO_MORE_FILES'
    tests/killdaemons.py:46: undefined name 'check'
2014-04-29 12:54:01 +09:00
Mads Kiilerich
1e900bb145 check-code: check for spaces around = for named parameters 2013-10-03 14:50:47 +02:00
Simon Heimberg
180e520fa6 tests: do not skip code-checking on some whole files
In filterpyflakes the term no-check-code was probably by accident.
In the test the intention was not to skip the entire file but only one
line. But any skipping seems to be unnecessary since a longer time.
2013-07-01 06:50:58 +02:00
Simon Heimberg
3110add076 tests: simplify and document the sorting of pyflake messages
The pyflake messages are simply ordered by message type, path, line no (and
message text).
The message type is taken from the order of the filters.

The previous ordering looks complicated and illogically.
It was the following order (r'\3:\5:\4:\1:\2:' + line):
  message (\3 and \5)
  var name (\4)
  path (\1)
  line no (\2)
  line reference
Ordering by var name before path looks illogically for me.
2013-06-26 23:12:55 +02:00
Augie Fackler
3b46ff5101 pyflakes: ignore files marked no-check-code 2011-05-06 10:17:07 -05:00
timeless
1760e54c82 test: add pyflakes checking for unable to detect undefined names 2011-05-01 17:36:16 +02:00
timeless
8351ef925f tests: add pyflakes checking for assigned to but never used 2011-05-01 17:27:41 +02:00
timeless
1e24d74cfd test-pyflake: improve sorting algorithm 2011-05-01 18:56:27 +02:00
timeless
75e43f8a4b tests: add pyflakes checking for unused imports 2011-05-01 15:22:30 +02:00