Skip to content
Snippets Groups Projects
Commit fbd26192 authored by Frankly George's avatar Frankly George
Browse files

custom checks now has the ability to ignore paths

parent 0f65a60b
No related branches found
No related tags found
1 merge request!11823custom checks now has the ability to ignore paths
......@@ -30,6 +30,12 @@ import indefinite from "indefinite";
// @ts-ignore
import path from "path";
const ignoredPaths = [
"js/001-lib/",
"src/001-lib/"
]
.map((entry) => entry.replace(/\//g, path.sep));
const customArticles = [
// list of words with their articles. If the article used doesn't match this list, return an error
// unlisted words are sent to indefinite (https://www.npmjs.com/package/indefinite) for checking
......@@ -95,6 +101,18 @@ function customChecks(changed = false, files = undefined, parser = detectChanges
filesToCheck = jetpack.find(".", {matching: "*.{js,md}"});
}
// filter out ignored paths
filesToCheck = filesToCheck.filter(file => {
let ignored = false;
// for path in ignoredPaths
ignoredPaths.forEach(ignoredPath => {
if (file.startsWith(ignoredPath)) {
ignored = true;
}
});
return !ignored;
});
if (files === undefined && changed === true) {
console.log("Running custom sanity checks on changed files compared to pregmodfan/fc-pregmod");
} else if (files === undefined) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment