-
Notifications
You must be signed in to change notification settings - Fork 386
Open
Labels
choreLinting, formatting, dependency hygiene, or project maintenance choresLinting, formatting, dependency hygiene, or project maintenance chorescicdIssue with CI/CD process (GitHub Actions, scaffolding)Issue with CI/CD process (GitHub Actions, scaffolding)
Milestone
Description
Problem
The project currently includes multiple tools that check for unused imports:
- importchecker (dev group)
- unimport (lint group)
- pyflakes (via flake8 - lint group)
- ruff with F401 rule (lint group)
Tools 1 and 2 are redundant because both pyflakes and ruff already detect unused imports via the F401 rule, which is already enabled in our linting pipeline.
Current Configuration
pyproject.toml
dev = [
"importchecker",
# ...
]
lint = [
"flake8>=7.3.0", # includes pyflakes F401
"ruff>=0.13.0", # includes F401 by default
"unimport>=1.2.1", # redundant
# ...
]Makefile
importchecker:
uv run --group=dev importchecker .
unimport:
uv run --group=lint unimport --check --diff $(TARGET)Recommendation
Remove both importchecker and unimport from:
- pyproject.toml dependency groups
- Makefile targets
- .pre-commit-config.yaml (if present)
- GitHub workflows (.github/workflows/*.yml)
- Any CI/CD pipelines that reference them
- Documentation mentioning these tools
Benefits
- Reduced dependencies: Two fewer packages to install and maintain
- Faster builds: Fewer tools to run during linting
- Simpler configuration: One canonical source of truth (ruff/pyflakes)
- Less confusion: Developers won't wonder which tool to use
- Better performance: Ruff is significantly faster than unimport
- Cleaner CI: Fewer pipeline steps to maintain
Verification
Ruff already checks for unused imports:
# F401 is enabled by default in ruff
ruff check mcpgateway/ --select=F401Flake8 also includes this via pyflakes:
# F401 is part of pyflakes, included in flake8
flake8 mcpgateway/ --select=F401Implementation Checklist
-
Remove from pyproject.toml:
"importchecker"from dev group"unimport>=1.2.1"from lint group
-
Remove from Makefile:
importcheckertargetunimporttarget- Any references in composite targets (e.g.,
lint,lint-all)
-
Check and remove from .pre-commit-config.yaml:
- Any hooks using unimport
- Any hooks using importchecker
-
Check and remove from GitHub workflows:
.github/workflows/*.yml- Search for
importcheckerandunimportreferences
-
Update documentation:
- Remove mentions from README.md
- Remove mentions from CONTRIBUTING.md
- Remove mentions from docs/
-
Update uv.lock:
- Run
uv lockafter removing dependencies
- Run
Search Commands
To find all references:
# Find all references to these tools
grep -r "importchecker" .
grep -r "unimport" . --include="*.yml" --include="*.yaml" --include="*.md"Related
This is part of the broader effort to consolidate linting tools and reduce redundancy in the development toolchain.
Metadata
Metadata
Assignees
Labels
choreLinting, formatting, dependency hygiene, or project maintenance choresLinting, formatting, dependency hygiene, or project maintenance chorescicdIssue with CI/CD process (GitHub Actions, scaffolding)Issue with CI/CD process (GitHub Actions, scaffolding)