Skip to content

Commit

Permalink
Run with ignore unknown format on paths and schema files
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler-mairose-sp committed Nov 18, 2021
1 parent 28dd53d commit e7b6901
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/spectral.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e7b6901

Please sign in to comment.