mirror of
https://github.com/hohn/sarif-cli.git
synced 2025-12-16 09:13:04 +01:00
Don't trail the project name with a dash if the subset name is blank
This commit is contained in:
committed by
=Michael Hohn
parent
37eb55abef
commit
3854036fa7
@@ -82,15 +82,19 @@ def joins_for_projects(basetables, external_info):
|
||||
"""
|
||||
b = basetables; e = external_info
|
||||
|
||||
extra = ""
|
||||
automationDetails = ""
|
||||
# if the sarif does have automationDetails
|
||||
if "automationDetails" in b.project:
|
||||
extra = b.project.automationDetails[0]
|
||||
automationDetails = b.project.automationDetails[0]
|
||||
# if the sarif does have versionControlProvenance
|
||||
if "repositoryUri" in b.project:
|
||||
repoUri = b.project.repositoryUri[0]
|
||||
project_name = b.project.repositoryUri[0] + "-" + extra
|
||||
e.project_id = hash.hash_unique((repoUri+extra).encode())
|
||||
if automationDetails == "no-value-for-ad":
|
||||
project_name = b.project.repositoryUri[0]
|
||||
else:
|
||||
project_name = b.project.repositoryUri[0] + "-" + automationDetails
|
||||
|
||||
e.project_id = hash.hash_unique((repoUri+automationDetails).encode())
|
||||
else:
|
||||
repoUri = "unknown"
|
||||
|
||||
@@ -101,7 +105,7 @@ def joins_for_projects(basetables, external_info):
|
||||
"repo_url" : repoUri,
|
||||
"primary_language" : b.project['semmle.sourceLanguage'][0],
|
||||
"languages_analyzed" : ",".join(list(b.project['semmle.sourceLanguage'])),
|
||||
"automationDetails" : extra,
|
||||
"automationDetails" : automationDetails,
|
||||
}, index=[0])
|
||||
|
||||
# Force all column types to ensure appropriate formatting
|
||||
|
||||
@@ -253,7 +253,8 @@ def fillsig_dict(args, elem, context):
|
||||
# simple sequence tests.
|
||||
|
||||
if 'results' in elem.keys() and not 'automationDetails' in elem.keys():
|
||||
#want this to be blank if not present- ie no submodule info added/no sarif-category used
|
||||
# Want this to be flagged if not present- ie no submodule info added/no
|
||||
# sarif-category used
|
||||
full_elem['automationDetails'] = {'id' : "no-value-for-ad"}
|
||||
|
||||
if {'locations', 'message', 'partialFingerprints', 'ruleId',
|
||||
|
||||
Reference in New Issue
Block a user