URL:
https://github.com/freeipa/freeipa/pull/2150
Author: netoarmando
Title: #2150: Disable Pylint 2.0 violations
Action: opened
PR body:
"""
Opening this Pull Request to discuss if this violations should be ignored or addressed any
other way.
Specifically `bad-mcs-classmethod-argument` (C0204) seems to be caused by a bug in the
current version of Pylint (2.0.0.dev2), setting `valid-metaclass-classmethod-first-arg` to
its default value (`mcs`) fixed the issue.
Globally disabling the following violations:
- `consider-using-get` (R1715):
Consider using dict.get for getting values from a dict if a key is
present or a default if not Using the builtin dict.get for getting a
value from a dictionary if a key is present or a default if not, is
simpler and considered more idiomatic, although sometimes a bit slower
- `assignment-from-no-return` (E1111):
Assigning to function call which doesn't return. Used when an
assignment is done on a function call but the inferred function
doesn't return anything.
Locally disabling the following:
- `subprocess-popen-preexec-fn` (W1509):
Using preexec_fn keyword which may be unsafe in the presence of
threads The preexec_fn parameter is not safe to use in the presence
of threads in your application. The child process could deadlock
before exec is called. If you must use it, keep it trivial! Minimize
the number of libraries you call into.
https://docs.python.org/3/library/subprocess.html#popen-constructor
- `missing-format-attribute` (W1306):
Missing format attribute %r in format specifier %r Used when a
PEP 3101 format string uses an attribute specifier ({0.length}),
but the argument passed for formatting doesn't have that attribute.
This message can't be emitted when using Python < 2.7.
- `consider-using-set-comprehension` (R1718):
Consider using a set comprehension Although there is nothing
syntactically wrong with this code, it is hard to read and can be
simplified to a set comprehension.Also it is faster since you don't
need to create another transient list
- `keyword-arg-before-vararg` (W1113):
Keyword argument before variable positional arguments list in the
definition of %s function When defining a keyword argument before
variable positional arguments, one can end up in having multiple
values passed for the aforementioned parameter in case the method is
called with keyword arguments.
- `dict-keys-not-iterating` (W1655):
dict.keys referenced when not iterating Used when dict.keys is
referenced in a non-iterating context (returns an iterator in
Python 3)
- `comprehension-escape` (W1662):
Using a variable that was bound inside a comprehension Emitted when
using a variable, that was bound in a comprehension handler, outside
of the comprehension itself. On Python 3 these variables will be
deleted outside of the comprehension.
Issue:
https://pagure.io/freeipa/issue/7614
Signed-off-by: Armando Neto <abiagion(a)redhat.com>
"""
To pull the PR as Git branch:
git remote add ghfreeipa
https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/2150/head:pr2150
git checkout pr2150