🚀 aider-lint-fixer v1.4.0
🚀 Enhanced Ansible Support - Production Ready
This release dramatically improves Ansible project support with intelligent Jinja2 template syntax error detection and fixing, achieving 100% success rates on real-world Ansible roles.
✨ New Features
Enhanced Ansible Error Analysis 🔧
- Intelligent Jinja2 Template Fixing: Automatically detects and fixes common Jinja2 template syntax errors
- Smart Error Categorization: Distinguishes between simple syntax fixes (quotes) and complex template logic
- Production Profile Support: Full support for ansible-lint production profiles with comprehensive rule sets
- Template Quote Fixing: Automatically fixes missing quotes in
default()filters and template strings
Improved Error Detection Logic 🎯
- Context-Aware Syntax Analysis: Enhanced logic for determining fixable vs manual-only syntax errors
- Ansible-Specific Rules: Specialized handling for ansible-lint error patterns and rule categories
- YAML Structure Support: Better detection of YAML key duplicates and structural issues
🐛 Bug Fixes
Error Analyzer Improvements
- Fixed: Jinja2 template syntax errors incorrectly classified as "manual-only"
- Fixed: Simple quote syntax errors now properly categorized as "simple" complexity
- Fixed: Ansible syntax errors correctly identified as fixable when appropriate
- Enhanced: Environment variable loading for API keys in different execution contexts
📊 Performance & Validation
Real-World Testing Results
- kvmhost_setup role: 5/5 errors fixed (100% success rate)
- kvmhost_networking role: 1/1 errors fixed (100% success rate)
- Production validation: Tested against real Ansible collections and roles
Error Types Successfully Fixed
- ✅ Missing quotes in Jinja2
default()filters:default('N/A)→default('N/A') - ✅ Template syntax errors with malformed quotes:
default('not defined)→default('not defined') - ✅ Complex multi-line template strings with quote issues
- ✅ Variable interpolation syntax problems
🔧 Technical Improvements
Enhanced Error Analyzer Logic
# New intelligent Jinja2 template error detection
if error.linter == "ansible-lint" and "jinja[invalid]" in rule_id:
if ("expected token ','" in message and
("got 'n'" in message or "got 'not'" in message)):
return FixComplexity.SIMPLEImproved Fixability Assessment
- Smart Syntax Error Handling: Special cases for Jinja2 template syntax vs general syntax errors
- YAML Key Duplicate Detection: Enhanced support for YAML structure validation
- Context-Aware Complexity: Better assessment of fix difficulty based on error context
🚀 Usage Examples
# Fix Ansible role with production profile
python -m aider_lint_fixer roles/my-role --ansible-profile production --linters ansible-lint
# Fix entire Ansible collection
python -m aider_lint_fixer . --linters ansible-lint --max-files 10
# Environment setup (recommended)
source venv/bin/activate
export $(cat .env | grep -v '^#' | xargs)
python -m aider_lint_fixer your-ansible-project/🚀 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 |