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