From cc2aca72f63aabe4cf1a380012e723b802e6a02a Mon Sep 17 00:00:00 2001 From: Ismail Mohammed Date: Fri, 31 May 2024 02:09:55 +0300 Subject: [PATCH 1/2] Fix error message when vale is not installed Signed-off-by: Ismail Mohammed --- scripts/check-docs-quality.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/scripts/check-docs-quality.js b/scripts/check-docs-quality.js index 9a9336b3e9..ad2750a8c2 100755 --- a/scripts/check-docs-quality.js +++ b/scripts/check-docs-quality.js @@ -71,15 +71,10 @@ async function exitIfMissingVale() { // eslint-disable-next-line @backstage/no-undeclared-imports await require('command-exists')('vale'); } catch (e) { - if (process.env.CI) { - console.log( - `Language linter (vale) was not found. Please install vale linter (https://vale.sh/docs/vale-cli/installation/).\n`, - ); - process.exit(1); - } - console.log(`Language linter (vale) generated errors. Please check the errors and review any markdown files that you changed. - Possibly update .github/vale/config/vocabularies/Backstage/accept.txt to add new valid words.\n`); - process.exit(0); + console.log( + `Language linter (vale) was not found. Please install vale linter (https://vale.sh/docs/vale-cli/installation/).\n`, + ); + process.exit(1); } } From bd01494c1d01d3b6365020cc097868c3bf4a8795 Mon Sep 17 00:00:00 2001 From: Ismail M <37075892+ismailmmd@users.noreply.github.com> Date: Sun, 2 Jun 2024 00:02:23 +0300 Subject: [PATCH 2/2] successfully exit in local and throw in CI Since `vale` may not be installed locally, we can successfully exit. Co-authored-by: Vincenzo Scamporlino Signed-off-by: Ismail M <37075892+ismailmmd@users.noreply.github.com> --- scripts/check-docs-quality.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check-docs-quality.js b/scripts/check-docs-quality.js index ad2750a8c2..0493be1bca 100755 --- a/scripts/check-docs-quality.js +++ b/scripts/check-docs-quality.js @@ -74,7 +74,7 @@ async function exitIfMissingVale() { console.log( `Language linter (vale) was not found. Please install vale linter (https://vale.sh/docs/vale-cli/installation/).\n`, ); - process.exit(1); + process.exit(process.env.CI ? 1 : 0); } }