summary refs log tree commit diff
path: root/scripts-dev/check-newsfragment
diff options
context:
space:
mode:
authorDan Callahan <danc@element.io>2021-10-21 23:06:41 +0100
committerDan Callahan <danc@element.io>2021-10-22 23:08:54 +0100
commit6a9d84a6761bd1afb8223512cec0c9809c4db9b5 (patch)
treeacede9dd9de342d90e3b4df476e7b143b4a77617 /scripts-dev/check-newsfragment
parentFix Shellcheck SC2154: variable possibly undefined (diff)
downloadsynapse-6a9d84a6761bd1afb8223512cec0c9809c4db9b5.tar.xz
Fix Shellcheck SC2166: test -a is not well defined
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.

https://github.com/koalaman/shellcheck/wiki/SC2166

Signed-off-by: Dan Callahan <danc@element.io>
Diffstat (limited to '')
-rwxr-xr-xscripts-dev/check-newsfragment2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts-dev/check-newsfragment b/scripts-dev/check-newsfragment
index 393a548d58..56600de0ad 100755
--- a/scripts-dev/check-newsfragment
+++ b/scripts-dev/check-newsfragment
@@ -45,7 +45,7 @@ matched=0
 for f in `git diff --name-only FETCH_HEAD... -- changelog.d`; do
     # check that any modified newsfiles on this branch end with a full stop.
     lastchar=`tr -d '\n' < $f | tail -c 1`
-    if [ $lastchar != '.' -a $lastchar != '!' ]; then
+    if [ $lastchar != '.' ] && [ $lastchar != '!' ]; then
         echo -e "\e[31mERROR: newsfragment $f does not end with a '.' or '!'\e[39m" >&2
         echo -e "$CONTRIBUTING_GUIDE_TEXT" >&2
         exit 1