Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-11-10 21:09:07 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-11-10 21:09:07 +0300
commit206b03aeae3a368983ac3d6ad5e5828030bbaacd (patch)
treed36ce0745729f64bb54c468422f896c53748672c /scripts/lint-doc.sh
parentff06f859cdabec3c874c004f93fe5082aeacf917 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts/lint-doc.sh')
-rwxr-xr-xscripts/lint-doc.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/scripts/lint-doc.sh b/scripts/lint-doc.sh
index 1b671df84e6..63c5b80ffff 100755
--- a/scripts/lint-doc.sh
+++ b/scripts/lint-doc.sh
@@ -66,8 +66,11 @@ then
else
MERGE_BASE=$(git merge-base ${CI_MERGE_REQUEST_TARGET_BRANCH_SHA} ${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA})
MD_DOC_PATH=$(git diff --name-only "${MERGE_BASE}..${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}" 'doc/*.md')
- echo -e "Merged results pipeline detected. Testing only the following files:\n${MD_DOC_PATH}"
- fi
+ if [ -n "${MD_DOC_PATH}" ]
+ then
+ echo -e "Merged results pipeline detected. Testing only the following files:\n${MD_DOC_PATH}"
+ fi
+fi
function run_locally_or_in_docker() {
local cmd=$1
@@ -98,7 +101,12 @@ function run_locally_or_in_docker() {
echo '=> Linting markdown style...'
echo
-run_locally_or_in_docker 'markdownlint' "--config .markdownlint.json ${MD_DOC_PATH}"
+if [ -z "${MD_DOC_PATH}" ]
+then
+ echo "Merged results pipeline detected, but no markdown files found. Skipping."
+else
+ run_locally_or_in_docker 'markdownlint' "--config .markdownlint.json ${MD_DOC_PATH}"
+fi
echo '=> Linting prose...'
run_locally_or_in_docker 'vale' "--minAlertLevel error --output=JSON ${MD_DOC_PATH}" "ruby scripts/vale.rb"