Skip to content

Commit 99bcd12

Browse files
authored
refactor: consider early return optimization for dry-run (#214)
1 parent d9a8729 commit 99bcd12

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

commit_check/main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ def main() -> int:
9999
"""The main entrypoint of commit-check program."""
100100
parser = get_parser()
101101
args = parser.parse_args()
102+
103+
if args.dry_run:
104+
return PASS
105+
102106
check_results: list[int] = []
103107

104108
with error_handler():
@@ -119,9 +123,6 @@ def main() -> int:
119123
if args.merge_base:
120124
check_results.append(branch.check_merge_base(checks))
121125

122-
if args.dry_run:
123-
return PASS
124-
125126
return PASS if all(val == PASS for val in check_results) else FAIL
126127

127128

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy