vim-autoformat / vim-autoformat

Provide easy code formatting in Vim by integrating existing code formatters.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

no default buildifier defined for bzl files

gtianyi opened this issue · comments

Could you add the default buildifier for BUILD?

Error detected while processing function <SNR>34_TryAllFormatters:                                                                                                                                                                                                                        
line   35:                                                                                                                                                                                                                                                                                
No format definition found in 'g:formatdef_buildifier'
commented

What are you trying to do?

Thanks @chtenb. Currently, we don't have a default formatdef_buildifier set correctly for BUILD file formatter.
Add let g:formatdef_buildifier="'buildifier'" to the init.vim works, but it would be nicer if we can add the default to the plugin source, so it can work out-of-box.

Maybe we can add something like

if !exists('g:formatdef_buildifier')
    let g:formatdef_buildifier="'buildifier'"
endif

at
https://github.com/vim-autoformat/vim-autoformat/blob/master/plugin/defaults.vim#L88

I can help raise a PR if needed.

commented

Yes, you can open a PR if you think others would benefit.

Thanks! PR up #392