aboutsummaryrefslogtreecommitdiff
path: root/.vim/autoload/neomake/makers/ft/elixir.vim
diff options
context:
space:
mode:
authorYaroslav <contact@yaroslavps.com>2019-09-05 19:35:38 +0300
committerYaroslav <contact@yaroslavps.com>2019-09-05 19:35:38 +0300
commit212dcd0bf753f08c0127a26a71b673c734b45c02 (patch)
tree4a43e43c7c9b9ccfcaef4088ba9e5f52154994b5 /.vim/autoload/neomake/makers/ft/elixir.vim
downloadvimrice-212dcd0bf753f08c0127a26a71b673c734b45c02.tar.gz
vimrice-212dcd0bf753f08c0127a26a71b673c734b45c02.zip
init commit, extracted vim config from i3rice
Diffstat (limited to '.vim/autoload/neomake/makers/ft/elixir.vim')
-rw-r--r--.vim/autoload/neomake/makers/ft/elixir.vim72
1 files changed, 72 insertions, 0 deletions
diff --git a/.vim/autoload/neomake/makers/ft/elixir.vim b/.vim/autoload/neomake/makers/ft/elixir.vim
new file mode 100644
index 0000000..4de652e
--- /dev/null
+++ b/.vim/autoload/neomake/makers/ft/elixir.vim
@@ -0,0 +1,72 @@
+" vim: ts=4 sw=4 et
+
+" Credo error types.
+" F -> Refactoring opportunities
+" W -> Warnings
+" C -> Convention violation
+" D -> Software design suggestions
+" R -> Readability suggestions
+" Map structure {CredoError: NeomakeType, ...}
+let s:neomake_elixir_credo_config_typemap = {
+ \ 'F': 'W',
+ \ 'C': 'W',
+ \ 'D': 'I',
+ \ 'R': 'I'}
+
+function! neomake#makers#ft#elixir#PostprocessEnforceMaxBufferLine(entry) abort
+ let buffer_lines = str2nr(line('$'))
+ if (buffer_lines < a:entry.lnum)
+ let a:entry.lnum = buffer_lines
+ endif
+endfunction
+
+function! neomake#makers#ft#elixir#PostprocessCredo(entry) abort
+ let type = toupper(a:entry.type)
+ let type_map = extend(s:neomake_elixir_credo_config_typemap,
+ \ get(g:, 'neomake_elixir_credo_config_typemap', {}))
+ if has_key(type_map, type)
+ let a:entry.type = type_map[type]
+ endif
+endfunction
+
+function! neomake#makers#ft#elixir#EnabledMakers() abort
+ return ['mix']
+endfunction
+
+function! neomake#makers#ft#elixir#elixir() abort
+ return {
+ \ 'errorformat':
+ \ '%E** %s %f:%l: %m,'.
+ \ '%W%f:%l: warning: %m'
+ \ }
+endfunction
+
+function! neomake#makers#ft#elixir#credo() abort
+ return {
+ \ 'exe': 'mix',
+ \ 'args': ['credo', 'list', '--format=oneline'],
+ \ 'postprocess': function('neomake#makers#ft#elixir#PostprocessCredo'),
+ \ 'errorformat':
+ \'[%t] %. %f:%l:%c %m,' .
+ \'[%t] %. %f:%l %m'
+ \ }
+endfunction
+
+function! neomake#makers#ft#elixir#mix() abort
+ return {
+ \ 'exe' : 'mix',
+ \ 'args': ['compile', '--warnings-as-errors'],
+ \ 'postprocess': function('neomake#makers#ft#elixir#PostprocessEnforceMaxBufferLine'),
+ \ 'errorformat':
+ \ '** %s %f:%l: %m,'.
+ \ '%Ewarning: %m,%C %f:%l,%Z'
+ \ }
+endfunction
+
+function! neomake#makers#ft#elixir#dogma() abort
+ return {
+ \ 'exe': 'mix',
+ \ 'args': ['dogma', '--format=flycheck'],
+ \ 'errorformat': '%E%f:%l:%c: %.: %m'
+ \ }
+endfunction