mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-12-26 17:54:31 +01:00
1fe31f6f19
It turns out that last fix was only partial, and it didn't fix the issue completely as paths were fixed, but staged changes were not in the list. This should fix it for real, this time. Sorry about that… (git diff needs --cached to include staged changes, unlike git status.)
24 lines
530 B
Bash
Executable File
24 lines
530 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 --cached); 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}
|