sbdchd / neoformat

:sparkles: A (Neo)vim plugin for formatting code.
BSD 2-Clause "Simplified" License
1.97k stars 188 forks source link

Add ruff formatter for Python #483

Closed nikosavola closed 8 months ago

nikosavola commented 8 months ago

Ruff now supports a formatter that can be used as a replacement for black. It could be added to https://github.com/sbdchd/neoformat/blob/master/autoload/neoformat/formatters/python.vim

airreality commented 8 months ago

Created PR here https://github.com/sbdchd/neoformat/pull/484

airreality commented 8 months ago

For now you can extend vim config with:

let g:neoformat_python_ruff = {
     \ 'exe': 'ruff',
     \ 'stdin': 1,
     \ 'args': ['format', '-q', '-'],
     \ }
let g:neoformat_enabled_python = ['ruff']
airreality commented 8 months ago

@nikosavola PR is merged, so I suppose the issue can be closed