Hello,
recently Sylvain Thenault did a great work on creating a simple help
message and setting up a refactoring for speed improvement.
I think we are quite near to closing the ticket #19426 "first bad
impression", but would propose the following simple enhancements :
1/
"-d" option for --disable
Sylvain would have liked "-e" or "-E" for --enable to have it symmetric.
However i am not sure this is necessary since by default most checkers /
messages will stay enabled. (At least, this is how I understood the
discussion whether to disble C and R or not by default.)
What is the usecase for --enable ? Is it possible to do
$ pylint --disable=C --enable=C0111
having only C0111 enabled?
2/ Imho, we should add "--list-msgs" to "pylint --help" : we often want to
disable quickly a message and might not remember the id, or would like to
have a fast overview.
3/ I also would like
-w, --warning meaning --disable=C,R
or better :
-q, --quick meaning disable=C,R and disable some more warnings
which we don't care in pre-commit like situation
(for example the list of messages under c/ listed
below)
Has anyone important things to add about #19426 ?
Completed list of different kind of messages (proposal)
-----8<--------------------------------8<--------------------
0/
:W0511: Used when a warning note as FIXME or XXX is detected.
Move it to Notes / Informations (and maybe we should mention the (I)
Information category at the end of --long-help and in --lst-msgs
a/ almost errors
:W0102: *Dangerous default value %s as argument*
:W0150: *%s statement in finally block may swallow exception*
:W0221: *Arguments number differs from %s method*
:W0222: *Signature differs from %s method*
:W0311: *Bad indentation. Found %s %s, expected %s*
( --> is there a possibility of distinguishing accidental
indentation error from systematic ? )
:W0406: *Module import itself*
:W0410: *__future__ import is not the first non docstring statement*
:W0601: *Global variable %r undefined at the module level*
:W1111: *Assigning to function call which only returns None*
a/ things that can be fixed quickly
:W0101: *Unreachable code*
:W0102: *Dangerous default value %s as argument*
:W0104: *Statement seems to have no effect*
:W0107: *Unnecessary pass statement*
:W0108: *Lambda may not be necessary*
:W0109: *Duplicate key %r in dictionary*
:W0199: *Assert called on a 2-uple. Did you mean 'assert x,y'?*
:W0211: *Static method with %r as first argument*
:W0301: *Unnecessary semicolon*
:W0331: *Use of the <> operator*
:W0332: *Use l as long integer identifier*
:W0333: *Use of the `` operator*
:W0403: *Relative import %r, should be %r*
:W0404: *Reimport %r (imported line %s)*
:W0602: *Using global for %r but no assignment is done*
:W0604: *Using the global statement at the module level*
:W0611: *Unused import %s*
:W0612: *Unused variable %r*
:W6501: *Specify string format arguments as logging function parameters*
:W9900: *Format string dictionary key should be a string, not %s*
etc.
c/ warnings that could be considered as refactoring or conventions
( maybe we could add a category 'Doubtful' or 'Suspicious' ? )
:W0105: *String statement has no effect*
:W0122: *Use of the exec statement*
:W0141: *Used builtin function %r*
:W0142: *Used * or ** magic*
:W0201: *Attribute %r defined outside __init__*
:W0212: *Access to a protected member %s of a client class*
:W0223: *Method %r is abstract in class %r but is not overridden*
:W0231: *__init__ method from base class %r is not called*
:W0232: *Class has no __init__ method*
:W0233: *__init__ method from a non direct base class %r is called*
:W0401: *Wildcard import %s*
:W0402: *Uses of a deprecated module %r*
:W0603: *Using the global statement*
:W0613: *Unused argument %r*
:W0614: *Unused import %s from wildcard import*
:W0621: *Redefining name %r from outer scope (line %s)*
:W0622: *Redefining built-in %r*
:W0702: *No exception type(s) specified*
:W0703: *Catch "Exception"*
:W0704: *Except doesn't do anything*
:W0710: *Exception doesn't inherit from standard "Exception" class*
? :W1001: *Use of "property" on an old style class*
(I don't know if this is not more 'almost an error')
:W9901: *Unused key %r in format string dictionary*
-----8<--------------------------------8<--------------------
--
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