Merge pull request #1174 from eborden/eborden/add-brittany-for-haskell-formatting
Add brittany for Haskell formatting
This commit is contained in:
@@ -139,6 +139,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['haskell'],
|
||||
\ 'description': 'Fix Haskell files with hfmt.',
|
||||
\ },
|
||||
\ 'brittany': {
|
||||
\ 'function': 'ale#fixers#brittany#Fix',
|
||||
\ 'suggested_filetypes': ['haskell'],
|
||||
\ 'description': 'Fix Haskell files with brittany.',
|
||||
\ },
|
||||
\ 'refmt': {
|
||||
\ 'function': 'ale#fixers#refmt#Fix',
|
||||
\ 'suggested_filetypes': ['reason'],
|
||||
|
||||
15
autoload/ale/fixers/brittany.vim
Normal file
15
autoload/ale/fixers/brittany.vim
Normal file
@@ -0,0 +1,15 @@
|
||||
" Author: eborden <evan@evan-borden.com>
|
||||
" Description: Integration of brittany with ALE.
|
||||
|
||||
call ale#Set('haskell_brittany_executable', 'brittany')
|
||||
|
||||
function! ale#fixers#brittany#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'haskell_brittany_executable')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user