Pylint 1.9 does not support Python 3.7. In order to support 3.7, pylint 2.0 is required. Pylint 2.0 is currently under development. A test run with git checkout of pylint and astroid show a large amount of new violations.
My branch https://github.com/tiran/freeipa/tree/pylint2 contains experimental support for pylint 2.0, tox -r -e pylint37. contains a list of bugs that can be addressed easily.
tox -r -e pylint37
I just had to verify a patch on 4.5, that assumes pylint from Fedora 26. The output of pylint was completely useless and littered with unrelated violation.
pylint
Let's also backport all fixes to 4.6, so we can lint 4.6 branch on future versions of Fedora, too.
Metadata Update from @cheimes: - Issue priority set to: important - Issue set to the milestone: FreeIPA 4.6
Metadata Update from @abiagion: - Issue assigned to abiagion
master:
New run with latest pylint and fixes from b4ad0d1,
Summary of the remaining violations and their number of occurrences:
$ grep -o '[A-Z0-9]*([a-z-]*)' pylint2_3.log | sort | uniq -c | sort -rn 10 R1714(consider-using-in) 6 E0705(try-except-raise) 4 E1111(assignment-from-no-return) 4 C0330(bad-continuation) 2 W1655(dict-keys-not-iterating) 2 W1306(missing-format-attribute) 2 W1113(keyword-arg-before-vararg) 2 R1716(chained-comparison) 2 R1715(consider-using-get) 1 W1662(comprehension-escape) 1 W1509(subprocess-popen-preexec-fn) 1 W0715(raising-format-tuple) 1 R1718(consider-using-set-comprehension) 1 C0414(useless-import-alias) 1 C0204(bad-mcs-classmethod-argument) 1 C0113(unneeded-not)
ipa-4-6:
There are 6 occurrences of violation E0705 try-except-raise.
try-except-raise
The except handler raises immediately Used when an except handler uses raise as its first or only operator. This is useless because it raises back the exception immediately. Remove the raise operator or the entire try-except-raise block!
We can ignore it or we can add a log, as in:
try: func() except Exception: logger.debug('Logging known Exception') raise
@cheimes What do you think?
My suggestions:
ipaserver/p11helper.py:477
ipaclient/plugins/vault.py:673
except errors.NotFound: raise
ipalib/backend.py:142
except PublicError: raise # pylint: disable=try-except-raise
ipalib/rpc.py:1074
except errors.KerberosError: raise # pylint: disable=try-except-raise
ipapython/install/core.py:313
except KnobValueError: raise
ipapython/ipaldap.py:211
except IndexError: raise
Pylint 2 was released and it is now supported.
In the future pylintrc must be revisited in order to remove settings added to support versions prior 2.0.0.
pylintrc
Metadata Update from @abiagion: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)