ruff.vim 629 B

123456789101112131415161718192021
  1. " Vim compiler file
  2. " Compiler: Ruff (Python linter)
  3. " Maintainer: @pbnj-dragon
  4. " Last Change: 2024 Nov 07
  5. " 2024 Nov 19 by the Vim Project (properly escape makeprg setting)
  6. if exists("current_compiler") | finish | endif
  7. let current_compiler = "ruff"
  8. let s:cpo_save = &cpo
  9. set cpo&vim
  10. " CompilerSet makeprg=ruff
  11. let &l:makeprg= 'ruff check --output-format=concise '
  12. \ ..get(b:, 'ruff_makeprg_params', get(g:, 'ruff_makeprg_params', '--preview'))
  13. exe 'CompilerSet makeprg='..escape(&l:makeprg, ' \|"')
  14. CompilerSet errorformat=%f:%l:%c:\ %m,%f:%l:\ %m,%f:%l:%c\ -\ %m,%f:
  15. let &cpo = s:cpo_save
  16. unlet s:cpo_save