mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-09 07:39:26 +01:00
Add linter script which will replace the ad-hoc commands ran by the linter Buildbot.
This commit is contained in:
parent
dabb411a4c
commit
15ad14a9dc
37
Tools/lint.sh
Executable file
37
Tools/lint.sh
Executable file
@ -0,0 +1,37 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
#
|
||||||
|
# Linter script that checks for common style issues in Dolphin's codebase.
|
||||||
|
|
||||||
|
REPO_BASE=$(realpath $(dirname $0)/..)
|
||||||
|
|
||||||
|
fail=0
|
||||||
|
|
||||||
|
# Step 1: check for includes ordering.
|
||||||
|
echo "[.] Checking #include statements ordering."
|
||||||
|
res=$(
|
||||||
|
${REPO_BASE}/Tools/check-includes.py \
|
||||||
|
$(find ${REPO_BASE}/Source/Core -name "*.cpp" -o -name "*.h") \
|
||||||
|
2>&1 \
|
||||||
|
>/dev/null
|
||||||
|
)
|
||||||
|
if [ -n "${res}" ]; then
|
||||||
|
echo "FAIL: ${res}"
|
||||||
|
fail=1
|
||||||
|
else
|
||||||
|
echo "OK"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Step 2: check for trailing whitespaces.
|
||||||
|
echo "[.] Checking for trailing whitespaces."
|
||||||
|
res=$(
|
||||||
|
find ${REPO_BASE}/Source/Core -name "*.cpp" -o -name "*.h" \
|
||||||
|
| xargs egrep -n "\s+$"
|
||||||
|
)
|
||||||
|
if [ -n "$res" ]; then
|
||||||
|
echo "FAIL: ${res}"
|
||||||
|
fail=1
|
||||||
|
else
|
||||||
|
echo "OK"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit ${fail}
|
Loading…
x
Reference in New Issue
Block a user