From python-lint-fix
Runs ruff, mypy, and bandit on changed Python files — explains violations and auto-fixes with ruff check --fix. Use when asked to "lint", "fix lint", "check types", "type check", "run mypy", "run ruff", "python quality", or "lint python files".
npx claudepluginhub shouenlee/ghcp-dev-plugin --plugin python-lint-fixThis skill uses the workspace's default tool permissions.
Analyze Python files for lint violations, type errors, and security issues using ruff, mypy, and bandit. Automatically fix what can be fixed and explain remaining issues.
Provides workflows for sub-agents to resolve Python linting errors from ruff, mypy, pyright, and basedpyright via root-cause analysis, suppression gates, and verification steps.
Lints Python code with ruff: fast checks, rule selection, auto-fixing, output formats, configuration. Use for code quality, bug detection, standards enforcement.
Share bugs, ideas, or general feedback.
Analyze Python files for lint violations, type errors, and security issues using ruff, mypy, and bandit. Automatically fix what can be fixed and explain remaining issues.
The following tools must be installed. If missing, install them with:
uv pip install ruff mypy bandit
Identify target files -- determine which Python files to check. Use changed files from git or user-specified paths:
git diff --name-only HEAD -- '*.py'
If the user specifies files or directories, use those instead.
Run ruff check on the target files and capture the output:
ruff check <files>
Run mypy on the target files and capture the output:
mypy <files>
Run bandit on the target files and capture the output:
bandit -r <files>
Present findings grouped by tool. For each issue, include:
file:line)E501, F841, B101)Offer to auto-fix issues that ruff can handle automatically:
ruff check --fix <files>
ruff format <files>
Re-run checks to confirm fixes were applied and report any remaining issues:
ruff check <files>
mypy <files>
bandit -r <files>
| Problem | Cause | Solution |
|---|---|---|
ruff: command not found | ruff is not installed | Run uv pip install ruff or pip install ruff |
mypy: command not found | mypy is not installed | Run uv pip install mypy or pip install mypy |
bandit: command not found | bandit is not installed | Run uv pip install bandit or pip install bandit |
mypy reports Cannot find implementation or library stub | Missing type stubs for third-party packages | Run mypy --install-types or add stubs with uv pip install types-<package> |
mypy reports Skipping analyzing | Module is not in the mypy search path | Add the source directory to mypy.ini or pyproject.toml under [tool.mypy] with mypy_path |
| ruff ignores some files | Files are excluded in pyproject.toml or ruff.toml | Check [tool.ruff] exclude patterns in your config file |
| Too many issues reported | No config file limiting rule set | Create a ruff.toml or [tool.ruff] section in pyproject.toml to select specific rule sets |
| bandit reports false positives | Some rules are too strict for your codebase | Use # nosec inline comments or configure exclusions in .bandit or pyproject.toml |
ruff check --fix did not fix all issues | Some violations require manual intervention | Review the remaining issues and fix them by hand; ruff marks auto-fixable rules in its output |