From 425930f2ec31f768c8ec8c6257310c149dd496e8 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Mon, 5 Sep 2022 13:38:34 +0100 Subject: [PATCH] add line numbers for loadWidgets error message, and provide a way to ignore messages we know about --- bin/sanitycheck.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/sanitycheck.js b/bin/sanitycheck.js index 13b000228..8bd23dd77 100755 --- a/bin/sanitycheck.js +++ b/bin/sanitycheck.js @@ -30,7 +30,11 @@ function ERROR(msg, opt) { function WARN(msg, opt) { // file=app.js,line=1,col=5,endColumn=7 opt = opt||{}; - console.log(`::warning${Object.keys(opt).length?" ":""}${Object.keys(opt).map(k=>k+"="+opt[k]).join(",")}::${msg}`); + if (KNOWN_WARNINGS.includes(msg)) { + console.log(`Known warning : ${msg}`); + } else { + console.log(`::warning${Object.keys(opt).length?" ":""}${Object.keys(opt).map(k=>k+"="+opt[k]).join(",")}::${msg}`); + } warningCount++; } @@ -86,6 +90,10 @@ const INTERNAL_FILES_IN_APP_TYPE = { // list of app types and files they SHOULD 'waypoints' : ['waypoints'], // notify? }; +/* These are warnings we know about but don't want in our output */ +var KNOWN_WARNINGS = [ +"App gpsrec data file wildcard .gpsrc? does not include app ID" +]; function globToRegex(pattern) { const ESCAPE = '.*+-?^${}()|[]\\'; @@ -230,7 +238,7 @@ apps.forEach((app,appIdx) => { var a = fileContents.indexOf("Bangle.loadWidgets()"); var b = fileContents.indexOf("Bangle.setUI("); if (a>=0 && b>=0 && a