From b92f38629081d08159aab6542d0d10f6f341557b Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 8 Aug 2023 11:00:09 -0700 Subject: [PATCH] notify-api-387 scan projects for unused code --- .github/workflows/checks.yml | 2 ++ Makefile | 4 ++++ Pipfile | 1 + 3 files changed, 7 insertions(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 1dc92d63f..db0165d25 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -36,6 +36,8 @@ jobs: run: pipenv run flake8 . - name: Check imports alphabetized run: pipenv run isort --check-only ./app ./tests + - name: Check dead-code + run: make dead-code - name: Run js lint run: npm run lint - name: Run js tests diff --git a/Makefile b/Makefile index 079c699c5..3dc4030fa 100644 --- a/Makefile +++ b/Makefile @@ -59,6 +59,10 @@ py-test: ## Run python unit tests pipenv run coverage report --fail-under=96 pipenv run coverage html -d .coverage_cache +.PHONY: dead-code +dead-code: + pipenv run vulture ./app --min-confidence=100 + .PHONY: e2e-test e2e-test: export NEW_RELIC_ENVIRONMENT=test e2e-test: ## Run end-to-end integration tests diff --git a/Pipfile b/Pipfile index 3924e2b50..19d52f7d8 100644 --- a/Pipfile +++ b/Pipfile @@ -38,6 +38,7 @@ flask-talisman = "*" notifications-utils = {editable = true, ref = "main", git = "https://github.com/GSA/notifications-utils.git"} coverage = "*" pytest-playwright = "*" +vulture = "==2.7" [dev-packages] isort = "==5.12.0"