]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/ale_linters/ruby/standardrb.vim

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '76265755a1add77121c8f9dabb3e9bb70fe9a972' as '.vim/bundle/ale'
[etc/vim.git] / .vim / bundle / ale / ale_linters / ruby / standardrb.vim
1 " Author: Justin Searls https://github.com/searls, ynonp - https://github.com/ynonp, Eddie Lebow https://github.com/elebow
2 " based on the ale rubocop linter
3 " Description: StandardRB - Ruby Style Guide, with linter & automatic code fixer
4
5 call ale#Set('ruby_standardrb_executable', 'standardrb')
6 call ale#Set('ruby_standardrb_options', '')
7
8 function! ale_linters#ruby#standardrb#GetCommand(buffer) abort
9     let l:executable = ale#Var(a:buffer, 'ruby_standardrb_executable')
10
11     return ale#ruby#EscapeExecutable(l:executable, 'standardrb')
12     \   . ' --format json --force-exclusion '
13     \   . ale#Var(a:buffer, 'ruby_standardrb_options')
14     \   . ' --stdin %s'
15 endfunction
16
17 " standardrb is based on RuboCop so the callback is the same
18 call ale#linter#Define('ruby', {
19 \   'name': 'standardrb',
20 \   'executable': {b -> ale#Var(b, 'ruby_standardrb_executable')},
21 \   'command': function('ale_linters#ruby#standardrb#GetCommand'),
22 \   'callback': 'ale#ruby#HandleRubocopOutput',
23 \})