mangos/apps/ci/ci-codestyle.sh
Meltie2013 c0411110cb
GitHub Actions Refactor (#143)
* Split Linux and Windows into their own jobs

* Implement Codestyling Check Script
* It checks for whitespaces (tabs).

* Fix some alignments.
2021-03-05 22:50:24 +00:00

26 lines
521 B
Bash

#!/bin/bash
set -e
echo "Starting Codestyling Script:"
echo "Checking for whitespaces:"
echo
declare -A singleLineRegexChecks=(
["[[:blank:]]$"]="Remove whitespace at the end of the lines above"
["\t"]="Replace tabs with 4 spaces in the lines above"
)
for check in ${!singleLineRegexChecks[@]}; do
echo " Checking RegEx: '${check}'"
if grep -P -r -I -n ${check} src; then
echo
echo "${singleLineRegexChecks[$check]}"
exit 1
fi
done
echo
echo "Awesome! No issues..."