BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
0efbcc6c
Commit
0efbcc6c
authored
Mar 27, 2018
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'docs/add-test-for-readmes' into 'master'
Add test for new README.md in docs Closes #44647 See merge request gitlab-org/gitlab-ce!17991
parents
7c02d0cf
c8205203
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
3 deletions
+31
-3
lint-doc.sh
scripts/lint-doc.sh
+31
-3
No files found.
scripts/lint-doc.sh
View file @
0efbcc6c
...
...
@@ -3,7 +3,7 @@
cd
"
$(
dirname
"
$0
"
)
/.."
# Use long options (e.g. --header instead of -H) for curl examples in documentation.
echo
'
Checking for curl
short options...'
echo
'
=> Checking for cURL
short options...'
grep
--extended-regexp
--recursive
--color
=
auto
'curl (.+ )?-[^- ].*'
doc/
>
/dev/null 2>&1
if
[
$?
==
0
]
then
...
...
@@ -15,7 +15,7 @@ fi
# Ensure that the CHANGELOG.md does not contain duplicate versions
DUPLICATE_CHANGELOG_VERSIONS
=
$(
grep
--extended-regexp
'^## .+'
CHANGELOG.md |
sed
-E
's| \(.+\)||'
|
sort
-r
|
uniq
-d
)
echo
'Checking for CHANGELOG.md duplicate entries...'
echo
'
=>
Checking for CHANGELOG.md duplicate entries...'
if
[
"
${
DUPLICATE_CHANGELOG_VERSIONS
}
"
!=
""
]
then
echo
'✖ ERROR: Duplicate versions in CHANGELOG.md:'
>
&2
...
...
@@ -25,7 +25,7 @@ fi
# Make sure no files in doc/ are executable
EXEC_PERM_COUNT
=
$(
find doc/ app/
-type
f
-perm
755 |
wc
-l
)
echo
'Checking for executable permissions...'
echo
'
=>
Checking for executable permissions...'
if
[
"
${
EXEC_PERM_COUNT
}
"
-ne
0
]
then
echo
'✖ ERROR: Executable permissions should not be used in documentation! Use `chmod 644` to the files in question:'
>
&2
...
...
@@ -33,5 +33,33 @@ then
exit
1
fi
# Do not use 'README.md', instead use 'index.md'
# Number of 'README.md's as of 2018-03-26
NUMBER_READMES_CE
=
42
NUMBER_READMES_EE
=
46
FIND_READMES
=
$(
find doc/
-name
"README.md"
|
wc
-l
)
echo
'=> Checking for new README.md files...'
if
[
"
${
CI_PROJECT_NAME
}
"
==
'gitlab-ce'
]
then
if
[
${
FIND_READMES
}
-ne
${
NUMBER_READMES_CE
}
]
then
echo
echo
' ✖ ERROR: New README.md file(s) detected, prefer index.md over README.md.'
>
&2
echo
' https://docs.gitlab.com/ee/development/writing_documentation.html#location-and-naming-documents'
echo
exit
1
fi
elif
[
"
${
CI_PROJECT_NAME
}
"
==
'gitlab-ee'
]
then
if
[
${
FIND_READMES
}
-ne
$NUMBER_READMES_EE
]
then
echo
echo
' ✖ ERROR: New README.md file(s) detected, prefer index.md over README.md.'
>
&2
echo
' https://docs.gitlab.com/ee/development/writing_documentation.html#location-and-naming-documents'
echo
exit
1
fi
fi
echo
"✔ Linting passed"
exit
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment