Merge "Follow-up on pylint upgrade"
This commit is contained in:
commit
ef2369338f
14
.pylintrc
14
.pylintrc
|
@ -12,18 +12,18 @@ disable=
|
||||||
# "E" Error for important programming issues (likely bugs)
|
# "E" Error for important programming issues (likely bugs)
|
||||||
method-hidden,
|
method-hidden,
|
||||||
no-member,
|
no-member,
|
||||||
no-value-for-parameter, # TODO
|
|
||||||
not-callable,
|
not-callable,
|
||||||
# "W" Warnings for stylistic problems or minor programming issues
|
# "W" Warnings for stylistic problems or minor programming issues
|
||||||
arguments-differ,
|
arguments-differ,
|
||||||
attribute-defined-outside-init,
|
attribute-defined-outside-init,
|
||||||
bad-indentation,
|
bad-indentation,
|
||||||
broad-except,
|
broad-except,
|
||||||
deprecated-method, # TODO
|
|
||||||
fixme,
|
fixme,
|
||||||
|
# python3 way: pylint suggests to follow PEP 3102
|
||||||
keyword-arg-before-vararg, # TODO
|
keyword-arg-before-vararg, # TODO
|
||||||
pointless-string-statement,
|
pointless-string-statement,
|
||||||
protected-access,
|
protected-access,
|
||||||
|
# We should do it carefully considering PEP3134
|
||||||
raise-missing-from, # TODO
|
raise-missing-from, # TODO
|
||||||
redefined-builtin,
|
redefined-builtin,
|
||||||
redefined-outer-name,
|
redefined-outer-name,
|
||||||
|
@ -33,7 +33,6 @@ disable=
|
||||||
unused-argument,
|
unused-argument,
|
||||||
unused-wildcard-import,
|
unused-wildcard-import,
|
||||||
useless-else-on-loop,
|
useless-else-on-loop,
|
||||||
using-constant-test, # TODO
|
|
||||||
wildcard-import,
|
wildcard-import,
|
||||||
# "C" Coding convention violations
|
# "C" Coding convention violations
|
||||||
abstract-method,
|
abstract-method,
|
||||||
|
@ -42,21 +41,27 @@ disable=
|
||||||
bad-continuation,
|
bad-continuation,
|
||||||
deprecated-lambda,
|
deprecated-lambda,
|
||||||
global-statement,
|
global-statement,
|
||||||
|
# Not a good idea to disable this globally
|
||||||
|
# Check one by one and add pylint disabled comment if needed
|
||||||
import-outside-toplevel, # TODO
|
import-outside-toplevel, # TODO
|
||||||
invalid-name,
|
invalid-name,
|
||||||
missing-docstring,
|
missing-docstring,
|
||||||
superfluous-parens,
|
superfluous-parens,
|
||||||
too-many-lines,
|
too-many-lines,
|
||||||
unused-variable,
|
unused-variable,
|
||||||
wrong-import-order, # TODO
|
# import order is checked by flake8 (and pylint rule is incompatible with it)
|
||||||
|
wrong-import-order,
|
||||||
# "R" Refactor recommendations
|
# "R" Refactor recommendations
|
||||||
duplicate-code,
|
duplicate-code,
|
||||||
inconsistent-return-statements, # TODO
|
inconsistent-return-statements, # TODO
|
||||||
interface-not-implemented,
|
interface-not-implemented,
|
||||||
|
# Better to be fixed but too many hits :(
|
||||||
no-else-continue, # TODO
|
no-else-continue, # TODO
|
||||||
|
# Better to be fixed but too many hits :(
|
||||||
no-else-raise, # TODO
|
no-else-raise, # TODO
|
||||||
no-else-return,
|
no-else-return,
|
||||||
no-self-use,
|
no-self-use,
|
||||||
|
# python3 way: Let's do it once we have a consensus.
|
||||||
super-with-arguments, # TODO
|
super-with-arguments, # TODO
|
||||||
too-many-ancestors,
|
too-many-ancestors,
|
||||||
too-many-arguments,
|
too-many-arguments,
|
||||||
|
@ -66,6 +71,7 @@ disable=
|
||||||
too-many-locals,
|
too-many-locals,
|
||||||
too-many-return-statements,
|
too-many-return-statements,
|
||||||
too-many-statements,
|
too-many-statements,
|
||||||
|
# Better to be fixed but too many hits :(
|
||||||
unnecessary-comprehension, # TODO
|
unnecessary-comprehension, # TODO
|
||||||
useless-object-inheritance
|
useless-object-inheritance
|
||||||
|
|
||||||
|
|
|
@ -340,6 +340,8 @@ def handle(request, message=None, redirect=None, ignore=False,
|
||||||
exc_handler.get('escalate', escalate),
|
exc_handler.get('escalate', escalate),
|
||||||
handled, force_silence, force_log,
|
handled, force_silence, force_log,
|
||||||
log_method, log_entry, log_level)
|
log_method, log_entry, log_level)
|
||||||
|
# NOTE: pylint seems to get confused :(
|
||||||
|
# pylint: disable=using-constant-test
|
||||||
if ret:
|
if ret:
|
||||||
return ret # return to normal code flow
|
return ret # return to normal code flow
|
||||||
|
|
||||||
|
@ -353,6 +355,7 @@ def handle(request, message=None, redirect=None, ignore=False,
|
||||||
ret = handle_recoverable(request, user_message, redirect, ignore,
|
ret = handle_recoverable(request, user_message, redirect, ignore,
|
||||||
escalate, handled, force_silence, force_log,
|
escalate, handled, force_silence, force_log,
|
||||||
log_method, log_entry, log_level)
|
log_method, log_entry, log_level)
|
||||||
|
# NOTE: pylint seems to get confused :(
|
||||||
# pylint: disable=using-constant-test
|
# pylint: disable=using-constant-test
|
||||||
if ret:
|
if ret:
|
||||||
return ret
|
return ret
|
||||||
|
|
|
@ -64,6 +64,8 @@ class ModalFormMixin(ModalBackdropMixin):
|
||||||
# Transform standard template name to ajax name (leading "_")
|
# Transform standard template name to ajax name (leading "_")
|
||||||
bits = list(os.path.split(self.template_name))
|
bits = list(os.path.split(self.template_name))
|
||||||
bits[1] = "".join(("_", bits[1]))
|
bits[1] = "".join(("_", bits[1]))
|
||||||
|
# NOTE: Looks like false-positive in pylint 2.6.0
|
||||||
|
# pylint: disable=no-value-for-parameter
|
||||||
self.ajax_template_name = os.path.join(*bits)
|
self.ajax_template_name = os.path.join(*bits)
|
||||||
template = self.ajax_template_name
|
template = self.ajax_template_name
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue