From 1e47c280b2e3f6c4da0462b142754860cda80a34 Mon Sep 17 00:00:00 2001 From: def Date: Sat, 30 Jul 2022 13:50:24 +0200 Subject: [PATCH] Automatically detect unused header files --- .github/workflows/style.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 138a470d2..0f55f5024 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -50,3 +50,6 @@ jobs: run: | pylint --version find . -type f -name "*.py" -not -path './ddnet-libs/*' -not -path './googletest-src/*' -print0 | xargs -0 pylint + - name: Unused headers + run: | + find src -name '*.h' | while read i; do grep -r -q $(basename $i) || (echo "Header file $i is unused" && exit 1); done