add support for prettier-ruby to prettier fixer (#3593)
it _does_ need an additional plugin, but when it has the plugin, it works as expected.
This commit is contained in:
parent
0b35c3a5b9
commit
1ee7f6c97b
7 changed files with 24 additions and 1 deletions
|
@ -107,7 +107,7 @@ let s:default_registry = {
|
||||||
\ },
|
\ },
|
||||||
\ 'prettier': {
|
\ 'prettier': {
|
||||||
\ 'function': 'ale#fixers#prettier#Fix',
|
\ 'function': 'ale#fixers#prettier#Fix',
|
||||||
\ 'suggested_filetypes': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'json5', 'graphql', 'markdown', 'vue', 'html', 'yaml', 'openapi'],
|
\ 'suggested_filetypes': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'json5', 'graphql', 'markdown', 'vue', 'html', 'yaml', 'openapi', 'ruby'],
|
||||||
\ 'description': 'Apply prettier to a file.',
|
\ 'description': 'Apply prettier to a file.',
|
||||||
\ },
|
\ },
|
||||||
\ 'prettier_eslint': {
|
\ 'prettier_eslint': {
|
||||||
|
|
|
@ -85,6 +85,7 @@ function! ale#fixers#prettier#ApplyFixForVersion(buffer, version) abort
|
||||||
\ 'yaml': 'yaml',
|
\ 'yaml': 'yaml',
|
||||||
\ 'openapi': 'yaml',
|
\ 'openapi': 'yaml',
|
||||||
\ 'html': 'html',
|
\ 'html': 'html',
|
||||||
|
\ 'ruby': 'ruby',
|
||||||
\}
|
\}
|
||||||
|
|
||||||
for l:filetype in l:filetypes
|
for l:filetype in l:filetypes
|
||||||
|
|
|
@ -41,6 +41,11 @@ g:ale_ruby_debride_options *g:ale_ruby_debride_options*
|
||||||
This variable can be changed to modify flags given to debride.
|
This variable can be changed to modify flags given to debride.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
prettier *ale-ruby-prettier*
|
||||||
|
|
||||||
|
See |ale-javascript-prettier| for information about the available options.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
rails_best_practices *ale-ruby-rails_best_practices*
|
rails_best_practices *ale-ruby-rails_best_practices*
|
||||||
|
|
|
@ -431,6 +431,7 @@ Notes:
|
||||||
* Ruby
|
* Ruby
|
||||||
* `brakeman`
|
* `brakeman`
|
||||||
* `debride`
|
* `debride`
|
||||||
|
* `prettier`
|
||||||
* `rails_best_practices`!!
|
* `rails_best_practices`!!
|
||||||
* `reek`
|
* `reek`
|
||||||
* `rubocop`
|
* `rubocop`
|
||||||
|
|
|
@ -2931,6 +2931,7 @@ documented in additional help files.
|
||||||
ruby....................................|ale-ruby-options|
|
ruby....................................|ale-ruby-options|
|
||||||
brakeman..............................|ale-ruby-brakeman|
|
brakeman..............................|ale-ruby-brakeman|
|
||||||
debride...............................|ale-ruby-debride|
|
debride...............................|ale-ruby-debride|
|
||||||
|
prettier..............................|ale-ruby-prettier|
|
||||||
rails_best_practices..................|ale-ruby-rails_best_practices|
|
rails_best_practices..................|ale-ruby-rails_best_practices|
|
||||||
reek..................................|ale-ruby-reek|
|
reek..................................|ale-ruby-reek|
|
||||||
rubocop...............................|ale-ruby-rubocop|
|
rubocop...............................|ale-ruby-rubocop|
|
||||||
|
|
|
@ -440,6 +440,7 @@ formatting.
|
||||||
* Ruby
|
* Ruby
|
||||||
* [brakeman](http://brakemanscanner.org/) :floppy_disk:
|
* [brakeman](http://brakemanscanner.org/) :floppy_disk:
|
||||||
* [debride](https://github.com/seattlerb/debride) :floppy_disk:
|
* [debride](https://github.com/seattlerb/debride) :floppy_disk:
|
||||||
|
* [prettier](https://github.com/prettier/plugin-ruby)
|
||||||
* [rails_best_practices](https://github.com/flyerhzm/rails_best_practices) :floppy_disk:
|
* [rails_best_practices](https://github.com/flyerhzm/rails_best_practices) :floppy_disk:
|
||||||
* [reek](https://github.com/troessner/reek)
|
* [reek](https://github.com/troessner/reek)
|
||||||
* [rubocop](https://github.com/bbatsov/rubocop)
|
* [rubocop](https://github.com/bbatsov/rubocop)
|
||||||
|
|
|
@ -269,6 +269,20 @@ Execute(Should set --parser based on filetype, HTML):
|
||||||
\ . ' --stdin-filepath %s --stdin',
|
\ . ' --stdin-filepath %s --stdin',
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
|
Execute(Should set --parser based on filetype, Ruby):
|
||||||
|
call ale#test#SetFilename('../prettier-test-files/testfile')
|
||||||
|
|
||||||
|
set filetype=ruby
|
||||||
|
|
||||||
|
GivenCommandOutput ['1.6.0']
|
||||||
|
AssertFixer
|
||||||
|
\ {
|
||||||
|
\ 'command': ale#path#CdString(expand('%:p:h'))
|
||||||
|
\ . ale#Escape(g:ale_javascript_prettier_executable)
|
||||||
|
\ . ' --parser ruby'
|
||||||
|
\ . ' --stdin-filepath %s --stdin',
|
||||||
|
\ }
|
||||||
|
|
||||||
Execute(Should set --parser based on first filetype of multiple filetypes):
|
Execute(Should set --parser based on first filetype of multiple filetypes):
|
||||||
call ale#test#SetFilename('../prettier-test-files/testfile')
|
call ale#test#SetFilename('../prettier-test-files/testfile')
|
||||||
|
|
||||||
|
|
Reference in a new issue