Skip to content
Development
Command

/lint

Run Python code linting and formatting tools.

From plugin
claude-code-templates
31k200 skills200 agents200 commands32 MCP
Install
$ npx -y skills add davila7/claude-code-templates --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/lint

Context preview

What this command does when you run it.

Run Python code linting and formatting tools.

Command definition

lint.md

Python Linter

Run Python code linting and formatting tools.

Purpose

This command helps you maintain code quality using Python's best linting and formatting tools.

Usage

/lint

What this command does

1. **Runs multiple linters** (flake8, pylint, black, isort) 2. **Provides detailed feedback** on code quality issues 3. **Auto-fixes formatting** where possible 4. **Checks type hints** if mypy is configured

Example Commands

Black (code formatting)

# Format all Python files
black .

# Check formatting without changing files
black --check .

# Format specific file
black src/main.py

flake8 (style guide enforcement)

# Check all Python files
flake8 .

# Check specific directory
flake8 src/

# Check with specific rules
flake8 --max-line-length=88 .

isort (import sorting)

# Sort imports in all files
isort .

# Check import sorting
isort --check-only .

# Sort imports in specific file
isort src/main.py

pylint (comprehensive linting)

# Run pylint on all files
pylint src/

# Run with specific score threshold
pylint --fail-under=8.0 src/

# Generate detailed report
pylint --output-format=html src/ > pylint_report.html

mypy (type checking)

# Check types in all files
mypy .

# Check specific module
mypy src/models.py

# Check with strict mode
mypy --strict src/

Configuration Files

Most projects benefit from configuration files:

.flake8

[flake8]
max-line-length = 88
exclude = .git,__pycache__,venv
ignore = E203,W503

pyproject.toml

[tool.black]
line-length = 88

[tool.isort]
profile = "black"

Best Practices

  • Run linters before committing code
  • Use consistent formatting across the project
  • Fix linting issues promptly
  • Configure linters to match your team's style
  • Use type hints for better code documentation
Read more
Ships withclaude-code-templates

Ready-to-use configurations for Anthropic's Claude Code. A comprehensive collection of AI agents, custom commands, settings, hooks, external integrations (MCPs), and project templates to enhance your development workflow.

Get the whole plugin

Other commands on claude-code-templates.