Skip to content
Snippets Groups Projects
Commit 81b153cf authored by Pregmodder's avatar Pregmodder
Browse files

Merge branch 'custom-checks-ignore-paths' into 'pregmod-master'

custom checks now has the ability to ignore paths

See merge request !11823
parents 0f65a60b fbd26192
Branches
Tags
1 merge request!11823custom checks now has the ability to ignore paths
Pipeline #77645 passed
...@@ -30,6 +30,12 @@ import indefinite from "indefinite"; ...@@ -30,6 +30,12 @@ import indefinite from "indefinite";
// @ts-ignore // @ts-ignore
import path from "path"; import path from "path";
const ignoredPaths = [
"js/001-lib/",
"src/001-lib/"
]
.map((entry) => entry.replace(/\//g, path.sep));
const customArticles = [ const customArticles = [
// list of words with their articles. If the article used doesn't match this list, return an error // 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 // 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 ...@@ -95,6 +101,18 @@ function customChecks(changed = false, files = undefined, parser = detectChanges
filesToCheck = jetpack.find(".", {matching: "*.{js,md}"}); 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) { if (files === undefined && changed === true) {
console.log("Running custom sanity checks on changed files compared to pregmodfan/fc-pregmod"); console.log("Running custom sanity checks on changed files compared to pregmodfan/fc-pregmod");
} else if (files === undefined) { } else if (files === undefined) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment