Skip to content

lgtm-hq/py-lintro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

680 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Lintro

Lintro Logo

A comprehensive CLI tool that unifies various code formatting, linting, and quality assurance tools under a single command-line interface.

CI Docker Coverage

Release PyPI Python License

CodeQL OpenSSF Scorecard OpenSSF Best Practices SBOM SBOM Status

πŸš€ Quick Start

uv pip install lintro              # Install (or: pip install lintro)
lintro check .                     # Find issues (alias: chk)
lintro format .                    # Fix issues (alias: fmt)
lintro check --output-format grid  # Beautiful output

✨ Why Lintro?

  • 🎯 Unified Interface - One command for all your linting and formatting tools
  • πŸ“Š Consistent Output - Beautiful, standardized output formats across all tools
  • πŸ”§ Auto-fixing - Automatically fix issues where possible
  • 🐳 Docker Ready - Run in isolated containers for consistent environments
  • πŸ“ˆ Rich Reporting - Multiple formats: grid, JSON, HTML, CSV, Markdown
  • ⚑ Fast - Optimized parallel execution

πŸ”Œ Works With Your Existing Configs

Lintro respects your native tool configurations. If you have a .prettierrc, pyproject.toml [tool.ruff], or .yamllint, Lintro uses them automatically - no migration required.

  • Native configs are detected - Your existing .prettierrc, .oxlintrc.json, etc. work as-is
  • Enforce settings override consistently - Set line_length: 88 once, applied everywhere
  • Fallback defaults when needed - Tools without native configs use sensible defaults

See the Configuration Guide for details on the 4-tier config system.

πŸ› οΈ Supported Tools

ToolLanguageAuto-fixInstall
Linters
Actionlint βš™οΈ GitHub Actions - GitHub Releases
Clippy πŸ¦€ Rust βœ… rustup component add clippy
Hadolint 🐳 Dockerfile - GitHub Releases
Markdownlint πŸ“ Markdown - bun add -g markdownlint-cli2
npm install -g markdownlint-cli2
Oxlint 🟨 JS/TS βœ… bun add -g oxlint
npm install -g oxlint
pydoclint 🐍 Python - πŸ“¦
ShellCheck 🐚 Shell Scripts - brew install shellcheck
GitHub Releases
Yamllint 🧾 YAML - πŸ“¦
Formatters
Black 🐍 Python βœ… πŸ“¦
Oxfmt 🟨 JS/TS βœ… bun add -g oxfmt
npm install -g oxfmt
Prettier 🟨 JS/TS Β· 🧾 JSON βœ… bun add -g prettier
npm install -g prettier
shfmt 🐚 Shell Scripts βœ… brew install shfmt
GitHub Releases
rustfmt πŸ¦€ Rust βœ… rustup component add rustfmt
Lint + Format
Ruff 🐍 Python βœ… πŸ“¦
SQLFluff πŸ—ƒοΈ SQL βœ… pipx install sqlfluff
Taplo 🧾 TOML βœ… brew install taplo
GitHub Releases
Type Checkers
Astro πŸš€ Astro - bun add astro
npm install astro
Mypy 🐍 Python - πŸ“¦
svelte-check πŸ”₯ Svelte - bun add -D svelte-check
npm install -D svelte-check
TypeScript 🟨 JS/TS - bun add -g typescript
npm install -g typescript
brew install typescript
vue-tsc πŸ’š Vue - bun add -D vue-tsc
npm install -D vue-tsc
Security
Bandit 🐍 Python - πŸ“¦
Gitleaks πŸ” Secret Detection - brew install gitleaks
GitHub Releases
cargo-audit πŸ¦€ Rust - cargo install cargo-audit
cargo-deny πŸ¦€ Rust - cargo install cargo-deny
OSV-Scanner πŸ”’ Multi-ecosystem - GitHub Releases
Semgrep πŸ”’ Multi-language - pipx install semgrep
pip install semgrep
brew install semgrep

πŸ“¦ = bundled with lintro β€” no separate install needed
⚑ Node.js tools support --auto-install to install dependencies automatically

πŸ€– AI-Powered Features (Optional)

Lintro includes optional AI-powered features that provide actionable summaries and interactive fix suggestions. AI features are BYO (Bring Your Own) API key β€” not enabled by default.

  • Providers: Anthropic Claude, OpenAI GPT
  • AI Summary β€” high-level assessment with pattern analysis (1 API call per run)
  • Interactive Fix Suggestions β€” AI-generated code diffs with risk classification
  • Post-fix Summary β€” contextualizes what was fixed and what remains
# Install with AI support
uv pip install 'lintro[ai]'
export ANTHROPIC_API_KEY=sk-ant-...   # or OPENAI_API_KEY

# Enable in config
# .lintro-config.yaml
# ai:
#   enabled: true
#   provider: anthropic

See the AI Features Guide for full documentation.

πŸ“¦ Installation

Python 3.11+ is required. Check tool versions with lintro list-tools.

# Lightweight (CLI only β€” detects tools on PATH)
uv pip install lintro
brew tap lgtm-hq/tap && brew install lintro

# Full (bundled Python tools: ruff, black, mypy, bandit, pydoclint, yamllint)
uv pip install 'lintro[full]'
brew tap lgtm-hq/tap && brew install lintro-full

# Docker (all tools)
docker run --rm -v $(pwd):/code ghcr.io/lgtm-hq/py-lintro:latest check

# Docker (CLI only)
docker run --rm -v $(pwd):/code ghcr.io/lgtm-hq/py-lintro-base:latest check

# First run after lightweight install
lintro init
lintro doctor
lintro install --profile recommended

See Getting Started for detailed installation options.

πŸ’» Usage

# Check all files (alias: chk)
lintro check .

# Auto-fix issues (alias: fmt)
lintro format .

# Grid output with grouping
lintro check --output-format grid --group-by file

# Run specific tools
lintro check --tools ruff,prettier,mypy

# Auto-install Node.js dependencies
lintro check --tools tsc --auto-install

# Exclude directories
lintro check --exclude "node_modules,dist,venv"

# List available tools
lintro list-tools

🐳 Docker

# Run from GHCR (tools image - recommended)
docker run --rm -v $(pwd):/code ghcr.io/lgtm-hq/py-lintro:latest check

# With formatting
docker run --rm -v $(pwd):/code ghcr.io/lgtm-hq/py-lintro:latest check --output-format grid

# Base image (minimal, no external tools; separate GHCR package)
docker run --rm -v $(pwd):/code ghcr.io/lgtm-hq/py-lintro-base:latest check

πŸ“š Documentation

Guide Description
Getting Started Installation, first steps, requirements
Configuration Tool configuration, options, presets
AI Features AI summaries, fix suggestions, config
Docker Usage Containerized development
GitHub Integration CI/CD setup, workflows
Contributing Development guide, adding tools
Troubleshooting Common issues and solutions

Advanced: Tool Analysis Β· Architecture Β· Security

πŸ”¨ Development

# Clone and install
git clone https://github.com/lgtm-hq/py-lintro.git
cd py-lintro
uv sync --dev

# Run tests
./scripts/local/run-tests.sh

# Run lintro on itself
./scripts/local/local-lintro.sh check --output-format grid

🀝 Community

πŸ“„ License

MIT License - see LICENSE for details.