Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/actions/check-dead-code/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Check Dead Code"
description: "Runs Vulture to detect unused Python code."

runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Install dependencies
shell: bash
run: make dependencies install-python

- name: Run Vulture
shell: bash
run: poetry run vulture

10 changes: 10 additions & 0 deletions .github/workflows/stage-1-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,13 @@ jobs:
uses: actions/checkout@v6
- name: "Run OWASP Dependency Scan"
uses: ./.github/actions/owasp-dependency-scan
check-dead-code:
name: "Check for dead code"
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: "Checkout code"
uses: actions/checkout@v6
- name: "Check for dead code"
uses: ./.github/actions/check-dead-code

5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ format: ## Format and fix code

format_lint: format lint

vulture:
poetry run vulture

#Files to loop over in release
_dist_include="pytest.ini poetry.lock poetry.toml pyproject.toml Makefile build/. tests"

Expand All @@ -52,7 +55,7 @@ config:: # Configure development environment (main) @Configuration
# TODO: Use only 'make' targets that are specific to this project, e.g. you may not need to install Node.js
make _install-dependencies

precommit: test-unit build test-integration lint ## Pre-commit tasks
precommit: test-unit build test-integration lint vulture ## Pre-commit tasks
python -m this

# ==============================================================================
Expand Down
16 changes: 14 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ python-dotenv = "^1.2.1"
openapi-spec-validator = "^0.7.2"
pip-licenses = "^5.5.0"
cachetools = "^7.0.1"
vulture = "^2.14"


[tool.poetry-plugin-lambda-build]
docker-image = "public.ecr.aws/sam/build-python3.13:1.139-x86_64" # See https://gallery.ecr.aws/search?searchTerm=%22python%22&architecture=x86-64&popularRegistries=amazon&verified=verified&operatingSystems=Linux
Expand Down Expand Up @@ -114,3 +116,8 @@ exclude_lines = [
"if TYPE_CHECKING:",
"raise NotImplementedError",
]

[tool.vulture]
min_confidence = 80
paths = ["src/", "tests/"]
ignore_names = ["secretsmanager_client", "consumer_*", "rule_processor_instance"]
Loading