aboutsummaryrefslogtreecommitdiff
path: root/.vim/autoload/neomake/makers/ft/objc.vim
blob: 5b093f436c3ed6d10838fd404ad79b06e8f2a542 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
" vim: ts=4 sw=4 et

function! neomake#makers#ft#objc#EnabledMakers() abort
    let makers = ['clang', 'clangtidy', 'clangcheck']
    return makers
endfunction

function! neomake#makers#ft#objc#clang() abort
    " We will enable ARC and disable warnings about unused parameters because
    " it is quite common in Cocoa not to use every method parameter.
    return {
        \ 'args': ['-fsyntax-only', '-fobjc-arc', '-Wall', '-Wextra', '-Wno-unused-parameter'],
        \ 'errorformat':
            \ '%-G%f:%s:,' .
            \ '%f:%l:%c: %trror: %m,' .
            \ '%f:%l:%c: %tarning: %m,' .
            \ '%I%f:%l:%c: note: %m,' .
            \ '%f:%l:%c: %m,'.
            \ '%f:%l: %trror: %m,'.
            \ '%f:%l: %tarning: %m,'.
            \ '%I%f:%l: note: %m,'.
            \ '%f:%l: %m'
        \ }
endfunction

" The -p option followed by the path to the build directory should be set in
" the maker's arguments. That directory should contain the compile command
" database (compile_commands.json).
function! neomake#makers#ft#objc#clangtidy() abort
    return {
        \ 'exe': 'clang-tidy',
        \ 'errorformat':
            \ '%E%f:%l:%c: fatal error: %m,' .
            \ '%E%f:%l:%c: error: %m,' .
            \ '%W%f:%l:%c: warning: %m,' .
            \ '%-G%\m%\%%(LLVM ERROR:%\|No compilation database found%\)%\@!%.%#,' .
            \ '%E%m',
        \ }
endfunction

function! neomake#makers#ft#objc#clangcheck() abort
    return {
        \ 'exe': 'clang-check',
        \ 'errorformat':
            \ '%-G%f:%s:,' .
            \ '%f:%l:%c: %trror: %m,' .
            \ '%f:%l:%c: %tarning: %m,' .
            \ '%I%f:%l:%c: note: %m,' .
            \ '%f:%l:%c: %m,'.
            \ '%f:%l: %trror: %m,'.
            \ '%f:%l: %tarning: %m,'.
            \ '%I%f:%l: note: %m,'.
            \ '%f:%l: %m',
        \ }
endfunction