All skills
wdm0006 avatar

/code-quality

@29279e3

Improves Python library code quality through ruff linting, mypy type checking, Pythonic idioms, and refactoring. Use when reviewing code for quality issues, adding type hints, configuring static analysis tools, or refactoring Python library code.

  • 4 files
  • 18.4 KB
  • Updated 2 months ago
  • GitHub

Use this Skill: https://skilld.dev/gh/wdm0006/python-skills/code-quality

This session only. Nothing lands on disk.

RUFF_CONFIG.md

≈417 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Ruff Configuration Reference

Comprehensive Configuration

[tool.ruff]
line-length = 88
target-version = "py310"

[tool.ruff.lint]
select = [
    "E",      # pycodestyle errors
    "W",      # pycodestyle warnings
    "F",      # Pyflakes
    "I",      # isort
    "B",      # flake8-bugbear
    "C4",     # flake8-comprehensions
    "UP",     # pyupgrade
    "ARG",    # flake8-unused-arguments
    "SIM",    # flake8-simplify
    "TCH",    # flake8-type-checking
    "PTH",    # flake8-use-pathlib
    "ERA",    # eradicate (commented code)
    "PL",     # pylint
    "RUF",    # ruff-specific
]
ignore = [
    "E501",    # line too long (formatter handles)
    "PLR0913", # too many arguments
    "PLR2004", # magic value comparison
]

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101", "ARG001", "PLR2004"]
"__init__.py" = ["F401"]  # unused imports OK in __init__

[tool.ruff.lint.isort]
known-first-party = ["my_library"]
force-single-line = true

[tool.ruff.format]
quote-style = "double"
indent-style = "space"

Rule Categories

Code Category Description
E, W pycodestyle PEP 8 style
F Pyflakes Logical errors
I isort Import sorting
B flake8-bugbear Bug patterns
C4 comprehensions Simplify comprehensions
UP pyupgrade Modern syntax
S bandit Security
ARG unused-arguments Unused params
SIM simplify Code simplification

Commands

ruff check src tests           # Lint
ruff check --fix src tests     # Lint + autofix
ruff format src tests          # Format
ruff check --select=I --fix .  # Fix imports only

Source: SKILL.md on GitHub

No third-party reports yet.

Signed by skilld at 29279e3. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 2 months ago

README badge

README badge for wdm0006/python-skills/code-quality