scripts/*.py: update coding style (#10761)
* convert to f string * use a next function instead of a for-loop * remove uneeded else statement * use in operator instead of multi comparison * conver to f string * adds extra line between function defs * revert/change to PR comment around looping * remove uneeded loops * revert to keep old style choice
This commit is contained in:
@@ -99,10 +99,9 @@ def get_alias_page(file):
|
||||
if not os.path.isfile(file):
|
||||
return ""
|
||||
with open(file) as f:
|
||||
lines = f.readlines()
|
||||
for line in lines:
|
||||
if re.search(r"^`tldr ", line):
|
||||
return re.search("`tldr (.+)`", line).group(1)
|
||||
for line in f:
|
||||
if match := re.search(r"^`tldr (.+)`", line):
|
||||
return match[1]
|
||||
return ""
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user