Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1691f64
Ruff Migration Plan
diraol Jul 31, 2025
e5db192
Phase 1 Complete! πŸŽ‰
diraol Jul 31, 2025
6052fba
Phase 2 & 3: Complete Ruff migration build updates and configuration
diraol Nov 15, 2025
e735353
Phase 4: Complete dependency evaluation and cleanup
diraol Nov 15, 2025
23f8587
Remove performance benchmarking from migration plan
diraol Nov 15, 2025
c209920
Update Expected Benefits section to note benchmarking not performed
diraol Nov 15, 2025
fe0eb55
Phase 5.1: Complete test suite updates for Ruff
diraol Nov 15, 2025
58733f8
Phase 6.1: Update doc/pymode.txt with Ruff information
diraol Nov 15, 2025
2a7c3a3
Update credits section: Add Ruff, note replacement of old tools
diraol Nov 15, 2025
e46fe8f
Phase 6.1: Create migration guide and update plan
diraol Nov 15, 2025
8547981
Add migration tools for Ruff integration
diraol Nov 17, 2025
fe1e376
Update CHANGELOG.md with Ruff migration breaking changes
diraol Nov 17, 2025
a356d0f
Update migration plan to reflect completed tasks
diraol Nov 17, 2025
8f5b13a
Add multi-platform CI testing support
diraol Nov 17, 2025
e5ba1d8
Update CHANGELOG.md with CI improvements and finalize 0.15.0 entry
diraol Nov 17, 2025
483b375
Clean up removed submodule references
diraol Nov 17, 2025
32b3f65
Update migration plan: mark submodule cleanup as complete
diraol Nov 17, 2025
bf25c5b
Update CHANGELOG.md with submodule cleanup details
diraol Nov 17, 2025
ef74651
Update repository size documentation and add path resolution test
diraol Nov 17, 2025
e1b0baf
Update migration plan: mark repository size and path testing complete
diraol Nov 17, 2025
bf41277
Fix CI failures for macOS and Windows platforms
diraol Nov 17, 2025
d2e4a30
Improve CI test execution robustness for macOS and Windows
diraol Nov 17, 2025
872944f
Add debugging output to CI test execution steps
diraol Nov 17, 2025
340e73e
Fix macOS and Windows CI test failures
diraol Nov 17, 2025
4dc5fa1
Fix macOS script errors with empty arrays and sed
diraol Nov 17, 2025
3a75abd
Fix remaining Windows CI issues: path resolution and /tmp/ mapping
diraol Nov 17, 2025
cb4b109
Fix Windows /tmp/ path interception using BufWriteCmd
diraol Nov 17, 2025
2be1b57
Fix Windows autocmd to only intercept /tmp/ paths
diraol Nov 17, 2025
9843742
Update CHANGELOG and add comprehensive PR description
diraol Nov 17, 2025
7da85fe
Organize documentation
diraol Nov 17, 2025
8645656
Add support for flexible Ruff configuration modes
diraol Dec 23, 2025
6f16321
Enhance Ruff integration tests for improved error handling and direct…
diraol Dec 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
175 changes: 171 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:
- cron: '0 0 * * 0' # Weekly run

jobs:
test:
test-linux:
name: Test on Linux (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -27,20 +28,185 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install Ruff
run: |
pip install ruff

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y vim-nox git

- name: Run Vader test suite
run: |
pwd
ls -la scripts/cicd/
which bash
bash --version
bash scripts/cicd/run_vader_tests_direct.sh

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.python-version }}
name: test-results-linux-${{ matrix.python-version }}
path: |
test-results.json
test-logs/
results/

- name: Upload coverage reports
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: linux-python-${{ matrix.python-version }}

test-macos:
name: Test on macOS (Python ${{ matrix.python-version }})
runs-on: macos-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
fail-fast: false

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Ruff
run: |
pip install ruff

- name: Install Vim and coreutils
run: |
brew install vim coreutils
# Ensure brew's bin directory is in PATH
echo "$(brew --prefix)/bin" >> $GITHUB_PATH
# Verify vim is available
which vim
vim --version
# Verify timeout is available (from coreutils)
# On macOS, coreutils installs commands with 'g' prefix, but PATH should have both
which timeout || which gtimeout || echo "Warning: timeout command not found"
# Test timeout command
timeout --version || gtimeout --version || echo "Warning: timeout not working"

- name: Run Vader test suite
run: |
pwd
ls -la scripts/cicd/
which bash
bash --version
bash scripts/cicd/run_vader_tests_direct.sh

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-macos-${{ matrix.python-version }}
path: |
test-results.json
test-logs/
results/

- name: Upload coverage reports
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: macos-python-${{ matrix.python-version }}

test-windows:
name: Test on Windows (Python ${{ matrix.python-version }})
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
fail-fast: false

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Ruff
run: |
pip install ruff

- name: Install Vim
shell: pwsh
run: |
# Install Vim using Chocolatey (available on GitHub Actions Windows runners)
choco install vim -y
# Refresh PATH to make vim available
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
# Also add common Vim installation paths
$env:Path += ";C:\Program Files (x86)\Vim\vim91\bin;C:\Program Files\Vim\vim91\bin;C:\tools\vim\vim91\bin"
# Add to GITHUB_PATH for subsequent steps
$vimPaths = @(
"C:\Program Files (x86)\Vim\vim91\bin",
"C:\Program Files\Vim\vim91\bin",
"C:\tools\vim\vim91\bin"
)
foreach ($path in $vimPaths) {
if (Test-Path $path) {
echo "$path" >> $env:GITHUB_PATH
Write-Host "Added to GITHUB_PATH: $path"
}
}
# Verify vim is available
$vimPath = (Get-Command vim -ErrorAction SilentlyContinue).Source
if ($vimPath) {
Write-Host "Vim found at: $vimPath"
& $vimPath --version
} else {
Write-Host "Vim not in PATH, trying to find it..."
$possiblePaths = @(
"C:\Program Files (x86)\Vim\vim91\vim.exe",
"C:\Program Files\Vim\vim91\vim.exe",
"C:\tools\vim\vim91\vim.exe"
)
$found = $false
foreach ($path in $possiblePaths) {
if (Test-Path $path) {
Write-Host "Found Vim at: $path"
& $path --version
$found = $true
break
}
}
if (-not $found) {
Write-Host "ERROR: Could not find Vim installation"
exit 1
}
}

- name: Run Vader test suite
shell: pwsh
run: |
Get-Location
Get-ChildItem scripts\cicd\
Get-Command pwsh | Select-Object -ExpandProperty Source
pwsh --version
pwsh scripts/cicd/run_vader_tests_windows.ps1

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-windows-${{ matrix.python-version }}
path: |
test-results.json
test-logs/
Expand All @@ -50,11 +216,12 @@ jobs:
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: python-${{ matrix.python-version }}
flags: windows-python-${{ matrix.python-version }}

summary:
name: Generate Test Summary
runs-on: ubuntu-latest
needs: test
needs: [test-linux, test-macos, test-windows]
if: github.event_name == 'pull_request'

steps:
Expand Down
49 changes: 0 additions & 49 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,59 +1,10 @@
[submodule "submodules/autopep8"]
path = submodules/autopep8
url = https://github.com/hhatto/autopep8
ignore = dirty
shallow = true
[submodule "submodules/pycodestyle"]
path = submodules/pycodestyle
url = https://github.com/PyCQA/pycodestyle
ignore = dirty
shallow = true
[submodule "submodules/pydocstyle"]
path = submodules/pydocstyle
url = https://github.com/PyCQA/pydocstyle
ignore = dirty
shallow = true
[submodule "submodules/mccabe"]
path = submodules/mccabe
url = https://github.com/PyCQA/mccabe
ignore = dirty
shallow = true
[submodule "submodules/pyflakes"]
path = submodules/pyflakes
url = https://github.com/PyCQA/pyflakes
ignore = dirty
shallow = true
[submodule "submodules/snowball_py"]
path = submodules/snowball_py
url = https://github.com/diraol/snowball_py
ignore = dirty
branch = develop
shallow = true
[submodule "submodules/pylint"]
path = submodules/pylint
url = https://github.com/PyCQA/pylint
shallow = true
[submodule "submodules/rope"]
path = submodules/rope
url = https://github.com/python-rope/rope
shallow = true
[submodule "submodules/astroid"]
path = submodules/astroid
url = https://github.com/PyCQA/astroid
shallow = true
[submodule "submodules/pylama"]
path = submodules/pylama
url = https://github.com/klen/pylama
shallow = true
[submodule "submodules/toml"]
path = submodules/toml
url = https://github.com/uiri/toml.git
[submodule "submodules/pytoolconfig"]
path = submodules/pytoolconfig
url = https://github.com/bagel897/pytoolconfig.git
[submodule "submodules/tomli"]
path = submodules/tomli
url = https://github.com/hukkin/tomli.git
[submodule "submodules/appdirs"]
path = submodules/appdirs
url = https://github.com/ActiveState/appdirs.git
114 changes: 113 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,118 @@
# Changelog

## TODO
## [Unreleased] 0.15.0

### BREAKING CHANGES: Ruff Migration

This release replaces the old linting infrastructure with Ruff, a modern, fast Python linter and formatter written in Rust.

#### Removed Linting Tools

The following linting tools are **no longer available** as submodules or separate checkers:
- **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 (was a wrapper)
- **autopep8** - Replaced by Ruff format

**Migration:** Your existing `g:pymode_lint_checkers` configuration is automatically mapped to Ruff rules. No immediate action required, but see migration guide below.

#### New Requirements

- **Ruff must be installed:** `pip install ruff`
- Ruff is now an external dependency (not bundled as a submodule)

#### Configuration Changes

- `g:pymode_lint_checkers` values are now mapped to Ruff rule categories (not actual tools)
- Old tool-specific options (`g:pymode_lint_options_*`) are mapped to Ruff configuration
- New Ruff-specific options available:
- `g:pymode_ruff_enabled` - Enable/disable Ruff linting
- `g:pymode_ruff_format_enabled` - Enable/disable Ruff formatting
- `g:pymode_ruff_select` - Select specific Ruff rules
- `g:pymode_ruff_ignore` - Ignore specific Ruff rules
- `g:pymode_ruff_config_file` - Specify Ruff config file path

#### Behavior Changes

- **Formatting:** `:PymodeLintAuto` now uses Ruff format instead of autopep8 (faster, PEP 8 compliant)
- **Linting:** Ruff may report different errors than pylint/pyflakes (usually fewer false positives)
- **Performance:** Significantly faster linting (10-100x improvement expected)

#### Submodule Changes

**Removed submodules:**
- `submodules/pyflakes`
- `submodules/pycodestyle`
- `submodules/mccabe`
- `submodules/pylint`
- `submodules/pydocstyle`
- `submodules/pylama`
- `submodules/autopep8`
- `submodules/snowball_py` (was only used by pydocstyle)
- `submodules/appdirs` (not used in pymode code)
- `submodules/astroid` (was only needed for pylint)
- `submodules/toml` (not used; Ruff handles its own TOML parsing)

**Remaining submodules (3 total, down from 13):**
- `submodules/rope` - Refactoring and code intelligence (essential)
- `submodules/tomli` - TOML parsing (required by pytoolconfig)
- `submodules/pytoolconfig` - Tool configuration (required by rope)

**Repository cleanup:**
- Removed git index entries for all removed submodules
- Cleaned up `.git/modules` references (freed ~90MB+ of repository space)
- Physical directories removed from working tree

#### Migration Resources

- **Migration Guide:** See `doc/MIGRATION_GUIDE.md` for step-by-step instructions
- **Configuration Mapping:** See `doc/RUFF_CONFIGURATION_MAPPING.md` for detailed rule mappings
- **Migration Script:** Use `scripts/migrate_to_ruff.py` to convert your vimrc configuration
- **Validation Script:** Use `scripts/validate_ruff_migration.sh` to verify your setup

#### Rollback Instructions

If you need to rollback to the old system:
1. Checkout previous version: `git checkout v0.14.0`
2. Install old dependencies: `pip install pylint pyflakes pycodestyle mccabe pydocstyle autopep8`
3. Restore old configuration in your `.vimrc`

**Note:** The old tools are no longer maintained as submodules. You'll need to install them separately if rolling back.

### Improvements

- **Performance:** Significantly faster linting and formatting with Ruff
- **Maintenance:** Reduced from 13 submodules to 3, simplifying dependency management
- **Modern tooling:** Using Ruff, a actively maintained, modern Python linter
- **Unified configuration:** Single tool configuration instead of multiple tool configs
- **Better error messages:** Ruff provides clearer, more actionable error messages

### Documentation

- Added comprehensive migration guide (`doc/MIGRATION_GUIDE.md`)
- Added Ruff configuration mapping documentation (`doc/RUFF_CONFIGURATION_MAPPING.md`)
- Updated `doc/pymode.txt` with Ruff configuration options
- Added migration tools (`scripts/migrate_to_ruff.py`, `scripts/validate_ruff_migration.sh`)

### Testing

- Added comprehensive Ruff integration tests (`tests/vader/ruff_integration.vader`)
- All existing tests continue to pass
- Verified compatibility with Python 3.10-3.13
- Verified Docker environment compatibility
- **Multi-platform CI testing:** Added support for testing on Linux, macOS, and Windows
- Windows PowerShell test script (`scripts/cicd/run_vader_tests_windows.ps1`)
- Updated GitHub Actions workflow for cross-platform testing
- Tests run on all platforms with Python 3.10, 3.11, 3.12, and 3.13
- Platform-specific test result aggregation in PR summaries
- **Platform-specific fixes:**
- macOS: Fixed `mapfile` compatibility (bash 3.x/zsh), empty array handling, sed errors
- Windows: Fixed path resolution across drive letters, `/tmp/` path redirection to `$TEMP`
- Added robust error handling and timeout support across all platforms
- Improved Vim detection and PATH configuration for Windows

## 2023-07-02 0.14.0

Expand Down
Loading