pythonruffvim-ale

How to use ruff as fixer in vim with ALE


I'm using ale in vim, and I want to add ruff as fixer for python.

So, in .vimrc, I added:

let g:ale_fixers = {                                                           
\   'python': ['ruff'],                                                    
\   'javascript': ['eslint'],                                              
\   'typescript': ['eslint', 'tsserver', 'typecheck'],                     
\}       

Then, when executing in vim the command ALEFix, I've go this error:

117: Unknown function: ale#fixers#ruff#Fix

Do you know how to integrate ruff as fixer in vim with ALE ?


Solution

  • https://docs.astral.sh/ruff/editors/setup/#vim , open "With the ALE plugin for Vim or Neovim." The docs shows

    " Linter
    let g:ale_linters = { "python": ["ruff"] }
    " Formatter
    let g:ale_fixers = { "python": ["ruff_format"] }