mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-10-28 23:10:08 +01:00
[*] basic in-house cpp linting
Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
ec2b9b0400
commit
9ae4915e9c
19 changed files with 60 additions and 64 deletions
40
tools/cpp-lint.sh
Executable file
40
tools/cpp-lint.sh
Executable 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue