Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Fix check-newsfragment script #4750

Merged
merged 3 commits into from Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog.d/4698.misc
@@ -1 +1 @@
Better checks on newsfragments
Better checks on newsfragments.
1 change: 1 addition & 0 deletions changelog.d/4750.misc
@@ -0,0 +1 @@
Better checks on newsfragments.
11 changes: 8 additions & 3 deletions scripts-dev/check-newsfragment
Expand Up @@ -6,7 +6,8 @@
set -e

# make sure that origin/develop is up to date
git fetch origin develop
git remote set-branches --add origin develop
git fetch --depth=1 origin develop

UPSTREAM=origin/develop

Expand All @@ -25,11 +26,15 @@ if git diff --name-only $UPSTREAM... | grep -qv '^develop/'; then
tox -e check-newsfragment
fi

echo
echo "--------------------------"
echo

# check that any new newsfiles on this branch end with a full stop.
for f in git diff --name-only $UPSTREAM... -- changelog.d; do
for f in `git diff --name-only $UPSTREAM... -- changelog.d`; do
lastchar=`tr -d '\n' < $f | tail -c 1`
if [ $lastchar != '.' ]; then
echo "Newsfragment $f does not end with a '.'" >&2
echo -e "\e[31mERROR: newsfragment $f does not end with a '.'\e[39m" >&2
exit 1
fi
done
Expand Down