agent/claude/qa/commands/lint.md
Snider b633ae81f6 feat: add README and flesh out all plugins
README.md:
- GitHub-friendly documentation
- Installation instructions
- Plugin overview with commands

review plugin:
- /review:security - Security-focused review
- /review:pr - PR review
- hooks.json - Post PR create suggestion
- scripts/post-pr-create.sh

verify plugin:
- /verify:ready - Quick readiness check
- /verify:tests - Test verification
- hooks.json - Pre-push warning
- scripts/pre-push-check.sh

qa plugin:
- /qa:check - Report only, no fixes
- /qa:lint - Lint with fix option
- hooks.json - QA output filtering

ci plugin:
- /ci:status - CI status display
- /ci:run - Trigger workflows
- /ci:fix - Analyse and fix failures
- hooks.json - Post-push CI hint
- scripts/post-push-ci.sh

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 19:48:51 +00:00

78 lines
1.4 KiB
Markdown

---
name: lint
description: Run linter and fix issues
args: [--check|--fix]
---
# Lint
Run linter and optionally fix issues.
## Usage
```
/qa:lint # Run lint, report issues
/qa:lint --check # Check only, no fixes
/qa:lint --fix # Auto-fix where possible
```
## Process
### Go
```bash
# Check
core go lint
# Some issues can be auto-fixed
golangci-lint run --fix
```
### PHP
```bash
# Check
core php stan
# PHPStan doesn't auto-fix, but can suggest fixes
```
## Common Issues
### Go
| Issue | Fix |
|-------|-----|
| `undefined: X` | Add import or define variable |
| `ineffectual assignment` | Use variable or remove |
| `unused parameter` | Use `_` prefix or remove |
| `error return value not checked` | Handle the error |
### PHP
| Issue | Fix |
|-------|-----|
| `Undefined variable` | Define or check existence |
| `Parameter $x has no type` | Add type hint |
| `Method has no return type` | Add return type |
## Output
```markdown
## Lint Results
**Linter**: golangci-lint
**Issues**: 3
### Errors
1. **pkg/api/handler.go:42** - undefined: ErrNotFound
→ Add `var ErrNotFound = errors.New("not found")`
2. **pkg/api/handler.go:87** - error return value not checked
→ Handle error: `if err != nil { return err }`
### Warnings
1. **pkg/api/handler.go:15** - unused parameter ctx
→ Rename to `_` or use it
---
Run `/qa:lint --fix` to auto-fix where possible.
```