Skip to content

Commit 35892e8

Browse files
committed
chore: Add cppcheck target
1 parent 464b9f6 commit 35892e8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

justfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ build:
7272
test:
7373
uv run ctest --preset {{preset}}
7474

75+
# Run cppcheck using the generated compile_commands.json (optional: run `just configure` first)
76+
cppcheck:
77+
@command -v cppcheck >/dev/null 2>&1 || { echo "cppcheck not found; install it (brew/apt)"; exit 2; }
78+
# Use compile_commands.json so cppcheck picks up include paths from CMake/Conan
79+
COMPILE_COMMANDS_PATH=build/{{build_type}}/compile_commands.json; if [ ! -f "$COMPILE_COMMANDS_PATH" ]; then echo "compile_commands.json not found; run 'just configure' first"; exit 1; fi; cppcheck --project="$COMPILE_COMMANDS_PATH" -v --enable=all --check-level=exhaustive --inline-suppr --suppress=missingIncludeSystem --suppress=unmatchedSuppression || true
80+
7581
# Run the compiled leetcode_cpp executable. Depends on `build` so the binary
7682
# is up-to-date. Override `run_binary` or `build_type` locally if needed.
7783
run: build

0 commit comments

Comments
 (0)