summaryrefslogtreecommitdiff
path: root/ale_linters/cpp
diff options
context:
space:
mode:
authorTim van Deurzen <tim@kompiler.org>2017-02-12 00:32:56 +0100
committerw0rp <w0rp@users.noreply.github.com>2017-02-11 23:32:56 +0000
commit355608b031d98b8f0adbc5d210ee0a8e2e9b1a88 (patch)
treef0cbdd1f94b912ef82d4dfef79e476c2045643f0 /ale_linters/cpp
parent4a71638061451b4be169eb9b8df5c0bf82cc90f5 (diff)
downloadale-355608b031d98b8f0adbc5d210ee0a8e2e9b1a88.zip
Add clang-tidy linter for cpp. (#275)
* Add clang-tidy linter for cpp. * Use stdin-wrapper to allow linting as you type.
Diffstat (limited to 'ale_linters/cpp')
-rw-r--r--ale_linters/cpp/clangtidy.vim15
1 files changed, 15 insertions, 0 deletions
diff --git a/ale_linters/cpp/clangtidy.vim b/ale_linters/cpp/clangtidy.vim
new file mode 100644
index 00000000..ef7c63e8
--- /dev/null
+++ b/ale_linters/cpp/clangtidy.vim
@@ -0,0 +1,15 @@
+" Author: vdeurzen <tim@kompiler.org>
+" Description: clang-tidy linter for cpp files
+
+" Set this option to change the clang-tidy options for warnings for C.
+if !exists('g:ale_cpp_clangtidy_options')
+ let g:ale_cpp_clangtidy_options = '-std=c++14 -Wall'
+endif
+
+call ale#linter#Define('cpp', {
+\ 'name': 'clangtidy',
+\ 'output_stream': 'stdout',
+\ 'executable': 'clang-tidy',
+\ 'command': g:ale#util#stdin_wrapper . ' -- ' . g:ale_cpp_clangtidy_options,
+\ 'callback': 'ale#handlers#HandleGCCFormat',
+\})