1
0
mirror of https://github.com/bitcoin/bips.git synced 2026-03-09 15:53:54 +00:00

travis: add a check for common mistake mediawiki links

Several BIPs have mistaken links in format [text](url) which this travis check will detect and complain about.
This commit is contained in:
Karl-Johan Alm
2019-08-01 18:06:58 +09:00
parent a2645cdc42
commit 6129830a33
2 changed files with 24 additions and 0 deletions

23
scripts/link-format-chk.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
#
# Copyright (c) 2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Check wrong mediawiki link format
ECODE=0
FILES=""
for fname in $(git diff --name-only HEAD $(git merge-base HEAD master)); do
if [[ $fname == *.mediawiki ]]; then
GRES=$(grep -n '](' $fname)
if [ "$GRES" != "" ]; then
if [ $ECODE -eq 0 ]; then
>&2 echo "Github Mediawiki format writes link as [URL text], not as [text](url):"
fi
ECODE=1
echo "- $fname:$GRES"
fi
fi
done
exit $ECODE