File tree 1 file changed +22
-1
lines changed
1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,21 @@ def getFileName(self):
73
73
return fileName [len (root ) + 1 :]
74
74
return fileName
75
75
76
+ def getRootFileName (self ):
77
+ path = self ._data ['path' ]
78
+ if not path :
79
+ return self .getFileName ()
80
+ p = path [0 ]
81
+ if 'location' in p :
82
+ fIdx = p ['location' ]['file' ]
83
+ else : # control edge
84
+ fIdx = path [0 ]['edges' ][0 ]['start' ][0 ]['file' ]
85
+ out = self ._report .files [fIdx ]
86
+ root = self ._report .run .root
87
+ if out .startswith (root ):
88
+ return out [len (root ):]
89
+ return out
90
+
76
91
def getLine (self ):
77
92
return self ._loc ['line' ]
78
93
@@ -106,7 +121,13 @@ def getReadableName(self):
106
121
funcnamePostfix = "#" + self ._data ['issue_context' ]
107
122
else :
108
123
funcnamePostfix = ""
109
- return '%s%s:%d:%d, %s: %s' % (self .getFileName (),
124
+ rootFilename = self .getRootFileName ()
125
+ fileName = self .getFileName ()
126
+ if rootFilename != fileName :
127
+ filePrefix = "[%s] %s" % (rootFilename , fileName )
128
+ else :
129
+ filePrefix = rootFilename
130
+ return '%s%s:%d:%d, %s: %s' % (filePrefix ,
110
131
funcnamePostfix ,
111
132
self .getLine (),
112
133
self .getColumn (), self .getCategory (),
You can’t perform that action at this time.
0 commit comments