sbdchd / neoformat

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

Rubocop clash with fish #418

Open alekstheod opened 2 years ago

alekstheod commented 2 years ago

Tried to run rubocop in neovim with a default fish shell Instead of my code got a string.

fish: $/ is not a valid variable in fish. rubocop --auto-correct --stdin "path to my file" 2>/dev/null | sed "1,/^====================$/d"

Proposed fix:

index fcf199d..fb6a245 100644
--- a/autoload/neoformat/formatters/ruby.vim
+++ b/autoload/neoformat/formatters/ruby.vim
@@ -20,7 +20,7 @@ endfunction
 function! neoformat#formatters#ruby#rubocop() abort
      return {
         \ 'exe': 'rubocop',
-        \ 'args': ['--auto-correct', '--stdin', '"%:p"', '2>/dev/null', '|', 'sed "1,/^====================$/d"'],
+        \ 'args': ['--auto-correct', '--stdin', '"%:p"', '2>/dev/null', '|', "sed '1,/^====================$/d'"],
         \ 'stdin': 1,
         \ 'stderr': 1
         \ }