On 06/05/12 16:43, Shawn Walker wrote:
[snip]
----------------------------------------
src/modules/misc2.py
----------------------------------------
Not thrilled about having a separate module only because of
pylinting :-(
I'm not ok with this. Please either
1) just move the code in misc2.py into misc.py
2) or do 1 and make misc.py pylint clean (preferably in another changeset)
3) or do 1 and change the pylintrc file so that misc.py is pylint clean
4) or do 1 and some combination of 2 and 3
Finding things can be difficult as is, and going into misc.py to look
for something only to find discover that it's been hidden over in
misc2.py isn't ideal. Not to mention that I believe it also increases
the change of duplicating names or functions.
When I talked with Ed about this online, he asked that I propose changes
I'd like to see for our pylintrc file. So I went back and looked at what
I had done when I looked at making our code work with pylint better.
Here's what I found:
The following messages should be disabled:
# C0302 Too many lines in module
# R0904 Too many public methods
# R0911 Too many return statements
# R0912 Too many branches
# R0915 Too many statements
# W0142 Used * or ** magic
# W0511 Used when a warning note as FIXME or XXX is detected.
# W0612 Unused variable
disable-msg=C0302,R0904,R0911,R0912,R0915,W0142,W0511,W0612
The argument rgx should be changed to be:
# Regular expression which should only match correct argument names
argument-rgx=[a-z_][a-z0-9_]{0,30}$
The variable reg exp should be changed to:
# Regular expression which should only match correct variable names
variable-rgx=[a-z_][a-z0-9_]{0,30}$
The const-rgx should be changed to (though that one probably doesn't
need the 0, 30 on it, and perhaps the others don't either):
# Regular expression which should only match correct module level names
const-rgx=(([A-Z_][A-Z1-9_]*)|(__.*__)|([a-z_][a-z0-9_]{0,30}))$
We should also enable init_import which checks for unsed imports in
__init_files.
The regexp changes above should help with the C0103 errors that the code
will trigger.
Those are the changes I'd made. In addition, I'd also suggest (but
haven't tested):
R0201 should probably be disabled because it doesn't recognize when,
because of inheritance, a function needs self as an argument. For the
same reason, W0613 should be disabled.
Disable :R0902: *Too many instance attributes (%s/%s)*
Disable :R0913: *Too many arguments (%s/%s)*
Either disable W0403 or change the places that use relative imports to
use absolute imports, I don't really care which.
Either disable W0612 or provide a regexp that we can use to indicate to
pylint via the variable name that we don't plan on using it. In other
languages, using '_' represented a purposefully unused variable.
For now, I'd leave W0631 enabled, but that would depend on how many
false positives it generates over the entire code base.
And finally, I propose that unless some extraordinarily compelling
reason exists, that no pylint disable commands be allowed into the
source. Since we control lint, we should either fix the exception, turn
off the exception, or fix the code.
In that vein, it looks like the E1101 exception needs some tlc.
All of the above recommendations were based on attempting to make
everything under modules/actions pylint clean.
Brock
[snip]
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss