mxlint now automatically caches lint results. Results are reused when rule and input files haven't changed. This makes repeated linting much faster.
mxlint lint -r rules/ -m modelsource/mxlint cache-statsmxlint cache-clearmxlint lint -r rules/ -m modelsource/ --verboseClear the cache if:
- ❌ You suspect cache corruption
- 💾 Cache has grown too large
- 🐛 You're debugging caching issues
- 🔄 You want to force re-evaluation
~/.cache/mxlint/
- First Run: Evaluates all rules, saves results to cache
- Subsequent Runs: Uses cached results when files haven't changed
- After Changes: Re-evaluates only changed files, uses cache for rest
- First run: Same speed as before (building cache)
- Subsequent runs: 90-95% faster (all cached)
- After small changes: 80-85% faster (mostly cached)
- ✅ Automatic cache invalidation when files change
- ✅ Cache errors don't break linting
- ✅ Thread-safe implementation
- ✅ Version tracking for compatibility
# First run - builds cache
$ mxlint lint -r rules/ -m modelsource/
## Evaluating rules...
## All rules passed
# Check cache
$ mxlint cache-stats
Cache Statistics:
Entries: 150
Total Size: 2.3 MB
# Second run - uses cache (much faster!)
$ mxlint lint -r rules/ -m modelsource/
## Evaluating rules...
## All rules passed
# Modify a file, then lint again
# Only the modified file is re-evaluated
# Clear cache when needed
$ mxlint cache-clear
Cache cleared: ~/.cache/mxlintCheck with verbose mode:
mxlint lint -r rules/ -m modelsource/ --verbose 2>&1 | grep -i cacheLook for:
- "Cache hit" = Working ✅
- "Cache miss" = Building cache 🔨
- "Error creating cache key" = Issue ❌
mxlint cache-stats # Check size
mxlint cache-clear # Clear if neededThis shouldn't happen (cache auto-invalidates), but if it does:
mxlint cache-clear
mxlint lint -r rules/ -m modelsource/Q: Do I need to do anything special to use caching?
A: No, it's automatic. Just run mxlint lint as usual.
Q: Will old cached results cause issues? A: No, the cache automatically invalidates when files change.
Q: Can I disable caching? A: Currently no, but cache errors don't affect linting.
Q: Where is the cache stored?
A: ~/.cache/mxlint/ on all platforms.
Q: How much disk space does it use?
A: Depends on your project. Check with mxlint cache-stats.
Q: Is it safe to delete cache files manually?
A: Yes, but use mxlint cache-clear instead.
Q: Does caching work with parallel execution? A: Yes, the implementation is thread-safe.
- Let it build naturally: First run will build the cache
- Check stats periodically:
mxlint cache-stats - Clear when troubleshooting:
mxlint cache-clear - Use verbose mode for debugging:
--verboseflag - Don't worry about cache management: It's automatic