@@ -123,6 +123,8 @@ def __init__(
123
123
"ok" : "ok" ,
124
124
}
125
125
126
+ self .cmsswVersion = os .getenv ("CMSSW_VERSION" , "master" )
127
+
126
128
# get the lists separately for "priority" treatment ...
127
129
self .errMap = {}
128
130
for key in self .errorKeys :
@@ -380,7 +382,11 @@ def makeHTMLSummaryPage(self):
380
382
381
383
def makeHTMLLogFile (self , pkg ):
382
384
"""docstring for makeHTMLFile"""
383
- linePartsUrl = re .compile (r"\s*(src(/[^:]+):(\d+)):.*" )
385
+ linePartsUrl = re .compile (
386
+ r"\s+(?P<full_path>(?:.*/"
387
+ + self .cmsswVersion
388
+ + r"/)?(?P<file>src/[^:(]+)[:(](?P<line>\d+)\)?):"
389
+ )
384
390
385
391
if not pkg .name () in self .tagList :
386
392
return
@@ -413,9 +419,17 @@ def makeHTMLLogFile(self, pkg):
413
419
if lineNo in pkg .errLines .keys ():
414
420
m = linePartsUrl .match (newLine )
415
421
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 )
422
+ url = (
423
+ "https://github.com/cms-sw/cmssw/blob/"
424
+ + self .cmsswVersion
425
+ + m ["file" ]
426
+ + "#L"
427
+ + m ["line" ]
428
+ )
429
+
430
+ newLine = newLine .replace (
431
+ m ["full_path" ], '<a href="' + url + '">' + m ["full_path" ] + "</a>" , 1
432
+ )
419
433
newLine = (
420
434
"<span class="
421
435
+ self .styleClass [pkg .errLines [lineNo ]]
0 commit comments