Skip to content

Commit 2e92f39

Browse files
committed
Add hyperlinks to build log
1 parent 13131d6 commit 2e92f39

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

buildLogAnalyzer.py

+6
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ def makeHTMLSummaryPage(self):
380380

381381
def makeHTMLLogFile(self, pkg):
382382
"""docstring for makeHTMLFile"""
383+
linePartsUrl = re.compile(r"\s*(src(/[^:]+):(\d+)):.*")
383384

384385
if not pkg.name() in self.tagList:
385386
return
@@ -410,6 +411,11 @@ def makeHTMLLogFile(self, pkg):
410411
) # do this first to not escape it again in the next subs
411412
newLine = newLine.replace("<", "&lt;").replace(">", "&gt;")
412413
if lineNo in pkg.errLines.keys():
414+
m = linePartsUrl.match(newLine)
415+
if m:
416+
branch = os.getenv("CMSSW_VERSION", "master")
417+
url = "https://github.com/cms-sw/cmssw/blob/" + branch + m[2] + "#L" + m[3]
418+
newLine = newLine.replace(m[1], '<a href="' + url + '">' + m[1] + "</a>", 1)
413419
newLine = (
414420
"<span class="
415421
+ self.styleClass[pkg.errLines[lineNo]]

0 commit comments

Comments
 (0)