<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<br>
<div class="moz-cite-prefix">On 22.12.2015 13:43, Martin Basti
wrote:<br>
</div>
<blockquote cite="mid:5679458D.9090207@redhat.com" type="cite">
<br>
<br>
On 22.12.2015 08:06, Jan Cholasta wrote:
<br>
<blockquote type="cite">On 17.12.2015 14:18, Martin Basti wrote:
<br>
<blockquote type="cite">
<br>
<br>
On 17.12.2015 07:54, Jan Cholasta wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
On 17.12.2015 02:11, Martin Basti wrote:
<br>
<blockquote type="cite">Hello,
<br>
following patches cleanup the code and add checks to
pylint to avoid the
<br>
mess again
<br>
<br>
Patches: 379-381:
<br>
the most important patches, they cleanup imports
<br>
<br>
Patch 382:
<br>
enables various pylint checks, we may reduce the list of
check if
<br>
needed.
<br>
</blockquote>
<br>
Would it be possible to turn this into a blacklist of
disabled
<br>
warnings rather than a whitelist of enabled warnings?
<br>
<br>
<blockquote type="cite">
<br>
Patches 383 - 393:
<br>
remove minor issues from code, and enable particular
checks
<br>
Feel free to nack patches/checks that should not be there.
<br>
<br>
Please apply patches in order.
<br>
<br>
Martin^2
<br>
<br>
<br>
</blockquote>
<br>
Honza
<br>
<br>
</blockquote>
Updated patches attached.
<br>
</blockquote>
<br>
Patch 379: ACK
<br>
<br>
<br>
Patch 380:
<br>
<br>
1) This patch needs to be rebased.
<br>
<br>
<br>
2) make-lint is reporting this to me:
<br>
<br>
************* Module ipatests.test_cmdline.test_ipagetkeytab
<br>
ipatests/test_cmdline/test_ipagetkeytab.py:30:
[W0611(unused-import), ] Unused import nose)
<br>
ipatests/test_cmdline/test_ipagetkeytab.py:34:
[W0611(unused-import), ] Unused DN imported from ipapython.dn)
<br>
************* Module ipatests.test_cmdline.test_help
<br>
ipatests/test_cmdline/test_help.py:21: [W0611(unused-import), ]
Unused import contextlib)
<br>
ipatests/test_cmdline/test_help.py:23: [W0611(unused-import), ]
Unused assert_raises imported from nose.tools)
<br>
************* Module ipatests.test_cmdline.test_cli
<br>
ipatests/test_cmdline/test_cli.py:11: [W0611(unused-import), ]
Unused API_VERSION imported from ipapython.version)
<br>
************* Module ipaplatform.services
<br>
ipaplatform/services.py:59: [W0611(unused-import), ] Unused
timedate_services imported from ipaplatform.redhat.services)
<br>
************* Module ipaplatform.rhel.services
<br>
ipaplatform/rhel/services.py:59: [W0611(unused-import), ] Unused
timedate_services imported from ipaplatform.redhat.services)
<br>
************* Module ipaplatform.redhat.services
<br>
ipaplatform/redhat/services.py:306: [W0611(unused-import), ]
Unused timedate_services imported from
ipaplatform.base.services)
<br>
************* Module ipaplatform.fedora.services
<br>
ipaplatform/fedora/services.py:59: [W0611(unused-import), ]
Unused timedate_services imported from
ipaplatform.redhat.services)
<br>
************* Module ipalib.setup
<br>
ipalib/setup.py:28: [W0611(unused-import), ] Unused import
distutils.sysconfig)
<br>
<br>
Note that the "from ipaplatform.${PLATFORM}.services import
timedate_services" in services.py should be rewritten to
"timedate_services = ${PLATFORM}_services.timedate_services" to
fix this.
<br>
<br>
<br>
Patch 381: ACK
<br>
<br>
<br>
Patch 382:
<br>
<br>
Nitpick: according to
<a class="moz-txt-link-rfc2396E" href="http://docs.pylint.org/output.html"><http://docs.pylint.org/output.html></a>, the order of message
categories is F, E, W, C, R from the most severe to the least
severe (it does not mention I, but I think it should be last,
after R), IMO we should keep this order here as well for
clarity. (Don't worry, doing this should not require rebasing
the following patches.)
<br>
<br>
<br>
Patch 383 - 387: ACK
<br>
<br>
<br>
Patch 388:
<br>
<br>
IMO it would be better to rewrite this:
<br>
<br>
[(t.id, t.options) for t in doc.getKeyPackages()] #
pylint: disable=expression-not-assigned
<br>
<br>
into this:
<br>
<br>
for t in doc.getKeyPackages():
<br>
t._PSKCKeyPackage__process()
<br>
<br>
rather than disabling the check.
<br>
<br>
<br>
Patch 389:
<br>
<br>
All this patch does is that it enables a check globally and then
disables it everywhere locally.
<br>
<br>
IMO the patch should be retired for now, or make-lint should be
taught to automatically skip the check inside
TestCase.assertRaises() context.
<br>
<br>
<br>
Patch 390: ACK
<br>
<br>
<br>
Patch 391:
<br>
<br>
default_from uses argument names of the specified function as
param names from which to create the default.
<br>
<br>
These changes break default_from:
<br>
<br>
- default_from=lambda name_from_ip:
_reverse_zone_name(name_from_ip),
<br>
+ default_from=_reverse_zone_name,
<br>
<br>
- default_from=lambda idnsname:
default_zone_update_policy(idnsname),
<br>
+ default_from=default_zone_update_policy,
<br>
<br>
This change adds dependency on non-existent param:
<br>
<br>
- default_from=lambda: krb_utils.get_principal(),
<br>
+ default_from=krb_utils.get_principal,
<br>
<br>
The result of this check is misleading for default_from, so IMO
the patch should be retired for now, or make-lint should be
taught to automatically disable the check for the default_from
argument in param definitions.
<br>
<br>
<br>
Patch 392:
<br>
<br>
I think the existing occurences of exec()/eval() should be
removed before this check can be enabled.
<br>
<br>
<br>
Patch 393: ACK
<br>
<br>
<br>
I would like to see a patch which enables the
useless-suppression info message, so that we can catch dangling
"# pylint: disable=" comments (there are some in the code).
<br>
<br>
(Also, it would be nice to finally rewrite make-lint to pylint
config file + plugins.)
<br>
<br>
</blockquote>
Updated patches attached, please apply patch 394 first.
<br>
<br>
Patches 389, 391, 392 have been removed, issues will be addressed
later.
<br>
<br>
useless-suppression, unbalanced-tuple-unpacking,
unpacking-non-sequence, and python3 checks are on my TODO list
<br>
<br>
I can try to rewrite pylint to plugins and config file.
<br>
<br>
Martin^2
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
I forgot to attach patch 379, all patches again (394 should go
first)<br>
</body>
</html>