grokkit/docs/user-guide/lint.md
Greg Gauthier cd47686679
All checks were successful
CI / Test (pull_request) Successful in 42s
CI / Lint (pull_request) Successful in 27s
CI / Build (pull_request) Successful in 23s
docs: refactor README and docs structure for better organization
- Simplified README.md by moving detailed command docs, workflows, and development info to dedicated user-guide/ and developer-guide/ directories.
- Created index.md files for both guides to improve navigation.
- Extracted individual command guides (e.g., chat.md, edit.md) into user-guide/ for focused, maintainable documentation.
- Moved architecture, configuration, and troubleshooting to developer-guide/.
- Updated README links to point to the new docs structure.
2026-03-07 22:42:43 +00:00

53 lines
1.7 KiB
Markdown

# 🔧 Lint Guide
The `lint` command is an AI-powered linter that identifies issues in your code and optionally provides AI-suggested fixes. It's designed to work with multiple languages and provide actionable suggestions.
### Key Features
- **Multi-language Support**: Automatically detects and lints Go, Python, C/C++, JS/TS, Rust, and more.
- **AI-Suggested Fixes**: Not only finds issues but can also suggest how to fix them.
- **Interactive Preview**: See the proposed fixes in a diff format before applying them.
- **Clean Code**: Grok is instructed to provide minimal, idiomatic fixes that match your project's style.
### Usage
Automatically detect language, run linter, and apply AI-suggested fixes.
```bash
# Just check for issues (no fixes)
grokkit lint main.go --dry-run
# Interactive fix (preview + confirmation)
grokkit lint app.py
# Auto-fix without confirmation
grokkit lint server.js --auto-fix
# Use specific model
grokkit lint script.rb -m grok-4
```
### Supported languages
- **Go** (golangci-lint, go vet)
- **Python** (pylint, flake8, ruff)
- **JavaScript/JSX** (eslint)
- **TypeScript/TSX** (eslint, tsc)
- **Rust** (clippy)
- **Ruby** (rubocop)
- **Java** (checkstyle)
- **C/C++** (clang-tidy)
- **Shell** (shellcheck)
### Safety features
- Shows preview of fixes
- Verifies fixes by re-running linter
- Requires confirmation (unless `--auto-fix`)
### Best Practices
- **Lint early and often**: Catching issues early is much easier than fixing them later.
- **Review fixes carefully**: AI-suggested fixes are usually excellent, but always review them to ensure they align with your project's specific requirements.
- **Combine with Review**: Use `lint` for basic issues and `grokkit review` for deeper logic analysis.