Skip to content

Commit

Permalink
Add hyperlinks to build log
Browse files Browse the repository at this point in the history
  • Loading branch information
iarspider committed Dec 18, 2024
1 parent 13131d6 commit 2e92f39
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions buildLogAnalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ def makeHTMLSummaryPage(self):

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

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

0 comments on commit 2e92f39

Please sign in to comment.