Smart linter/formatter with automatic tool detection
Project description
Taidy
A linter/formatter for all file types. Designed for AI agents to be able to easily use, so that you can tell them to use this for every file and it won't fail. Detects what tools are installed and uses them. If it can't find a tool, it passes silently.
Mostly written by AI (Claude Sonnet).
Features
- 🔍 Automatic Tool Detection: Tries multiple linters/formatters in priority order
- 🚀 Zero Configuration: Works out of the box (but respects existing config)
- 🔧 Extensible: Easy to add support for new languages and tools
- 📦 Python Package: Easy to install with pip, or run directly with Python
- 🎯 Smart Fallbacks: Gracefully falls back when preferred tools aren't available
Supported Languages & Tools
| Language | Priority Order |
|---|---|
| Python | ruff → uvx ruff → black → flake8 → pylint → python -m py_compile |
| JavaScript | eslint → prettier → node --check |
| TypeScript | eslint → tsc --noEmit → prettier |
| Go | gofmt |
| Rust | rustfmt |
| Ruby | rubocop |
| PHP | php-cs-fixer |
| JSON/CSS | prettier |
Installation
Option 1: uv tool install (Recommended)
# Install uv if you don't have it:
# curl -LsSf https://astral.sh/uv/install.sh | sh
uv tool install taidy
Option 2: pip install
pip install taidy
Option 3: Development Installation
git clone https://github.com/singletoned/taidy.git
cd taidy
pip install -e .
Option 4: Run Directly (No Installation)
git clone https://github.com/singletoned/taidy.git
cd taidy
python -m taidy file.py
Usage
Basic Usage
# Lint/format specific files
taidy main.py utils.js styles.css
# Or with python -m
python -m taidy main.py utils.js styles.css
# Lint/format all files in current directory (with find)
find . -name "*.py" -o -name "*.js" | xargs taidy
# Show help
taidy --help
# Show version
taidy --version
Examples
# Python files - will use ruff if available, fall back to black, etc.
taidy src/main.py tests/test_utils.py
# Mixed file types - each gets the appropriate linter
taidy main.py app.js styles.css README.md
# TypeScript project
taidy src/**/*.ts src/**/*.tsx
How It Works
Taidy examines each file's extension and tries linters/formatters in priority order:
- Check Availability: Uses
shutil.which()to see if each tool is installed - Run First Available: Executes the first available tool with appropriate arguments
- Report Results: Shows what was run and any issues found
For example, with a Python file:
- First tries
ruff check file.py - If ruff isn't installed, tries
uvx ruff check file.py - If uv isn't available, falls back to
black --check --diff file.py - And so on...
Development
Requirements
- Python 3.6+
- just (for build scripts)
- Docker (for integration tests)
Building
# Install in development mode
pip install -e .
# Build distribution packages
python -m build
# Run tests
just test
# Clean build artifacts
just clean
Testing
The project uses Behavior Driven Development (BDD) with Godog and testcontainers.
# Run all tests
just test
# Run specific feature
just test-feature features/python.feature
Contributing
- Fork the repository
- Create a feature branch
- Add tests for your changes
- Ensure all tests pass
- Submit a pull request
License
MIT License - see LICENSE file for details.
Roadmap
- Configuration file support (.taidy.yaml)
- Custom linter definitions
- Parallel execution for multiple files
- Plugin system
- More language support (C++, C#, Kotlin, etc.)
- Integration with popular editors (VS Code, vim, emacs)
Inspiration
Inspired by tools like:
- trunk - Universal linter/formatter
- mega-linter - Comprehensive linting suite
- pre-commit - Git hook framework
Taidy aims to be simpler and more focused: just automatically run the right linter for each file type.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file taidy-0.1.0.tar.gz.
File metadata
- Download URL: taidy-0.1.0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25e1dd8f912e7994d4d4f37918e758bdbc627e6ba6ea8b23b0d501032af961cd
|
|
| MD5 |
412508b427ddbb223fb24903a60f7487
|
|
| BLAKE2b-256 |
06b737a42ded1ca76fde5a7757027709b8a01b23a7c7465a40f6210fdefb6c07
|
File details
Details for the file taidy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: taidy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75c648d592e32fa1fae9ecdcb3f4d911ea45a3b5859cd198c2a0fa1cd83ea299
|
|
| MD5 |
652923533930c91d42d3edb20ac82a74
|
|
| BLAKE2b-256 |
1abc71e6f0e61cf7a5ea070caa3bd034e6a693d8b6df21dc715042e9bcf8a065
|