Skip to content

Commit

Permalink
fix trailing return rule (was removing all lines with return)
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Feb 27, 2024
1 parent 963f040 commit d74ee78
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/common/update_fortran_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,15 @@ def trailing_returns(path, check, diff):
"!return"
]:
continue
elif "return" in line:
continue
else:
flines.extend(lines)
elif "end subroutine" in line or "end function" in line:
for i, fl in enumerate(reversed(flines)):
l = fl.strip()
if not any(l):
continue
elif l == "return":
del flines[len(flines) - i - 1]
break
flines.extend(lines)

if check:
warn("Check mode not implemented yet")
Expand Down

0 comments on commit d74ee78

Please sign in to comment.