build: adds another fail scenario to the circular checker if it encounters fewer dependencies than anticipated

This commit is contained in:
Jacob Overgaard
2025-04-08 09:18:32 +02:00
parent 84d8736b90
commit 385a8fecba

View File

@@ -52,7 +52,12 @@ if (circular.length) {
*/
// TODO: Remove this check and set an exit with argument 1 when we have fixed all circular dependencies.
if (circular.length > 7) {
const MAX_CIRCULAR_DEPENDENCIES = 7;
if (circular.length > MAX_CIRCULAR_DEPENDENCIES) {
process.exit(1);
} else if (circular.length < MAX_CIRCULAR_DEPENDENCIES) {
console.error(`\nYou have fewer circular dependencies (${circular.length}) than anticipated (${MAX_CIRCULAR_DEPENDENCIES}). That is great!\n`);
console.error(`(Now please adjust the number in MAX_CIRCULAR_DEPENDENCIES to ${circular.length} in devops/circular/index.js).\n`);
process.exit(1);
} else {
process.exit(0);