mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
add: support for rubyfmt as ruby fixer (#4678)
[rubyfmt](https://github.com/fables-tales/rubyfmt) is a formatter for `ruby` code. This commit adds support for `rubyfmt` as a `ruby` fixer (#2991), together with some tests and documentation.
This commit is contained in:
26
test/fixers/test_rubyfmt_fixer_callback.vader
Normal file
26
test/fixers/test_rubyfmt_fixer_callback.vader
Normal file
@@ -0,0 +1,26 @@
|
||||
Before:
|
||||
Save g:ale_ruby_rubyfmt_executable
|
||||
Save g:ale_ruby_rubyfmt_options
|
||||
Save &l:expandtab
|
||||
Save &l:shiftwidth
|
||||
Save &l:tabstop
|
||||
|
||||
After:
|
||||
Restore
|
||||
|
||||
Execute(The rubyfmt callback should return 'rubyfmt' as default command):
|
||||
setlocal noexpandtab
|
||||
Assert
|
||||
\ ale#fixers#rubyfmt#Fix(bufnr('')).command =~# '^' . ale#Escape('rubyfmt'),
|
||||
\ "Default command name is expected to be 'rubyfmt'"
|
||||
|
||||
Execute(The ruby executable and options should be configurable):
|
||||
let g:ale_ruby_rubyfmt_executable = 'foobar'
|
||||
let g:ale_ruby_rubyfmt_options = '--some-option'
|
||||
|
||||
AssertEqual
|
||||
\ {
|
||||
\ 'command': ale#Escape('foobar')
|
||||
\ . ' --some-option',
|
||||
\ },
|
||||
\ ale#fixers#rubyfmt#Fix(bufnr(''))
|
||||
Reference in New Issue
Block a user