Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion autoload/codefmt/ruff.vim
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let s:plugin = maktaba#plugin#Get('codefmt')
function! s:FormatWithArgs(args) abort
let l:executable = s:plugin.Flag('ruff_executable')
let l:lines = getline(1, line('$'))
let l:cmd = [l:executable, 'format'] + a:args
let l:cmd = [l:executable, 'format'] + a:args + ['-']
if !empty(@%)
let l:cmd += ['--stdin-filename=' . @%]
endif
Expand Down
8 changes: 4 additions & 4 deletions vroom/ruff.vroom
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ system.
:silent file somefile.py
% f()
:FormatCode ruff
! ruff format --stdin-filename=somefile.py.*
! ruff format - --stdin-filename=somefile.py.*
$ f()

The name or path of the ruff executable can be configured via the
ruff_executable flag if the default of "ruff" doesn't work.

:Glaive codefmt ruff_executable='/somepath/ruff'
:FormatCode ruff
! /somepath/ruff format.*
! /somepath/ruff format -.*
$ f()
:Glaive codefmt ruff_executable='ruff'

Expand All @@ -40,7 +40,7 @@ You can format any buffer with ruff specifying the formatter explicitly.
% if True: pass

:FormatCode ruff
! ruff format.*
! ruff format -.*
$ if True:
$ pass
if True:
Expand All @@ -55,7 +55,7 @@ It can format specific line ranges of code using :FormatLines.
|else: bar-=1;

:2,3FormatLines ruff
! ruff format .*--range=2:3.*
! ruff format .*--range=2:3 -.*
$ some_tuple=( 1,2, 3,'a' );
$ if bar:
$ bar += 1
Expand Down
Loading