What I do
- •Format Python code using Ruff (
ruff format) - •Lint and auto-fix issues using Ruff (
ruff check --fix) - •Run pre-commit hooks to enforce formatting and lint checks on staged files
- •Validate code style and formatting compliance
When to use me
Use this skill for formatting and linting before every commit, after large code changes, or when preparing a PR/build in Python repositories.
Procedure
- •(Optional) Activate your Conda environment (for example,
conda activate pogo-team-optimizer) - •Format code:
ruff format . - •Lint and apply safe fixes:
ruff check . --fix - •(Optional) Apply additional fixes:
ruff check . --fix --unsafe-fixes - •Run pre-commit hooks if configured:
pre-commit run --all-files - •Fix any issues reported by Ruff or pre-commit
Related Guidelines
- •Follow AGENTS.md code style guidelines
- •Ensure all code passes Ruff and pre-commit checks before commit or PR
- •
pyproject.tomlor.ruff.tomlconfiguration is automatically respected - •Mandatory pre-commit/CI checks must succeed for quality