You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Introduced `g:pymode_ruff_config_mode` to control how Ruff configuration is resolved.
- Added three modes:
- `"local"`: Uses only local project config files, ignoring pymode settings.
- `"local_override"`: Local config takes priority, falling back to pymode settings if none exist (default).
- `"global"`: Uses only pymode settings, ignoring local configs.
- Updated documentation to reflect new configuration options and their usage.
- Enhanced tests to verify behavior across different configuration modes.
Copy file name to clipboardExpand all lines: doc/RUFF_CONFIGURATION_MAPPING.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,6 +116,30 @@ let g:pymode_ruff_config_file = '/path/to/pyproject.toml'
116
116
" Use specific Ruff configuration file
117
117
```
118
118
119
+
#### `g:pymode_ruff_config_mode`
120
+
**Default:**`"local_override"`
121
+
122
+
Controls how Ruff configuration is resolved. This option determines whether local project configuration files (`ruff.toml`, `pyproject.toml`) or python-mode settings take precedence.
123
+
124
+
**Modes:**
125
+
-`"local"`: Use only the project's local Ruff config. Python-mode settings are ignored. Ruff will auto-discover configuration files in the project hierarchy.
126
+
-`"local_override"`: Local config takes priority. If a local Ruff config file exists, it will be used. If no local config exists, python-mode settings serve as fallback.
127
+
-`"global"`: Use only python-mode settings. Local config files are ignored (uses `--isolated` flag). This restores the previous behavior where python-mode settings always override local configs.
128
+
129
+
**Example:**
130
+
```vim
131
+
" Respect project's local Ruff config (recommended for team projects)
132
+
let g:pymode_ruff_config_mode = "local"
133
+
134
+
" Use local config if available, otherwise use pymode defaults (default)
135
+
let g:pymode_ruff_config_mode = "local_override"
136
+
137
+
" Always use pymode settings, ignore project configs
138
+
let g:pymode_ruff_config_mode = "global"
139
+
```
140
+
141
+
**Note:** The default `"local_override"` mode provides the best user experience by respecting project-specific configurations while providing sensible defaults when no local config exists.
0 commit comments