-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeMinor 💅Polishing pylint is always nicePolishing pylint is always nice
Description
Bug description
# pylint: disable=consider-using-sys-exit, missing-module-docstring, missing-function-docstring
def func1(i):
if i == 1:
return i
quit(1)
def func2(i):
if i == 1:
quit(1)
return 1
Configuration
Command used
pre-commit run pylint --file=main.py
Pylint output
************* Module main
main.py:2:0: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
Expected behavior
Pylint complains about inconsistent-return-statements only in func1 but not in func2.
Expected behaviour is that at least both functions are assessed the same.
If the quit statement should be used with a return
or not is up to you :-)
Pylint version
pylint 3.3.8
python 3.12.11
OS / Environment
No response
Additional dependencies
Metadata
Metadata
Assignees
Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeMinor 💅Polishing pylint is always nicePolishing pylint is always nice