Skip to content

Commit

Permalink
Update check-backwards-compatability.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jbergler authored Nov 7, 2023
1 parent 717a899 commit 86a5b0a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/check-backwards-compatability.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ for tag in $tags; do

set +e # do our own error handling for a bit
echo "Checking backward compatibility of semgrep_output_v1.atd against past version $tag"
git difftool --trust-exit-code -x 'atddiff --no-locations --backward' -y "$tag" "origin/main" semgrep_output_v1.atd | tee before.txt
git difftool --trust-exit-code -x 'atddiff --no-locations --backward' -y "$tag" "origin/main" semgrep_output_v1.atd > before.txt
ret=$?
if [ "$ret" -ge 1 ] && [ "$ret" -le 2 ]; then
echo "ERROR: atddiff had an error: $?"
cat before.txt
exit 1
fi
git difftool --trust-exit-code -x 'atddiff --no-locations --backward' -y "$tag" "HEAD" semgrep_output_v1.atd | tee after.txt
git difftool --trust-exit-code -x 'atddiff --no-locations --backward' -y "$tag" "HEAD" semgrep_output_v1.atd > after.txt
ret=$?
if [ "$ret" -ge 1 ] && [ "$ret" -le 2 ]; then
echo "ERROR: atddiff had an error: $?"
cat after.txt
exit 1
fi

# neccesary because filenames have temp paths and line numbers can change without causing issues
#expr='s|File "/.*/\(.*.atd\)", line .*$|File "\1", line <removed for diff>|g'
diff -u <(cat before.txt) <(cat after.txt)
if [ "$?" -ne 0 ]; then
echo "ERROR: semgrep_output_v1.atd is not backward compatible with $tag"
Expand Down

0 comments on commit 86a5b0a

Please sign in to comment.