summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-16 21:07:25 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-16 21:07:25 +0000
commit32cfd14a94117d1e56524727e7d1b649493f5790 (patch)
tree9de87db328f7a1e83e0e195a5e16aad78cd2b24e /scripts
parentb6b701cf9d08253d7c6f1e7500a09b1e373e18e3 (diff)
downloadgitlab-ce-32cfd14a94117d1e56524727e7d1b649493f5790.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/lint-doc.sh31
1 files changed, 29 insertions, 2 deletions
diff --git a/scripts/lint-doc.sh b/scripts/lint-doc.sh
index 18e7d7d1c1c..36b078adb48 100755
--- a/scripts/lint-doc.sh
+++ b/scripts/lint-doc.sh
@@ -76,7 +76,7 @@ then
echo
echo ' ✖ ERROR: The number of README.md file(s) has changed. Use index.md instead of README.md.' >&2
echo ' ✖ If removing a README.md file, update NUMBER_READMES in lint-doc.sh.' >&2
- echo ' https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#work-with-directories-and-files'
+ echo ' https://docs.gitlab.com/ee/development/documentation/site_architecture/folder_structure.html#work-with-directories-and-files' >&2
echo
((ERRORCODE++))
fi
@@ -92,7 +92,34 @@ then
echo
echo ' ✖ ERROR: The number of directory names containing dashes has changed. Use underscores instead of dashes for the directory names.' >&2
echo ' ✖ If removing a directory containing dashes, update NUMBER_DASHES in lint-doc.sh.' >&2
- echo ' https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#work-with-directories-and-files'
+ echo ' https://docs.gitlab.com/ee/development/documentation/site_architecture/folder_structure.html#work-with-directories-and-files' >&2
+ echo
+ ((ERRORCODE++))
+fi
+
+# Do not use uppercase letters in directory and file names, use all lowercase instead.
+# (find always returns 0, so we use the grep hack https://serverfault.com/a/225827)
+FIND_UPPERCASE_DIRS=$(find doc -type d -name "*[[:upper:]]*")
+echo '=> Checking for directory names containing an uppercase letter...'
+echo
+if echo "${FIND_UPPERCASE_DIRS}" | grep . &>/dev/null
+then
+ echo '✖ ERROR: Found one or more directories with an uppercase letter in their name. Use lowercase instead of uppercase for the directory names.' >&2
+ echo 'https://docs.gitlab.com/ee/development/documentation/site_architecture/folder_structure.html#work-with-directories-and-files' >&2
+ echo
+ echo "${FIND_UPPERCASE_DIRS}"
+ echo
+ ((ERRORCODE++))
+fi
+FIND_UPPERCASE_FILES=$(find doc -type f -name "*[[:upper:]]*.md")
+echo '=> Checking for file names containing an uppercase letter...'
+echo
+if echo "${FIND_UPPERCASE_FILES}" | grep . &>/dev/null
+then
+ echo '✖ ERROR: Found one or more file names with an uppercase letter in their name. Use lowercase instead of uppercase for the file names.' >&2
+ echo 'https://docs.gitlab.com/ee/development/documentation/site_architecture/folder_structure.html#work-with-directories-and-files' >&2
+ echo
+ echo "${FIND_UPPERCASE_FILES}"
echo
((ERRORCODE++))
fi