Pylint: Disable Unnecessary "else" after "return" (no-else-return) warning
You are looking for no-else-return (R1705)
. Just add these to your .pylintrc
:
[REFACTORING]
no-else-return=no
In this particular case you could be better off using a ternary operator.
def is_positive(number):
return "+++" if number > 0 else "---"
You should add no-else-return
to the comma separated list of disabled options in the disable
setting in your .pylintrc
file.
Also see the Pylint docs:
http://pylint.pycqa.org/en/latest/technical_reference/features.html#messages-control-options