Table of contents
- Set Up Linting
- Automate Test Runs
- Coverage Reports
- Security Scans
- Quality Gates
- Example Configurations
- Next Steps
- FAQ
Set Up Linting
Create ~/.openclaw/workspace/prompts/code-lint.md:
# Code Linting Check
Run linters on changed files:
- ESLint for JavaScript/TypeScript
- Pylint for Python
- RuboCop for Ruby
- Go fmt for Go
Report errors and warnings count.
Block merge if >5 errors.
Automate Test Runs
Create ~/.openclaw/workspace/prompts/auto-test.md:
# Automated Test Runner
Run test suite on every push:
- Execute npm test, pytest, or go test
- Parse results for failures
- Generate test report
- Comment on PR with results
Fail build if test coverage <80%.
Coverage Reports
Generate coverage with:
npm run coverage # JavaScript
pytest --cov=src # Python
go test -cover # Go
Security Scans
Create ~/.openclaw/workspace/prompts/security-scan.md:
# Security Scan
Scan new commits for:
- Hardcoded secrets
- Insecure dependencies
- SQL injection patterns
- XSS vulnerabilities
Generate security report with severity levels.
Quality Gates
Configure in ~/.openclaw/openclaw.json:
{
"automation": {
"quality-gate": {
"schedule": "*/10 * * * *",
"prompt": "file:prompts/code-lint.md",
"rules": {
"maxErrors": 5,
"minCoverage": 80,
"requireTests": true,
"requireSecurity": true
}
}
}
}
Example Configurations
JavaScript Project
ESLint + Prettier + Jest
Coverage threshold: 80%
Security scan on PR
Python Project
Pylint + Black + pytest
Coverage threshold: 85%
Bandit security scan
Next Steps
FAQ
Q: Can OpenClaw fix code issues?
A: It can suggest fixes but won't apply them automatically. Use with approvals.
Q: How are test results reported?
A: As formatted summaries with pass/fail status and coverage metrics.
Q: Can it run multiple linters?
A: Yes. Configure all relevant linters for your languages.
Q: What about custom quality rules?
A: Define custom rules in your prompts for project-specific needs.