Skip to content

Commit df1f557

Browse files
committed
clean up check links output
1 parent 012bf56 commit df1f557

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

jupyter_releaser/lib.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,27 @@ def check_links(ignore_glob, ignore_links, cache_file, links_expire):
8585
matched = glob(f"**/*{ext}", recursive=True)
8686
files.extend(m for m in matched if not m in ignored and "node_modules" not in m)
8787

88+
util.log("Checking files with options:")
89+
util.log(cmd)
90+
91+
fails = 0
8892
for f in files:
8993
file_cmd = cmd + f' "{f}"'
9094
try:
91-
util.run(file_cmd, shell=False)
95+
util.log(f"Checking {f}...")
96+
util.run(file_cmd, shell=False, echo=False)
9297
except Exception as e:
9398
# Return code 5 means no tests were run (no links found)
9499
if e.returncode != 5:
95-
util.run(file_cmd + " --lf", shell=False)
100+
try:
101+
util.log(f"Rechecking {f}...")
102+
util.run(file_cmd + " --lf", shell=False, echo=False)
103+
except Exception:
104+
fails += 1
105+
if fails == 3:
106+
raise RuntimeError("Found three failed links, bailing")
107+
if fails:
108+
raise RuntimeError(f"Encountered failures in {fails} file(s)")
96109

97110

98111
def draft_changelog(

0 commit comments

Comments
 (0)