Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
6532c137
Commit
6532c137
authored
Sep 25, 2017
by
Achilleas Pipinellis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add check for exec permissions and refactor lint doc script
parent
babc1d02
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
scripts/lint-doc.sh
scripts/lint-doc.sh
+17
-2
No files found.
scripts/lint-doc.sh
View file @
6532c137
...
...
@@ -3,15 +3,19 @@
cd
"
$(
dirname
"
$0
"
)
/.."
# Use long options (e.g. --header instead of -H) for curl examples in documentation.
grep
--extended-regexp
--recursive
--color
=
auto
'curl (.+ )?-[^- ].*'
doc/
echo
'Checking for curl short options...'
grep
--extended-regexp
--recursive
--color
=
auto
'curl (.+ )?-[^- ].*'
doc/
>
/dev/null 2>&1
if
[
$?
==
0
]
then
echo
'✖ ERROR: Short options should not be used in documentation!'
>
&2
echo
'✖ ERROR: Short options for curl should not be used in documentation!
Use long options (e.g., --header instead of -H):'
>
&2
grep
--extended-regexp
--recursive
--color
=
auto
'curl (.+ )?-[^- ].*'
doc/
exit
1
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...'
if
[
"
${
DUPLICATE_CHANGELOG_VERSIONS
}
"
!=
""
]
then
echo
'✖ ERROR: Duplicate versions in CHANGELOG.md:'
>
&2
...
...
@@ -19,5 +23,16 @@ then
exit
1
fi
# Make sure no files in doc/ are executable
EXEC_PERM_COUNT
=
$(
find doc/
-type
f
-perm
755 |
wc
-l
)
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
echo
find doc/
-type
f
-perm
755
exit
1
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