On mar. 11 sept. 2012 10:13:55 CEST, Sylvain Thénault wrote:
> On 10 septembre 11:12, afayolle wrote:
>> Hello list,
>
> Hi Alexandre,
>
>> I'm using
>>
>> $ pylint --version
>> pylint 0.25.0,
>> astng 0.23.0, common 0.57.1
>> Python 2.7.3 (default, Aug  1 2012, 05:16:07)
>> [GCC 4.6.3]
>>
>>
>> I'm looking for a way of running just the similarities checker on my code.
>>
>> I've managed so far with:
>>
>> pylint
>> --disable="basic,logging,string_format,format,typecheck,variables,miscellaneous,metrics,imports,classes,design,exceptions,newstyle"
>>
>> but this is quite awkward, and not resistant to future addition of new
>> checkers.
>>
>> Ideally, I'd like to be able to write --disable-all
>> --enable=similarities, but this does not work (disable-all being only
>> available as an in-file directive, as far as I can tell). Any other
>> suggestion before I wet my hands in a patch to enable --disable-all on
>> the command line?
>
> Having disable-all working on the command line would be cool (there is a 
> ticket
> for that matter iirc). So I'm not sure I should tell you that you could try
> "--disable=IEWRC --enable=similarities"...

Actually the correct syntax is "--disable=I,E,W,R,C,F 
--enable=similarities" and thanks, I had forgotten about that trick.

I keep getting confused about the arithmetics of this way of expressing 
things (disabling classes of warnings and enabling a checker), as I'm 
not certain at all that the R0801 issued by the similarities checker 
will indeed be produced after I've disabled all R messages. However the 
underlying logic becomes clearer when you see what the following does:

 --disable=I,E,R,W,C,F --enable classes --disable=W

So a simple way of implementing the "disable all" thingie would be 
allowing --disable=all and substituting 'all' with 'I,E,R,W,C,F' during 
option processing.

-- Alexandre



_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to