An open API service indexing awesome lists of open source software.

https://github.com/lgtm-hq/py-lintro

Making linters play nice... Mostly.
https://github.com/lgtm-hq/py-lintro

ci-cd cli code-quality docker docker-compose formatter github-actions linter linting python sbom static-analysis

Last synced: 4 months ago
JSON representation

Making linters play nice... Mostly.

Awesome Lists containing this project

README

          

# Lintro


Lintro Logo


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


Tests
CI
Docker
Coverage


Release
PyPI
Python
License


CodeQL
OpenSSF Scorecard
OpenSSF Best Practices
SBOM
SBOM Status

## ๐Ÿš€ Quick Start

```bash
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](docs/configuration.md) 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

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

## ๐Ÿ“ฆ Installation

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

```bash
# PyPI (recommended)
uv pip install lintro # or: pip install lintro

# Homebrew (macOS binary)
brew tap lgtm-hq/tap && brew install lintro-bin

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

# Docker (base image - minimal, no external tools)
docker run --rm -v $(pwd):/code ghcr.io/lgtm-hq/py-lintro:base check
```

See [Getting Started](docs/getting-started.md) for detailed installation options.

## ๐Ÿ’ป Usage

```bash
# 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

```bash
# 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)
docker run --rm -v $(pwd):/code ghcr.io/lgtm-hq/py-lintro:base check
```

## ๐Ÿ“š Documentation

| Guide | Description |
| ------------------------------------------------ | --------------------------------------- |
| [Getting Started](docs/getting-started.md) | Installation, first steps, requirements |
| [Configuration](docs/configuration.md) | Tool configuration, options, presets |
| [Docker Usage](docs/docker.md) | Containerized development |
| [GitHub Integration](docs/github-integration.md) | CI/CD setup, workflows |
| [Contributing](docs/contributing.md) | Development guide, adding tools |
| [Troubleshooting](docs/troubleshooting.md) | Common issues and solutions |

**Advanced:** [Tool Analysis](docs/tool-analysis/) ยท [Architecture](docs/architecture/)
ยท [Security](docs/security/)

## ๐Ÿ”จ Development

```bash
# 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

- ๐Ÿ›
[Bug Reports](https://github.com/lgtm-hq/py-lintro/issues/new?template=bug_report.md)
- ๐Ÿ’ก
[Feature Requests](https://github.com/lgtm-hq/py-lintro/issues/new?template=feature_request.md)
- โ“ [Questions](https://github.com/lgtm-hq/py-lintro/issues/new?template=question.md)
- ๐Ÿ“– [Contributing Guide](docs/contributing.md)

## ๐Ÿ“„ License

MIT License - see [LICENSE](LICENSE) for details.