Quick Start Guide¶
Get up and running with thailint in 5 minutes.
Prerequisites¶
- Python 3.11 or higher
- pip (Python package manager)
Installation¶
Or run instantly with uvx (no install required):
Or with Docker:
Your First Lint¶
Step 1: Verify Installation¶
Step 2: Generate a Configuration File (Optional)¶
# Generate config with lenient preset (recommended for existing projects)
thailint init-config --preset lenient
# Or use interactive mode
thailint init-config
Presets:
- strict: Only -1, 0, 1 allowed (best for new projects)
- standard: Balanced defaults
- lenient: Includes time conversions (60s, 3600s) and common sizes
Step 3: Run Your First Lint¶
# Pick any linter and point it at your code
thailint dry src/
thailint nesting src/
thailint magic-numbers src/
Step 4: Understanding the Output¶
Example output:
src/app.py:42:15 - Magic number 3600 should be a named constant
Suggestion: Extract 3600 to a named constant (e.g., TIMEOUT_SECONDS = 3600)
What this means:
- src/app.py:42:15 - File path, line number, column number
- Magic number 3600 - The issue detected
- Suggestion - How to fix it
Exit codes:
- 0 - No violations found (success)
- 1 - Violations found
- 2 - Error occurred
Ignoring Violations¶
# Line-level
timeout = 3600 # thailint: ignore[magic-numbers]
# File-level
# thailint: ignore-file[magic-numbers]
Or in config:
See How to Ignore Violations for the complete 5-level ignore system.
CI/CD Integration¶
# GitHub Actions
- name: Run thailint
run: |
pip install thailint
thailint dry src/
thailint nesting src/
See Pre-commit Hooks Guide for automated checks on every commit.
Next Steps¶
- Configuration Reference - All config options
- CLI Reference - All commands and flags
- Troubleshooting Guide - Common issues
- Browse linter guides - Each linter has a detailed doc (see sidebar)
FAQ¶
Q: Why am I getting so many violations?¶
This is normal for existing codebases. Options:
- Use lenient preset:
thailint init-config --preset lenient - Add to ignore list in config
- Start with one linter at a time
Q: Do I need a config file?¶
No. thailint works with sensible defaults. Config files are optional.
Ready to go? Start linting and check the Configuration Reference for customization options.