Code review comment for ~mdeslaur/ubuntu-cve-tracker:perf-part2

Revision history for this message
Alex Murray (alexmurray) wrote :

LGTM (a small fixup is needed to get --stdin working again with this but that can land after):

diff --git a/scripts/check-syntax b/scripts/check-syntax
index ba2645516a4..1dd37810acd 100755
--- a/scripts/check-syntax
+++ b/scripts/check-syntax
@@ -538,14 +538,18 @@ def check_cve(cve):
     cve_okay = True
     srcmap = dict()
     try:
- # Try to locate the base CVE and load that, but not if this is a
- # boilerplate path
- if is_boilerplate(cve):
+ if opt.stdin:
+ # fixup cve below once we have loaded it
             cvepath = cve
- cve = os.path.basename(cve)
         else:
- cve = os.path.basename(cve)
- cvepath = cve_lib.find_cve(cve)
+ # Try to locate the base CVE and load that, but not if this is a
+ # boilerplate path
+ if is_boilerplate(cve):
+ cvepath = cve
+ cve = os.path.basename(cve)
+ else:
+ cve = os.path.basename(cve)
+ cvepath = cve_lib.find_cve(cve)
         data = cve_lib.load_cve(cvepath, opt.strict, srcmap=srcmap)
     except ValueError as e:
         print(e, file=sys.stderr)

review: Approve

« Back to merge proposal