From e7b6901f1e76fb1aeda011d06e62c996673033d0 Mon Sep 17 00:00:00 2001 From: tyler-mairose-sp Date: Thu, 18 Nov 2021 11:47:20 -0500 Subject: [PATCH] Run with ignore unknown format on paths and schema files --- src/index.js | 10 +++++----- src/spectral.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/index.js b/src/index.js index eeb4e62..b5d2760 100644 --- a/src/index.js +++ b/src/index.js @@ -64,17 +64,17 @@ async function run() { fileContents[i].file.substr(0, fileContents[i].file.lastIndexOf("/")) ); - let pbs = ""; - + let pbs = ""; + if (fileContents[i].file.includes(`sailpoint-api.`)) { console.log(`Running root ruleset on ${fileContents[i].file}`); - pbs = await runSpectral(rootSpectral, fileContents[i].content); + pbs = await runSpectral(rootSpectral, fileContents[i].content, false); } else if (fileContents[i].file.includes(`paths`)) { console.log(`Running path ruleset on ${fileContents[i].file}`); - pbs = await runSpectral(pathSpectral, fileContents[i].content); + pbs = await runSpectral(pathSpectral, fileContents[i].content, true); } else if (fileContents[i].file.includes(`schema`)) { console.log(`Running schema ruleset on ${fileContents[i].file}`); - pbs = await runSpectral(schemaSpectral, fileContents[i].content); + pbs = await runSpectral(schemaSpectral, fileContents[i].content, true); } //console.log(fileContents[i].file + ":" + fileContents[i].content); diff --git a/src/spectral.js b/src/spectral.js index dbf5c3d..c5236c3 100644 --- a/src/spectral.js +++ b/src/spectral.js @@ -26,7 +26,7 @@ const createSpectral = async ruleset => { return spectral; }; -const runSpectral = async (spectral, parsed) => await spectral.run(parsed); +const runSpectral = async (spectral, parsed, ignoreUnknownFormatFlag) => await spectral.run(parsed, {ignoreUnknownFormat: ignoreUnknownFormatFlag}); module.exports = { createSpectral: createSpectral,