aboutsummaryrefslogtreecommitdiff
path: root/vim/bundle/syntastic/syntax_checkers/haskell
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2016-06-30 16:03:25 +0200
committerKarel Kočí <cynerd@email.cz>2016-06-30 16:03:25 +0200
commite573b3020c032400eed60b649a2cbf55266e6bb0 (patch)
tree8f572394ac8433529c7a8e70d160a2fbe8268b4e /vim/bundle/syntastic/syntax_checkers/haskell
parentb8c667bd64b3edd38d56c63c5bd1db53a23b4499 (diff)
downloadmyconfigs-e573b3020c032400eed60b649a2cbf55266e6bb0.tar.gz
myconfigs-e573b3020c032400eed60b649a2cbf55266e6bb0.tar.bz2
myconfigs-e573b3020c032400eed60b649a2cbf55266e6bb0.zip
Add current configurations from old repository
Diffstat (limited to 'vim/bundle/syntastic/syntax_checkers/haskell')
-rw-r--r--vim/bundle/syntastic/syntax_checkers/haskell/ghc-mod.vim94
-rw-r--r--vim/bundle/syntastic/syntax_checkers/haskell/hdevtools.vim56
-rw-r--r--vim/bundle/syntastic/syntax_checkers/haskell/hlint.vim41
-rw-r--r--vim/bundle/syntastic/syntax_checkers/haskell/scan.vim43
4 files changed, 234 insertions, 0 deletions
diff --git a/vim/bundle/syntastic/syntax_checkers/haskell/ghc-mod.vim b/vim/bundle/syntastic/syntax_checkers/haskell/ghc-mod.vim
new file mode 100644
index 0000000..928e5b3
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/haskell/ghc-mod.vim
@@ -0,0 +1,94 @@
+"============================================================================
+"File: ghc-mod.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Anthony Carapetis <anthony.carapetis at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_haskell_ghc_mod_checker')
+ finish
+endif
+let g:loaded_syntastic_haskell_ghc_mod_checker = 1
+
+let s:ghc_mod_new = -1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_haskell_ghc_mod_IsAvailable() dict " {{{1
+ if !executable(self.getExec())
+ return 0
+ endif
+
+ " ghc-mod 5.0.0 and later needs the "version" command to print the
+ " version. But the "version" command appeared in 4.1.0. Thus, we need to
+ " know the version in order to know how to find out the version. :)
+
+ " Try "ghc-mod version".
+ let version_output = split(syntastic#util#system(self.getExecEscaped() . ' version'), '\n', 1)
+ let ver = filter(copy(version_output), 'v:val =~# ''\m\sversion''')
+ if !len(ver)
+ " That didn't work. Try "ghc-mod" alone.
+ let version_output = split(syntastic#util#system(self.getExecEscaped()), '\n', 1)
+ let ver = filter(copy(version_output), 'v:val =~# ''\m\sversion''')
+ endif
+ let parsed_ver = len(ver) ? syntastic#util#parseVersion(ver[0]) : []
+
+ if len(parsed_ver)
+ " Encouraged by the great success in finding out the version, now we
+ " need either a Vim that can handle NULs in system() output, or a
+ " ghc-mod that has the "--boundary" option.
+ call self.setVersion(parsed_ver)
+ let s:ghc_mod_new = syntastic#util#versionIsAtLeast(parsed_ver, [2, 1, 2])
+ else
+ call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', version_output)
+ call syntastic#log#error("checker haskell/ghc_mod: can't parse version string (abnormal termination?)")
+ let s:ghc_mod_new = -1
+ endif
+
+ " ghc-mod 5.4.0 wants to run in the root directory of the project;
+ " syntastic can't cope with the resulting complications
+ "
+ " References:
+ " https://hackage.haskell.org/package/ghc-mod-5.4.0.0/changelog
+ let s:ghc_mod_bailout = syntastic#util#versionIsAtLeast(parsed_ver, [5, 4])
+
+ return (s:ghc_mod_new >= 0) && (v:version >= 704 || s:ghc_mod_new) && !s:ghc_mod_bailout
+endfunction " }}}1
+
+function! SyntaxCheckers_haskell_ghc_mod_GetLocList() dict " {{{1
+ let makeprg = self.makeprgBuild({
+ \ 'exe': self.getExecEscaped() . ' check' . (s:ghc_mod_new ? ' --boundary=""' : '') })
+
+ let errorformat =
+ \ '%-G%\s%#,' .
+ \ '%f:%l:%c:%trror: %m,' .
+ \ '%f:%l:%c:%tarning: %m,'.
+ \ '%f:%l:%c: %trror: %m,' .
+ \ '%f:%l:%c: %tarning: %m,' .
+ \ '%f:%l:%c:%m,' .
+ \ '%E%f:%l:%c:,' .
+ \ '%Z%m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'preprocess': 'iconv',
+ \ 'postprocess': ['compressWhitespace'],
+ \ 'returns': [0] })
+endfunction " }}}1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'haskell',
+ \ 'name': 'ghc_mod',
+ \ 'exec': 'ghc-mod' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/haskell/hdevtools.vim b/vim/bundle/syntastic/syntax_checkers/haskell/hdevtools.vim
new file mode 100644
index 0000000..4b0a80f
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/haskell/hdevtools.vim
@@ -0,0 +1,56 @@
+"============================================================================
+"File: hdevtools.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Anthony Carapetis <anthony.carapetis at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_haskell_hdevtools_checker')
+ finish
+endif
+let g:loaded_syntastic_haskell_hdevtools_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_haskell_hdevtools_GetLocList() dict
+ if !exists('g:syntastic_haskell_hdevtools_args') && exists('g:hdevtools_options')
+ call syntastic#log#oneTimeWarn('variable g:hdevtools_options is deprecated, ' .
+ \ 'please use g:syntastic_haskell_hdevtools_args instead')
+ let g:syntastic_haskell_hdevtools_args = g:hdevtools_options
+ endif
+
+ let makeprg = self.makeprgBuild({
+ \ 'exe_after': 'check',
+ \ 'fname': syntastic#util#shexpand('%:p') })
+
+ let errorformat =
+ \ '%-Z %#,'.
+ \ '%W%f:%l:%v: Warning: %m,'.
+ \ '%W%f:%l:%v: Warning:,'.
+ \ '%E%f:%l:%v: %m,'.
+ \ '%E%>%f:%l:%v:,'.
+ \ '%+C %#%m,'.
+ \ '%W%>%f:%l:%v:,'.
+ \ '%+C %#%tarning: %m,'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'vcol': 1},
+ \ 'postprocess': ['compressWhitespace'] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'haskell',
+ \ 'name': 'hdevtools'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/haskell/hlint.vim b/vim/bundle/syntastic/syntax_checkers/haskell/hlint.vim
new file mode 100644
index 0000000..c75ea8b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/haskell/hlint.vim
@@ -0,0 +1,41 @@
+"============================================================================
+"File: hlint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Nicolas Wu <nicolas.wu at gmail dot com>
+"License: BSD
+"============================================================================
+
+if exists('g:loaded_syntastic_haskell_hlint_checker')
+ finish
+endif
+let g:loaded_syntastic_haskell_hlint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_haskell_hlint_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'fname': syntastic#util#shexpand('%:p')})
+
+ let errorformat =
+ \ '%E%f:%l:%v: Error while reading hint file\, %m,' .
+ \ '%E%f:%l:%v: Error: %m,' .
+ \ '%W%f:%l:%v: Warning: %m,' .
+ \ '%W%f:%l:%v: Suggestion: %m,' .
+ \ '%C%m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'vcol': 1},
+ \ 'postprocess': ['compressWhitespace'] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'haskell',
+ \ 'name': 'hlint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/haskell/scan.vim b/vim/bundle/syntastic/syntax_checkers/haskell/scan.vim
new file mode 100644
index 0000000..7cf7e7b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/haskell/scan.vim
@@ -0,0 +1,43 @@
+"============================================================================
+"File: scan.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_haskell_scan_checker')
+ finish
+endif
+let g:loaded_syntastic_haskell_scan_checker = 1
+
+if !exists('g:syntastic_haskell_scan_sort')
+ let g:syntastic_haskell_scan_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_haskell_scan_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat = '%f:%l:%v: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'haskell',
+ \ 'name': 'scan'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker: