2023-05-04 11:03:02 +02:00
|
|
|
#!/usr/bin/env bash
|
2021-08-24 15:30:35 +02:00
|
|
|
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
|
2023-02-02 12:23:17 +01:00
|
|
|
touch tools/warnings_count/warnings_new.txt
|
2023-01-25 15:06:57 +01:00
|
|
|
cat build_log.txt | grep warning || [[ $? == 1 ]] | sort > tools/warnings_count/warnings_new.txt
|
2021-08-29 18:48:23 +02:00
|
|
|
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
|