[*] basic in-house cpp linting

Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
lizzie 2026-06-01 19:05:44 +00:00 • committed by crueter
parent ec2b9b0400
commit 9ae4915e9c
19 changed files with 60 additions and 64 deletions

40
tools/cpp-lint.sh Executable file
View file

@ -0,0 +1,40 @@
#!/bin/sh -ex
# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
# tools/../
ROOTDIR=$(CDPATH='' cd -- "$(dirname -- "$0")/../" && pwd)
die() {
echo "-- $*" >&2
exit 1
}
usage() {
cat <<EOF
Usage: $0 [command]
Dumb script that serves as a ad-hoc cpp-linter
Commands:
once Check for #pragma once prescence in header files
EOF
}
while :; do
case "$1" in
once)
find "$ROOTDIR/src" -type f -name "*.h" -exec grep -L "#pragma once" {} +
break
;;
osdef)
find "$ROOTDIR/src" -type f -name "*.h" -exec grep -nw "ANDROID" {} +
break
;;
*) usage ;;
esac
shift
done