papermario/tools/warnings_count/check_new_warnings.sh
Marijn van der Werf 5511e18133
Clean executable files (#1047)
* Mark headers as non-executable

* Update shebangs
2023-05-04 18:03:02 +09:00

31 lines
836 B
Bash
Executable File

#!/usr/bin/env bash
set -e
set -o pipefail
# This script can be used when you want to test locally the amount of warnings produced by your changes before doing a PR.
pyflags=""
rebuild=false
if [[ $1 == "--jenkins" ]]
then
pyflags="--pr-message"
rebuild=false
else
rebuild=true
fi
if $rebuild
then
echo "Rebuilding to collect warnings..."
rm -rf ver/*/build/src
ninja | grep warning | sort > tools/warnings_count/warnings_new.txt
else
touch tools/warnings_count/warnings_new.txt
cat build_log.txt | grep warning || [[ $? == 1 ]] | sort > tools/warnings_count/warnings_new.txt
fi
curl -L https://papermar.io/reports/warnings.txt > tools/warnings_count/warnings.txt
python3 tools/warnings_count/compare_warnings.py tools/warnings_count/warnings.txt tools/warnings_count/warnings_new.txt $pyflags