Skip to content

Commit dc979b5

Browse files
ChrisPC-39Sebastian
andauthored
Vulture and unimport makefile targets + github actions (#454)
* Add vulture+unimport make targets and depenencies Signed-off-by: Sebastian <[email protected]> * Add github actions Signed-off-by: Sebastian <[email protected]> * yamlint Signed-off-by: Sebastian <[email protected]> --------- Signed-off-by: Sebastian <[email protected]> Co-authored-by: Sebastian <[email protected]>
1 parent 5a54ce8 commit dc979b5

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

.github/workflows/lint.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ jobs:
5959
cmd: |
6060
ruff check mcpgateway
6161
62+
- id: unimport
63+
setup: pip install unimport
64+
cmd: |
65+
unimport mcpgateway
66+
67+
- id: vulture
68+
setup: pip install vulture
69+
cmd: |
70+
vulture mcpgateway --min-confidence 80
71+
6272
# - id: pylint
6373
# setup: pip install pylint
6474
# cmd: pylint mcpgateway

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,13 @@ images:
414414
# help: sbom - Produce a CycloneDX SBOM and vulnerability scan
415415
# help: pytype - Flow-sensitive type checker
416416
# help: check-manifest - Verify sdist/wheel completeness
417+
# help: unimport - Unused import detection
418+
# help: vulture - Dead code detection
417419

418420
# List of individual lint targets; lint loops over these
419421
LINTERS := isort flake8 pylint mypy bandit pydocstyle pycodestyle pre-commit \
420422
ruff pyright radon pyroma pyrefly spellcheck importchecker \
421-
pytype check-manifest markdownlint
423+
pytype check-manifest markdownlint vulture unimport
422424

423425
.PHONY: lint $(LINTERS) black fawltydeps wily depend snakeviz pstats \
424426
spellcheck-sort tox pytype sbom
@@ -599,6 +601,12 @@ check-manifest: ## 📦 Verify MANIFEST.in completeness
599601
@echo "📦 Verifying MANIFEST.in completeness..."
600602
@$(VENV_DIR)/bin/check-manifest
601603

604+
unimport: ## 📦 Unused import detection
605+
@echo "📦 unimport …" && $(VENV_DIR)/bin/unimport --check --diff mcpgateway
606+
607+
vulture: ## 🧹 Dead code detection
608+
@echo "🧹 vulture …" && $(VENV_DIR)/bin/vulture mcpgateway --min-confidence 80
609+
602610
# -----------------------------------------------------------------------------
603611
# 📑 GRYPE SECURITY/VULNERABILITY SCANNING
604612
# -----------------------------------------------------------------------------

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ dev = [
149149
"ty>=0.0.1a14",
150150
"types-tabulate>=0.9.0.20241207",
151151
"uv>=0.7.20",
152+
"unimport>=1.2.1",
153+
"vulture>=2.14",
152154
"yamllint>=1.37.1",
153155
]
154156

0 commit comments

Comments
 (0)