@@ -22,7 +22,8 @@ CONTENTS *pymode-contents
2222 2.7 Run code.....................................................| pymode-run |
2323 2.8 Breakpoints..........................................| pymode-breakpoints |
24243. Code checking....................................................| pymode-lint |
25- 3.1 Code checkers options...............................| pymode-lint-options |
25+ 3.1 Ruff-specific configuration...................| pymode-ruff-configuration |
26+ 3.2 Legacy code checker options (mapped to Ruff)..| pymode-lint-options |
26274. Rope support.....................................................| pymode-rope |
2728 4.1 Code completion.......................................| pymode-completion |
2829 4.2 Find definition......................................| pymode-rope-findit |
@@ -43,12 +44,14 @@ Thus some of its functionality may not work as expected. Please be patient and
4344do report bugs or inconsistencies in its documentation. But remember to look
4445for already openned bug reports for the same issue before creating a new one.
4546
46- Python-mode is a vim plugin that allows you to use the pylint, rope, and pydoc
47- libraries in vim to provide features like python code bug checking,
47+ Python-mode is a vim plugin that allows you to use Ruff (a fast Python linter
48+ and formatter), rope (for refactoring and code completion), and other libraries
49+ in vim to provide features like python code bug checking, formatting,
4850refactoring, and some other useful things.
4951
50- This plugin allows you to create python code in vim very easily. There is no
51- need to install the pylint or rope libraries on your system.
52+ This plugin allows you to create python code in vim very easily. You need to
53+ install Ruff on your system (via `pip install ruff`), but rope and other
54+ dependencies are included as submodules.
5255
5356Python-mode contains all you need to develop python applications in Vim.
5457
@@ -63,9 +66,8 @@ Features: *pymode-features
6366- Python folding
6467- Python motions and operators (``]]` `, ``3 [[` `, ``]]M` `, ``vaC` `, ``viM` `,
6568 ``daC` `, ``ciM` `, ...)
66- - Code checking (pylint_, pyflakes_, pylama_, ...) that can be run
67- simultaneously (``:PymodeLint` `)
68- - Autofix PEP8 errors (``:PymodeLintAuto` `)
69+ - Code checking using Ruff (fast Python linter) (``:PymodeLint` `)
70+ - Auto-format code using Ruff (``:PymodeLintAuto` `)
6971- Search in python documentation (``K` `)
7072- Code refactoring <rope refactoring library> (rope_)
7173- Strong code completion (rope_)
@@ -298,20 +300,20 @@ Manually set breakpoint command (leave empty for automatic detection)
2983003. Code checking ~
299301 *pymode-lint*
300302
301- Pymode supports `pylint` , `pep257` , `pycodestyle` , `pyflakes` , `mccabe` code
302- checkers. You could run several similar checkers.
303+ Pymode uses Ruff for code checking and formatting. Ruff is a fast Python linter
304+ and formatter written in Rust that replaces multiple tools (pyflakes, pycodestyle,
305+ mccabe, pylint, pydocstyle, autopep8) with a single, unified tool.
303306
304- Pymode uses Pylama library for code checking. Many options like skip
305- files, errors and etc could be defined in `pylama.ini` file or modelines.
306- Check Pylama documentation for details.
307+ Ruff configuration can be defined in `pyproject.toml` or `ruff.toml` files.
308+ See Ruff documentation for details: https://docs.astral.sh/ruff/
307309
308- Pylint options (ex. disable messages) may be defined in ` $HOME /pylint.rc`
309- See pylint documentation .
310+ For backward compatibility, existing ` g: pymode_lint_ * ` options are mapped
311+ to Ruff rules. See | pymode-ruff-configuration | for Ruff-specific options .
310312
311313Commands:
312- *:PymodeLint* -- Check code in current buffer
314+ *:PymodeLint* -- Check code in current buffer using Ruff
313315*:PymodeLintToggle* -- Toggle code checking
314- *:PymodeLintAuto* -- Fix PEP8 errors in current buffer automatically
316+ *:PymodeLintAuto* -- Format code in current buffer using Ruff
315317
316318Turn on code checking *'g:pymode_lint'*
317319>
@@ -333,11 +335,14 @@ Show error message if cursor placed at the error line *'g:pymode_lint_message'
333335>
334336 let g:pymode_lint_message = 1
335337
336- Default code checkers (you could set several) *'g:pymode_lint_checkers'*
338+ Default code checkers (legacy option, mapped to Ruff rules)
339+ *'g:pymode_lint_checkers'*
337340>
338341 let g:pymode_lint_checkers = ['pyflakes', 'pycodestyle', 'mccabe']
339342
340- Values may be chosen from: `pylint` , `pycodestyle` , `mccabe` , `pep257` , `pyflakes` .
343+ Note: This option is now mapped to Ruff rules. The checker names are used to
344+ determine which Ruff rules to enable. For Ruff-specific configuration, see
345+ | pymode-ruff-configuration | .
341346
342347Skip errors and warnings *'g:pymode_lint_ignore'*
343348E.g. ["W", "E2"] (Skip all Warnings and the Errors starting with E2) etc.
@@ -376,37 +381,72 @@ Definitions for |signs|
376381 let g:pymode_lint_pyflakes_symbol = 'FF'
377382
378383-------------------------------------------------------------------------------
379- 3.1 Set code checkers options ~
384+ 3.1 Ruff-specific configuration ~
385+ *pymode-ruff-configuration*
386+
387+ Pymode provides Ruff-specific configuration options for fine-grained control:
388+
389+ Enable Ruff linting *'g:pymode_ruff_enabled'*
390+ >
391+ let g:pymode_ruff_enabled = 1
392+
393+ Enable Ruff formatting (auto-format) *'g:pymode_ruff_format_enabled'*
394+ >
395+ let g:pymode_ruff_format_enabled = 1
396+
397+ Select specific Ruff rules to enable *'g:pymode_ruff_select'*
398+ Takes precedence over g:pymode_lint_select if set.
399+ >
400+ let g:pymode_ruff_select = []
401+
402+ Ignore specific Ruff rules *'g:pymode_ruff_ignore'*
403+ Takes precedence over g:pymode_lint_ignore if set.
404+ >
405+ let g:pymode_ruff_ignore = []
406+
407+ Path to Ruff configuration file *'g:pymode_ruff_config_file'*
408+ If empty, Ruff will look for pyproject.toml or ruff.toml automatically.
409+ >
410+ let g:pymode_ruff_config_file = ""
411+
412+ For more information about Ruff rules and configuration, see:
413+ https://docs.astral.sh/ruff/rules/
414+
415+ -------------------------------------------------------------------------------
416+ 3.2 Legacy code checker options (mapped to Ruff) ~
380417 *pymode-lint-options*
381418
382- Pymode has the ability to set code checkers options from pymode variables:
419+ The following options are maintained for backward compatibility and are mapped
420+ to Ruff rules:
383421
384- Set PEP8 options *'g:pymode_lint_options_pycodestyle'*
422+ Set PEP8 options (mapped to Ruff E/W rules)
423+ *'g:pymode_lint_options_pycodestyle'*
385424>
386425 let g:pymode_lint_options_pycodestyle =
387426 \ {'max_line_length': g:pymode_options_max_line_length}
388427
389- See https://pep8.readthedocs.org/en/1.4.6/intro.html#configuration for more
390- info.
391-
392- Set Pyflakes options *'g:pymode_lint_options_pyflakes'*
428+ Set Pyflakes options (mapped to Ruff F rules)
429+ *'g:pymode_lint_options_pyflakes'*
393430>
394431 let g:pymode_lint_options_pyflakes = { 'builtins': '_' }
395432
396- Set mccabe options *'g:pymode_lint_options_mccabe'*
433+ Set mccabe options (mapped to Ruff C90 rules)
434+ *'g:pymode_lint_options_mccabe'*
397435>
398436 let g:pymode_lint_options_mccabe = { 'complexity': 12 }
399437
400- Set pep257 options *'g:pymode_lint_options_pep257'*
438+ Set pep257 options (mapped to Ruff D rules)
439+ *'g:pymode_lint_options_pep257'*
401440>
402441 let g:pymode_lint_options_pep257 = {}
403442
404- Set pylint options *'g:pymode_lint_options_pylint'*
443+ Set pylint options (mapped to Ruff PLE/PLR/PLW rules)
444+ *'g:pymode_lint_options_pylint'*
405445>
406446 let g:pymode_lint_options_pylint =
407447 \ {'max-line-length': g:pymode_options_max_line_length}
408448
409- See http://docs.pylint.org/features.html#options for more info .
449+ For mapping details, see RUFF_CONFIGURATION_MAPPING.md in the repository .
410450
411451
412452===============================================================================
@@ -777,7 +817,19 @@ plugin seems broken.
777817
778818
779819
780- 2. Rope completion is very slow *pymode-rope-slow*
820+ 2. Ruff linting or formatting issues *pymode-ruff-issues*
821+
822+ If Ruff is not found, make sure it's installed: `pip install ruff`
823+ You can verify installation with: `ruff --version`
824+
825+ If Ruff reports errors, check your `pyproject.toml` or `ruff.toml` configuration.
826+ For Ruff-specific options, use | pymode-ruff-configuration | instead of legacy
827+ options.
828+
829+ For migration from old linting tools, see RUFF_CONFIGURATION_MAPPING.md in the
830+ repository.
831+
832+ 3. Rope completion is very slow *pymode-rope-slow*
781833-------------------------------
782834
783835Rope creates a project-level service directory in | .ropeproject |
@@ -800,12 +852,16 @@ You may also set |'g:pymode_rope_project_root'| to manually specify the project
800852root path.
801853
802854
803- 3. Pylint check is very slow
804- ----------------------------
855+ 3. Ruff performance and configuration
856+ --------------------------------------
857+
858+ Ruff is significantly faster than the old linting tools (pylint, pyflakes, etc.).
859+ If you experience any issues:
805860
806- In some projects pylint may check slowly, because it also scans imported
807- modules if possible. Try using another code checker: see
808- | 'g:pymode_lint_checkers' | .
861+ - Ensure Ruff is installed: `pip install ruff`
862+ - Check Ruff configuration in `pyproject.toml` or `ruff.toml`
863+ - Use | pymode-ruff-configuration | for Ruff-specific options
864+ - Legacy options are automatically mapped to Ruff rules
809865
810866You may set | exrc | and | secure | in your | vimrc | to auto-set custom settings
811867from `.vimrc` from your projects directories.
0 commit comments