summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2017-12-07 19:15:33 +0000
committerGitHub <noreply@github.com>2017-12-07 19:15:33 +0000
commit7a71186d62d1964e191dc723d8b65ab7786e0063 (patch)
tree5fe52e583145a16e5a88fd93ba333636516352a3 /autoload
parentc6fc9cdb7b31823cafc1e86dc4555a595abc9aee (diff)
parentfbc8ac95539b6b1672e824a2df0422fdeb32f5c6 (diff)
downloadale-7a71186d62d1964e191dc723d8b65ab7786e0063.zip
Merge pull request #1174 from eborden/eborden/add-brittany-for-haskell-formatting
Add brittany for Haskell formatting
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/fix/registry.vim5
-rw-r--r--autoload/ale/fixers/brittany.vim15
2 files changed, 20 insertions, 0 deletions
diff --git a/autoload/ale/fix/registry.vim b/autoload/ale/fix/registry.vim
index 5c09e785..b4e18c47 100644
--- a/autoload/ale/fix/registry.vim
+++ b/autoload/ale/fix/registry.vim
@@ -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'],
diff --git a/autoload/ale/fixers/brittany.vim b/autoload/ale/fixers/brittany.vim
new file mode 100644
index 00000000..fed5eb8b
--- /dev/null
+++ b/autoload/ale/fixers/brittany.vim
@@ -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
+