neoformat
neoformat copied to clipboard
path not correctly quoted in arguments passed to rubocop
in https://github.com/sbdchd/neoformat/blob/master/autoload/neoformat/formatters/ruby.vim the formatter args are
{
\ 'exe': 'rubocop',
\ 'args': ['--auto-correct', '--stdin', '%:p', '2>/dev/null', '|', 'sed "1,/^====================$/d"'],
\ 'stdin': 1,
}
However if the absolute path %:p
contains a space, e.g. /Users/derwent/Google Drive/...
then rubocop will fail with the message -s/--stdin requires exactly one path.
and the buffer will be wiped.
The path should be escaped with quotes like this, which works for me.
let g:neoformat_ruby_rubocop = {
\ 'exe': 'rubocop',
\ 'args': [
\ '--auto-correct',
\ '--stdin',
\ '"%:p"',
\ '2>/dev/null',
\ '|',
\ 'sed "1,/^====================$/d"'
\ ],
\ 'replace' : 0,
\ 'stdin': 1,
\ 'no_append': 1,
\ }
This looks like this was resolved by https://github.com/sbdchd/neoformat/commit/5ea3abc08f3f0db3600e9f6f36f096c64bffdc07
Might be OK to close?