Export full path to file with defect

This commit is contained in:
valeros
2019-10-28 18:30:22 +02:00
parent 39a7062503
commit 187e30d055
2 changed files with 10 additions and 6 deletions

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from os.path import relpath
from os.path import isabs, isfile, join, relpath
import click
@ -82,11 +82,15 @@ class DefectItem(object):
raise Exception("Unknown severity label -> %s" % label)
def as_dict(self):
filepath = self.file
if not isabs(filepath) and isfile(join(get_project_dir(), filepath)):
filepath = join(get_project_dir(), filepath)
return {
"severity": self.SEVERITY_LABELS[self.severity],
"category": self.category,
"message": self.message,
"file": self.file,
"file": filepath,
"line": self.line,
"column": self.column,
"callstack": self.callstack,