2016-06-24 05:23:10 -06:00
|
|
|
#! /bin/bash
|
2015-10-30 15:12:31 -06:00
|
|
|
#
|
|
|
|
# Linter script that checks for common style issues in Dolphin's codebase.
|
|
|
|
|
|
|
|
fail=0
|
|
|
|
|
2016-06-24 05:23:10 -06:00
|
|
|
# Check for clang-format issues.
|
2016-08-11 13:11:17 -06:00
|
|
|
for f in $(git diff --name-only --diff-filter=ACMRTUXB --cached); do
|
2016-06-24 05:23:10 -06:00
|
|
|
if ! echo "${f}" | egrep -q "[.](cpp|h|mm)$"; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if ! echo "${f}" | egrep -q "^Source/Core"; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
d=$(diff -u "${f}" <(clang-format ${f}))
|
|
|
|
if ! [ -z "${d}" ]; then
|
|
|
|
echo "!!! ${f} not compliant to coding style, here is the fix:"
|
|
|
|
echo "${d}"
|
|
|
|
fail=1
|
|
|
|
fi
|
|
|
|
done
|
2015-10-30 15:12:31 -06:00
|
|
|
|
|
|
|
exit ${fail}
|