| name | code-quality |
| description | Use for linting, formatting, and type checking with ruff, black, flake8, mypy. |
Skill: code-quality
This skill covers all code quality tools for Python projects.
Linting (ruff)
ruff check .
ruff check . --fix
ruff check . --fix --select F,E
ruff rule E501
Formatting (black)
black .
black --check .
black --line-length=88 .
black --exclude "tests/" .
Additional Linting (flake8)
flake8 . --max-line-length=88
flake8 . --extend-ignore=E203,W503
flake8 . --exclude=__pycache__,.git
Type Checking (mypy)
mypy .
mypy . --ignore-missing-imports
mypy . --exclude tests/
mypy . --strict
Import Sorting (isort)
isort --check-only .
isort .
Full Quality Check
ruff check . --fix
black .
flake8 . --max-line-length=88
mypy . --ignore-missing-imports
isort --check-only .
Common Issues
| Issue | Fix |
|---|
| E501 line too long | Wrap lines or use black . |
| F401 imported but unused | ruff check . --fix |
| F811 redefinition | Remove duplicate imports |
| I001 isort order | isort . |
| mypy: no type hints | Add type hints to functions |
Configuration Files
pyproject.toml - ruff, black, isort settings
.ruff.toml - ruff-specific config
mypy.ini - mypy configuration
.flake8 - flake8 settings
Best Practices
- Run locally before push - Always verify locally
- Use pre-commit hooks - Add to
.pre-commit-config.yaml
- Fix incrementally - Don't ignore warnings
- Type hints encouraged - Improves IDE support
- Line length 88 - Black default, matches PEP 8