Title: Implement RUFF to replace many of the dependencies by diraol · Pull Request #1192 · python-mode/python-mode · GitHub
Open Graph Title: Implement RUFF to replace many of the dependencies by diraol · Pull Request #1192 · python-mode/python-mode
X Title: Implement RUFF to replace many of the dependencies by diraol · Pull Request #1192 · python-mode/python-mode
Description: Implement Ruff to Replace Legacy Linting Infrastructure 🎯 Overview This PR implements a comprehensive migration from legacy linting tools (pylint, pyflakes, pycodestyle, mccabe, pydocstyle, pylama, autopep8) to Ruff, a modern, fast Python linter and formatter written in Rust. This change significantly improves performance, reduces maintenance burden, and provides a more unified linting experience. 📊 Key Metrics Submodules reduced: 13 → 3 (77% reduction) Repository size freed: ~90MB+ from .git/modules cleanup Performance improvement: 10-100x faster linting (Ruff vs legacy tools) Test coverage: 9/9 Vader test suites passing on Linux, macOS, and Windows Python support: 3.10, 3.11, 3.12, 3.13 on all platforms 🔄 Breaking Changes Removed Tools The following linting tools are no longer available as submodules: pylint → Replaced by Ruff PLE/PLR/PLW rules pyflakes → Replaced by Ruff F rules pycodestyle → Replaced by Ruff E/W rules mccabe → Replaced by Ruff C90 rules pydocstyle → Replaced by Ruff D rules pylama → No longer needed (wrapper) autopep8 → Replaced by Ruff format New Requirement Ruff must be installed: pip install ruff Ruff is now an external dependency (not bundled as submodule) Configuration Changes g:pymode_lint_checkers values are automatically mapped to Ruff rule categories Old tool-specific options mapped to Ruff configuration New Ruff-specific options available: g:pymode_ruff_enabled g:pymode_ruff_format_enabled g:pymode_ruff_select g:pymode_ruff_ignore g:pymode_ruff_config_file 🚀 New Features Multi-Platform CI Testing Linux: Ubuntu with Python 3.10-3.13 macOS: Latest with Python 3.10-3.13 Windows: Latest with Python 3.10-3.13 Parallel test execution across all platforms Comprehensive platform-specific fixes for compatibility Migration Tools Migration Guide (MIGRATION_GUIDE.md) - Step-by-step instructions Configuration Mapping (RUFF_CONFIGURATION_MAPPING.md) - Detailed rule mappings Migration Script (scripts/migrate_to_ruff.py) - Automatic vimrc conversion Validation Script (scripts/validate_ruff_migration.sh) - Setup verification CI/CD Improvements Cross-platform testing with dedicated scripts for each OS Robust error handling and timeout support Platform-specific PATH and environment configuration Comprehensive test result aggregation 📝 Technical Implementation Phase 1: Core Ruff Integration Implemented pymode/ruff_integration.py with Ruff check/format functions Created configuration mapping system for backward compatibility Updated pymode/lint.py to use Ruff instead of pylama Phase 2: Build & Distribution Updates Updated submodule initialization in pymode/utils.py Removed old linter dependencies from build scripts Cleaned up Docker and CI configuration Phase 3: Configuration Migration Mapped legacy configuration options to Ruff equivalents Maintained backward compatibility where possible Added validation and warning system for deprecated options Phase 4: Dependency Cleanup Removed 10 submodules (pyflakes, pycodestyle, mccabe, pylint, pydocstyle, pylama, autopep8, snowball_py, appdirs, astroid, toml) Kept 3 essential submodules (rope, tomli, pytoolconfig) Cleaned up git repository (~90MB+ freed) Phase 5: Testing & Validation Updated all test fixtures for Ruff Created comprehensive Ruff integration tests Verified all 9/9 Vader test suites pass Added multi-platform CI testing Phase 6: Documentation & Migration Created comprehensive migration guide Documented configuration mappings Added migration and validation scripts Updated all documentation with Ruff information 🔧 Platform-Specific Fixes macOS Fixed mapfile compatibility (bash 3.x/zsh don't support bash 4+ mapfile) Fixed empty array handling with set -u (unbound variable errors) Fixed sed "first RE may not be empty" errors with proper string formatting Added timeout fallback (timeout/gtimeout/none) for different environments Added --not-a-term flag detection for Vim compatibility Windows Fixed os.path.relpath ValueError when paths on different drives (C: vs D:) Implemented /tmp/ path redirection to Windows $TEMP directory Added BufWriteCmd/FileWriteCmd autocmds for path interception Improved Vim installation detection and PATH configuration Enhanced PowerShell error handling and output capture Added nobackup/nowritebackup Vim settings to prevent backup file errors Linux Maintained existing functionality Added enhanced error reporting Improved test output formatting 📚 Documentation New Files MIGRATION_GUIDE.md - User migration guide RUFF_CONFIGURATION_MAPPING.md - Configuration reference CI_IMPROVEMENTS.md - CI/CD documentation scripts/migrate_to_ruff.py - Migration tool scripts/validate_ruff_migration.sh - Validation tool scripts/test_path_resolution.py - Path testing tool Updated Files readme.md - Updated with Ruff information and reduced submodule count doc/pymode.txt - Added Ruff configuration options CHANGELOG.md - Comprehensive 0.15.0 release notes 🧪 Test Results All tests pass on all platforms: ✅ Linux (Python 3.10, 3.11, 3.12, 3.13) ✅ macOS (Python 3.10, 3.11, 3.12, 3.13) ✅ Windows (Python 3.10, 3.11, 3.12, 3.13) Test suites (9/9 passing): autopep8 (8/8 assertions) commands (7/7 assertions) folding (7/7 assertions) lint (8/8 assertions) motion (6/6 assertions) rope (9/9 assertions) ruff_integration (9/9 assertions) simple (4/4 assertions) textobjects (9/9 assertions) Total: 88/88 assertions passing 🔄 Migration Path For users upgrading to 0.15.0: Install Ruff: pip install ruff Review changes: Check MIGRATION_GUIDE.md Optional: Run scripts/migrate_to_ruff.py to convert vimrc Validate: Run scripts/validate_ruff_migration.sh Test: Try :PymodeLint and :PymodeLintAuto Rollback If needed, users can rollback: git checkout v0.14.0 pip install pylint pyflakes pycodestyle mccabe pydocstyle autopep8 🎉 Benefits Performance: 10-100x faster linting Simplicity: One tool instead of seven Maintenance: 77% fewer submodules Modern: Actively maintained, Rust-based Quality: Fewer false positives, better error messages Cross-platform: Tested and verified on Linux, macOS, Windows 📋 Checklist Phase 1: Core Ruff integration Phase 2: Build & distribution updates Phase 3: Configuration migration Phase 4: Dependency cleanup (10 submodules removed) Phase 5: Testing & validation Phase 6: Documentation & migration tools Multi-platform CI testing (Linux, macOS, Windows) Platform-specific fixes and compatibility All tests passing (88/88 assertions) Documentation complete Migration tools created 🔗 Related Issues This PR addresses the need to modernize the linting infrastructure and reduce maintenance burden by consolidating multiple legacy tools into a single, modern solution. Note: This is a major version bump (0.15.0) due to breaking changes in linting tool availability and configuration options. Users should review the migration guide before upgrading.
Open Graph Description: Implement Ruff to Replace Legacy Linting Infrastructure 🎯 Overview This PR implements a comprehensive migration from legacy linting tools (pylint, pyflakes, pycodestyle, mccabe, pydocstyle, pylama,...
X Description: Implement Ruff to Replace Legacy Linting Infrastructure 🎯 Overview This PR implements a comprehensive migration from legacy linting tools (pylint, pyflakes, pycodestyle, mccabe, pydocstyle, pylama,...
Opengraph URL: https://github.com/python-mode/python-mode/pull/1192
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:57ed86ef-e2fa-0d72-4099-90a19a415955 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | C23C:2B11DB:FDFEB6:15BB22D:69694007 |
| html-safe-nonce | 947cf6f857663eb12d28db792fee9d814d44c2593d44d884500ddeab37fe0f36 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjNDOjJCMTFEQjpGREZFQjY6MTVCQjIyRDo2OTY5NDAwNyIsInZpc2l0b3JfaWQiOiIxMjU5NTY1NTIyODYwMTk1ODQ3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 14702180e0f268c09b0f47d9aceea45417be6771f0d82b276d241d499b9fb974 |
| hovercard-subject-tag | pull_request:3017576293 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python-mode/python-mode/pull/1192/checks |
| twitter:image | https://avatars.githubusercontent.com/u/192702?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/192702?s=400&v=4 |
| og:image:alt | Implement Ruff to Replace Legacy Linting Infrastructure 🎯 Overview This PR implements a comprehensive migration from legacy linting tools (pylint, pyflakes, pycodestyle, mccabe, pydocstyle, pylama,... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d |
| turbo-cache-control | no-preview |
| go-import | github.com/python-mode/python-mode git https://github.com/python-mode/python-mode.git |
| octolytics-dimension-user_id | 13965098 |
| octolytics-dimension-user_login | python-mode |
| octolytics-dimension-repository_id | 2408911 |
| octolytics-dimension-repository_nwo | python-mode/python-mode |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 2408911 |
| octolytics-dimension-repository_network_root_nwo | python-mode/python-mode |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d69ac0477df0f87da03b8b06cebd187012d7a930 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width