Xqt created this task.
Xqt added projects: Pywikibot, good first task.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.
TASK DESCRIPTION
Introduction
------------
Due to PEP8 [1] either all return statements in a function should return an
expression, or none of them should.
# Correct:
def bar(x):
if x < 0:
return None
return math.sqrt(x)
# Wrong:
def foo(x):
if x >= 0:
return math.sqrt(x)
# implicit returns None here which should be explicit
def bar(x):
if x < 0:
return # implicit returns None here which should be explicit
return math.sqrt(x)
What to do
----------
Issues to be solved can be found here:
https://deepsource.io/gh/xqt/pwb/issue/PYL-R1710/occurrences
Fix it by adding consistent return statements
[1] https://peps.python.org/pep-0008/#programming-recommendations
TASK DETAIL
https://phabricator.wikimedia.org/T305859
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Xqt
Cc: Aklapper, Xqt, pywikibot-bugs-list, Appledora, Gaurav24072002, Abhinay76,
Annysah01, Rohitgeddam, Jyoo1011, JohnsonLee01, SHEKH, Dijkstra, Khutuck, Soda,
Chaytanya, Zkhalido, JorisDarlingtonQuarshie, wiki-helenatxu, Viztor, Klein,
Wenyi, Tks4Fish, Mh-3110, Lahi, JakeTheDeveloper, Tbscho, MayS, Mdupont,
JJMC89, Dvorapa, xSavitar, Altostratus, Avicennasis, MuhammadShuaib, Tmalhotra,
SimmeD, mys_721tx, jayvdb, Masti, Alchimista
_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]