mirror of https://github.com/dense-analysis/ale
Merge pull request #158 from mshr-h/support-clang-for-c
Add support for clang for C language
This commit is contained in:
commit
f44756f347
|
@ -50,7 +50,7 @@ name. That seems to be the fairest way to arrange this table.
|
|||
| Ansible | [ansible-lint](https://github.com/willthames/ansible-lint) |
|
||||
| Bash | [-n flag](https://www.gnu.org/software/bash/manual/bash.html#index-set), [shellcheck](https://www.shellcheck.net/) |
|
||||
| Bourne Shell | [-n flag](http://linux.die.net/man/1/sh), [shellcheck](https://www.shellcheck.net/) |
|
||||
| C | [cppcheck](http://cppcheck.sourceforge.net), [gcc](https://gcc.gnu.org/)|
|
||||
| C | [cppcheck](http://cppcheck.sourceforge.net), [gcc](https://gcc.gnu.org/), [clang](http://clang.llvm.org/)|
|
||||
| C++ (filetype cpp) | [cppcheck] (http://cppcheck.sourceforge.net), [gcc](https://gcc.gnu.org/)|
|
||||
| CoffeeScript | [coffee](http://coffeescript.org/), [coffeelint](https://www.npmjs.com/package/coffeelint) |
|
||||
| CSS | [csslint](http://csslint.net/) |
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
" Author: Masahiro H https://github.com/mshr-h
|
||||
" Description: clang linter for c files
|
||||
|
||||
" Set this option to change the Clang options for warnings for C.
|
||||
if !exists('g:ale_c_clang_options')
|
||||
" let g:ale_c_clang_options = '-Wall'
|
||||
" let g:ale_c_clang_options = '-std=c99 -Wall'
|
||||
" c11 compatible
|
||||
let g:ale_c_clang_options = '-std=c11 -Wall'
|
||||
endif
|
||||
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'clang',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'clang',
|
||||
\ 'command': 'clang -S -x c -fsyntax-only '
|
||||
\ . g:ale_c_clang_options
|
||||
\ . ' -',
|
||||
\ 'callback': 'ale#handlers#HandleGCCFormat',
|
||||
\})
|
13
doc/ale.txt
13
doc/ale.txt
|
@ -55,7 +55,7 @@ The following languages and tools are supported.
|
|||
* Ansible: 'ansible-lint'
|
||||
* Bash: 'shell' (-n flag), 'shellcheck'
|
||||
* Bourne Shell: 'shell' (-n flag), 'shellcheck'
|
||||
* C: 'cppcheck', 'gcc'
|
||||
* C: 'cppcheck', 'gcc', 'clang'
|
||||
* C++ (filetype cpp): 'cppcheck', 'gcc'
|
||||
* CoffeeScript: 'coffee', 'coffelint'
|
||||
* CSS: 'csslint'
|
||||
|
@ -561,6 +561,17 @@ g:ale_html_htmlhint_options *g:ale_html_htmlhint_options
|
|||
This variable can be changed to modify flags given to HTMLHint.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
4.5. c-gcc *ale-linter-options-c-clang*
|
||||
|
||||
g:ale_c_clang_options *g:ale_c_clang_options*
|
||||
|
||||
Type: |String|
|
||||
Default: `'-std=c11 -Wall'`
|
||||
|
||||
This variable can be change to modify flags given to clang.
|
||||
|
||||
|
||||
===============================================================================
|
||||
5. Commands/Keybinds *ale-commands*
|
||||
|
||||
|
|
Loading…
Reference in New Issue