[PATCH 0 of 2] reduce possibility of skipping check-code when not desired

Simon Heimberg simohe at besonet.ch
Wed Nov 13 11:46:09 UTC 2013


--On Tuesday, 12.11.2013 01:39 +0100 Mads Kiilerich <mads at kiilerich.com> 
wrote:

> On 11/12/2013 12:40 AM, Simon Heimberg wrote:
>> check-code.py was skipped on entire files by accident.
>>
>> The current pragma "no-check-code" was accidentally used in code (in
>> check-code.py itself).
>
> Exactly where did that happen? And why not just fix that instead of
> redefining and "complexify" something that is simple and works fine?

This is fixed of course (since e033a7d444ac). It was in filterpyflakes.py,
not in check-code.py, sorry. But it was there for more than two years
(which is more then 2600 commits).
One of the wrong used comments was also fixed in e033a7d444ac, in 
test-remove.t.
It had been there for almost 3 years!
The same problem was in test-subrepo-path, fixed in ee07f9d142c9 after 1.4 
years.

So I am still convinced that avoiding to reintroduce this is a good idea. 
But
while writing this answer I found a much simpler solution:
check-code.py always prints a message when a file is skipped because of
no-check-code. (Currently it is only debugging output). So the skipped 
files
(currently 5) have to be listed in the expected output in 
test-check-code-hg.t.
(Only one single place to check). When "no-check-code" slips in, this will 
be
reported by run-tests.

What about this simpler proposal?
(one patch with -4/+2 lines in check-code.py, -0/+5 lines in 
test-check-code-hg.t)

Greetings,
Simon

>
> /Mads
>
>> Patch 1 adresses mainly this by requiring "# no-check-code".
>>
>> Patch 2 adresses the problem of skipping the entire file instead of
>> skipping only one line. The pragma must be in a comment on a separate
>> line. And it must be near start of file (as in polib.py) or near end of
>> file (as in httpclient).
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel at selenic.com
>> http://selenic.com/mailman/listinfo/mercurial-devel








More information about the Mercurial-devel mailing list