Skip to content

πŸš€ aider-lint-fixer v1.6.0

Choose a tag to compare

@github-actions github-actions released this 18 Jul 14:43
· 173 commits to main since this release

🎯 Major Learning System Enhancement

This release dramatically improves error detection accuracy by resolving missing learning dependencies and enhancing project-specific configurations.

✨ Added

  • Enhanced Learning Dependencies: Added pyahocorasick>=1.4.0 for high-performance pattern matching
  • Optional Dependencies Structure: New [learning] and [all] installation options
  • Auto-Rule Creation: Automatically creates scraped rules when web dependencies are available
  • Learning Setup Checker: New scripts/check_learning_setup.py for dependency verification
  • Enhanced ESLint Integration: Project-specific configuration detection for TypeScript projects
  • Comprehensive Documentation: Learning features section in README with troubleshooting

πŸ”§ Enhanced

  • ESLint Configuration Detection: Auto-detects .eslintrc.js, tsconfig.json, and npm scripts
  • TypeScript Support: Dynamic extension detection based on project setup
  • npm Script Integration: Prefers npm run lint when available for better compatibility
  • Learning Statistics: Enhanced --stats output with setup guidance
  • Error Classification: Improved accuracy from 0.0% to 46.1% fixability rate

πŸ› Fixed

  • Learning Files Not Created: Resolved missing scikit-learn dependency issue
  • Aho-Corasick Warnings: Added optional dependency for high-performance pattern matching
  • TypeScript Project Support: Fixed ESLint integration for TypeScript projects with custom configs
  • Import Sorting: Fixed CI/CD formatting issues with proper import organization

πŸ“¦ Installation

# Basic installation
pip install aider-lint-fixer==1.6.0

# With learning features (recommended)
pip install aider-lint-fixer[learning]==1.6.0

# All features
pip install aider-lint-fixer[all]==1.6.0

🧠 Learning System Improvements

  • Automatic Setup: Learning works out of the box with proper dependencies
  • Better Feedback: Clear warnings and setup instructions when dependencies are missing
  • Performance: High-speed pattern matching with Aho-Corasick algorithm
  • Rule Coverage: 392+ rules automatically scraped from official linter documentation

πŸ“ˆ Performance Impact

  • Before: Found 0 fixable errors (0.0% of 58 total baseline errors)
  • After: Found 27 fixable errors (46.1% of 58 total baseline errors)

πŸ” Verification

# Check learning setup
python scripts/check_learning_setup.py

# Monitor learning progress
aider-lint-fixer --stats

# Test on TypeScript project
aider-lint-fixer . --linters eslint --dry-run
``` - 2025-07-18

### πŸš€ Major Intelligence Upgrade - Web Scraping & Enhanced Pattern Matching

This release represents a **major leap forward** in intelligent lint fixing capabilities, featuring a **5.7x expansion** in rule knowledge, **web scraping infrastructure**, and **critical bug fixes**.

### ✨ New Features

#### **🌐 Web Scraping Infrastructure**
- **392+ rules** loaded from official linter documentation (vs 68 previously)
- **Live rule updates** from ansible-lint, ESLint, and flake8 docs
- **Intelligent categorization** and fixability detection
- **Automatic rule caching** with smart updates

#### **🧠 Enhanced Pattern Matching System**
- **100% test accuracy** on comprehensive test suite
- **Sub-millisecond performance** maintained despite 5.7x rule expansion
- **Multi-language support**: Python, JavaScript, TypeScript, Ansible, Go, Rust
- **Aho-Corasick algorithm** for high-performance string matching

#### **πŸ“Š Improved CLI Experience**
- **`--stats` flag** now available in main CLI (no more hidden commands)
- **JSON output support** for stats: `--stats --output-format json`
- **Better error handling** and user feedback
- **Cross-platform color support** with `--no-color` option

### πŸ› Critical Bug Fixes

#### **πŸ”§ Learning Integration Fix**
- **Fixed language detection bug** that prevented ML training data accumulation
- **ansible-lint errors** now correctly mapped to "ansible" language
- **Active learning** from real fixes now working properly

#### **🎨 Colorama Compatibility**
- **Fixed CLI crashes** related to color output handling
- **Robust color management** across different terminal environments
- **Safe fallbacks** for environments without color support

#### **πŸ”„ Concurrent Access Safety**
- **Improved file handling** for training data
- **Race condition protection** in multi-threaded scenarios
- **Robust JSON parsing** with error recovery

### πŸ“ˆ Performance Improvements

#### **⚑ Speed & Efficiency**
- **<10ms per error classification** (maintained despite rule expansion)
- **~153KB total cache size** (efficient memory usage)
- **Intelligent caching** with LRU eviction
- **Automatic cleanup** of old training data (30+ days)

#### **🎯 Accuracy Improvements**
- **46.1% fixability rate** on real-world projects
- **Conservative but accurate** error detection
- **High-confidence recommendations** with scoring
- **Multiple classification methods** (rule knowledge, pattern matching, ML)

### πŸ§ͺ Testing & Quality

#### **βœ… Comprehensive Test Coverage**
- **71 total tests** (25 new tests added)
- **67 tests passing**, 4 skipped (optional linters)
- **Regression prevention** built into test suite
- **Multi-platform compatibility** testing

#### **πŸ” New Test Categories**
- **Web scraping functionality** (11 tests)
- **Enhanced pattern matching** (14 tests)
- **CLI stats integration** (3 tests)
- **Learning system validation** (multiple tests)
- **Error handling robustness** (comprehensive coverage)

### πŸ“ New Files Added

#### **πŸ”§ Core Modules**
- `aider_lint_fixer/pattern_matcher.py` - Smart error classification system
- `aider_lint_fixer/rule_scraper.py` - Web scraping infrastructure
- `aider_lint_fixer/cache_cli.py` - Cache management CLI

#### **πŸ§ͺ Test Suites**
- `tests/test_enhanced_pattern_matching.py` - Pattern matching tests
- `tests/test_new_features.py` - New feature validation
- `tests/test_rule_scraper.py` - Web scraping tests

### πŸ”§ Technical Improvements

#### **πŸ—οΈ Architecture Enhancements**
- **Modular design** with clear separation of concerns
- **Plugin-ready architecture** for new linters
- **Extensible rule system** with web scraping support
- **Robust error handling** throughout the stack

#### **πŸ”’ Reliability Features**
- **Graceful degradation** when web scraping fails
- **Fallback mechanisms** for missing dependencies
- **Comprehensive logging** for debugging
- **Safe file operations** with atomic writes

### πŸ“Š Usage Statistics

#### **🎯 Real-World Performance**
- **89 errors detected** in test project
- **41 fixable errors identified** (46.1% success rate)
- **Multiple complexity levels** handled (trivial to manual)
- **Production-ready** on large codebases

#### **🌍 Multi-Linter Support**
- **ansible-lint**: 68 rules + web-scraped additions
- **ESLint**: 277 web-scraped rules
- **flake8**: 47 web-scraped rules
- **Extensible** for additional linters

### πŸš€ Getting Started

#### **πŸ“¦ Installation**
```bash
# Basic installation
pip install aider-lint-fixer==1.5.0

# With learning features (recommended)
pip install aider-lint-fixer[learning]==1.5.0

🧠 Learning Features Setup

# Check if learning is enabled
aider-lint-fixer --stats

# If learning is disabled, install dependencies
pip install scikit-learn>=1.0.0 requests>=2.25.0 beautifulsoup4>=4.9.0

πŸ” View Learning Statistics

# New integrated stats command
aider-lint-fixer --stats

# JSON output for automation
aider-lint-fixer --stats --output-format json

🧹 Cache Management

# View cache statistics
python -m aider_lint_fixer.cache_cli --action stats

# Clean up old data
python -m aider_lint_fixer.cache_cli --action cleanup --max-age-days 30

πŸš€ Installation

Quick Installation

# One-line installation
curl -fsSL https://raw.githubusercontent.com/tosin2013/aider-lint-fixer/main/scripts/install.sh | bash

# Or manual installation
git clone https://github.com/tosin2013/aider-lint-fixer.git
cd aider-lint-fixer
python3 -m venv venv && source venv/bin/activate
pip3 install -e .

Install Linters

# Python linters
pip3 install flake8==7.3.0 pylint==3.3.7

# Ansible linters
pip3 install ansible-lint==25.6.1

# Node.js linters
npm install -g eslint@8.57.1 jshint@2.13.6 prettier@3.6.2

πŸ“š Documentation

πŸ”§ Supported Versions

Linter Tested Version Supported Versions
ansible-lint 25.6.1 25.6.1, 25.6.x, 25.x
flake8 7.3.0 7.3.0, 7.2.x, 7.1.x, 7.0.x, 6.x
pylint 3.3.7 3.3.7, 3.3.x, 3.2.x, 3.1.x, 3.0.x, 2.x
ESLint 8.57.1 8.57.1, 8.57.x, 8.5.x, 8.x, 7.x
JSHint 2.13.6 2.13.6, 2.13.x, 2.1.x, 2.x
Prettier 3.6.2 3.6.2, 3.6.x, 3.x, 2.x