mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-12-30 22:10:59 +01:00
cbb77532c6
git diff --name-only already took care of only returning the name, so the awk is unneeded and makes it return only empty file names. Facepalm, I know. Sorry for this oversight. (Also fixes something that lint didn't catch because of this)
24 lines
521 B
Bash
Executable File
24 lines
521 B
Bash
Executable File
#! /bin/bash
|
|
#
|
|
# Linter script that checks for common style issues in Dolphin's codebase.
|
|
|
|
fail=0
|
|
|
|
# Check for clang-format issues.
|
|
for f in $(git diff --name-only --diff-filter=ACMRTUXB); do
|
|
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
|
|
|
|
exit ${fail}
|