From 5687aad671b8d47bba055dd7d5a3264580c9e279 Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Tue, 25 Apr 2017 19:38:07 +0300 Subject: [PATCH] New checker cppclean for C/C++. --- doc/syntastic-checkers.txt | 94 ++++++++++++++++++++++++-------- plugin/syntastic.vim | 2 +- syntax_checkers/c/cppclean.vim | 40 ++++++++++++++ syntax_checkers/cpp/cppclean.vim | 22 ++++++++ 4 files changed, 135 insertions(+), 23 deletions(-) create mode 100644 syntax_checkers/c/cppclean.vim create mode 100644 syntax_checkers/cpp/cppclean.vim diff --git a/doc/syntastic-checkers.txt b/doc/syntastic-checkers.txt index d1cdc4b0e..68603c84f 100644 --- a/doc/syntastic-checkers.txt +++ b/doc/syntastic-checkers.txt @@ -531,12 +531,13 @@ The following checkers are available for C (filetype "c"): 3. ClangCheck...............|syntastic-c-clang_check| 4. Clang-Tidy...............|syntastic-c-clang_tidy| 5. Cppcheck.................|syntastic-c-cppcheck| - 6. GCC......................|syntastic-c-gcc| - 7. make.....................|syntastic-c-make| - 8. OClint...................|syntastic-c-oclint| - 9. PC-Lint..................|syntastic-c-pc_lint| - 10. Sparse..................|syntastic-c-sparse| - 11. Splint..................|syntastic-c-splint| + 6. cppclean.................|syntastic-c-cppclean| + 7. GCC......................|syntastic-c-gcc| + 8. make.....................|syntastic-c-make| + 9. OClint...................|syntastic-c-oclint| + 10. PC-Lint.................|syntastic-c-pc_lint| + 11. Sparse..................|syntastic-c-sparse| + 12. Splint..................|syntastic-c-splint| ------------------------------------------------------------------------------ 1. AVR-GCC *syntastic-c-avrgcc* @@ -694,7 +695,31 @@ one option per line (cf. |syntastic-config-files|). See also: |syntastic-cpp-cppcheck|. ------------------------------------------------------------------------------ -6. GCC *syntastic-c-gcc* +6. cppclean *syntastic-c-cppclean* + +Name: cppclean +Maintainer: LCD 47 + +"cppclean" attempts to find problems in C++ source that slow development in +large code bases, for example various forms of unused code. See the project's +page at GitHub for more information: + + https://github.com/myint/cppclean + +Installation~ + +Install it with "pip": > + pip install cppclean +< +Checker options~ + +This checker is initialised using the "makeprgBuild()" function and thus it +accepts the standard options described at |syntastic-config-makeprg|. + +See also: |syntastic-cpp-cppclean|. + +------------------------------------------------------------------------------ +7. GCC *syntastic-c-gcc* Name: gcc Maintainer: Gregor Uhlenheuer @@ -791,7 +816,7 @@ executable. See also: |syntastic-cpp-gcc|. ------------------------------------------------------------------------------ -7. make *syntastic-c-make* +8. make *syntastic-c-make* Name: make Maintainer: Gregor Uhlenheuer @@ -802,7 +827,7 @@ This checker is initialised using the "makeprgBuild()" function and thus it accepts the standard options described at |syntastic-config-makeprg|. ------------------------------------------------------------------------------ -8. OClint *syntastic-c-oclint* +9. OClint *syntastic-c-oclint* Name: oclint Maintainer: "UnCO" Lin @@ -841,7 +866,7 @@ Config files pointed to by 'g:syntastic_oclint_config_file' are then ignored. See also: |syntastic-cpp-oclint|. ------------------------------------------------------------------------------ -9. PC-Lint *syntastic-c-pc_lint* +10. PC-Lint *syntastic-c-pc_lint* Name: pc_lint Maintainer: Steve Bragg @@ -868,7 +893,7 @@ current directory and in parent directories; first such file found is used. See also: |syntastic-cpp-pc_lint|. ------------------------------------------------------------------------------ -10. Sparse *syntastic-c-sparse* +11. Sparse *syntastic-c-sparse* Name: sparse Maintainer: Daniel Walker @@ -900,7 +925,7 @@ your vimrc: > This allows "Sparse" to read "GCC"'s private include files. ------------------------------------------------------------------------------ -11. Splint *syntastic-c-splint* +12. Splint *syntastic-c-splint* Name: splint Maintainer: LCD 47 @@ -956,11 +981,12 @@ The following checkers are available for C++ (filetype "cpp"): 2. ClangCheck...............|syntastic-cpp-clang_check| 3. Clang-Tidy...............|syntastic-cpp-clang_tidy| 4. Cppcheck.................|syntastic-cpp-cppcheck| - 5. Cpplint..................|syntastic-cpp-cpplint| - 6. GCC......................|syntastic-cpp-gcc| - 7. OClint...................|syntastic-cpp-oclint| - 8. PC-Lint..................|syntastic-cpp-pc_lint| - 9. Vera++...................|syntastic-cpp-verapp| + 5. cppclean.................|syntastic-cpp-cppclean| + 6. Cpplint..................|syntastic-cpp-cpplint| + 7. GCC......................|syntastic-cpp-gcc| + 8. OClint...................|syntastic-cpp-oclint| + 9. PC-Lint..................|syntastic-cpp-pc_lint| + 10. Vera++..................|syntastic-cpp-verapp| ------------------------------------------------------------------------------ 1. AVR-GCC *syntastic-cpp-avrgcc* @@ -1104,7 +1130,31 @@ one option per line (cf. |syntastic-config-files|). See also: |syntastic-c-cppcheck|. ------------------------------------------------------------------------------ -5. Cpplint *syntastic-cpp-cpplint* +5. cppclean *syntastic-cpp-cppclean* + +Name: cppclean +Maintainer: LCD 47 + +"cppclean" attempts to find problems in C++ source that slow development in +large code bases, for example various forms of unused code. See the project's +page at GitHub for more information: + + https://github.com/myint/cppclean + +Installation~ + +Install it with "pip": > + pip install cppclean +< +Checker options~ + +This checker is initialised using the "makeprgBuild()" function and thus it +accepts the standard options described at |syntastic-config-makeprg|. + +See also: |syntastic-c-cppclean|. + +------------------------------------------------------------------------------ +6. Cpplint *syntastic-cpp-cpplint* Name: cpplint Maintainer: LCD 47 @@ -1140,7 +1190,7 @@ However, if your "cpplint" was installed with "pip", the script's name is let g:syntastic_cpp_cpplint_exec = "cpplint" < ------------------------------------------------------------------------------ -6. GCC *syntastic-cpp-gcc* +7. GCC *syntastic-cpp-gcc* Name: gcc Maintainer: Gregor Uhlenheuer @@ -1237,7 +1287,7 @@ executable. See also: |syntastic-c-gcc|. ------------------------------------------------------------------------------ -7. OClint *syntastic-cpp-oclint* +8. OClint *syntastic-cpp-oclint* Name: oclint Maintainer: "UnCO" Lin @@ -1277,7 +1327,7 @@ Config files pointed to by 'g:syntastic_oclint_config_file' are then ignored. See also: |syntastic-c-oclint|. ------------------------------------------------------------------------------ -8. PC-Lint *syntastic-cpp-pc_lint* +9. PC-Lint *syntastic-cpp-pc_lint* Name: pc_lint Maintainer: Steve Bragg @@ -1304,7 +1354,7 @@ current directory and in parent directories; first such file found is used. See also: |syntastic-c-pc_lint|. ------------------------------------------------------------------------------ -9. Vera++ *syntastic-cpp-verapp* +10. Vera++ *syntastic-cpp-verapp* Name: verapp Maintainer: Lucas Verney diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 93d8bdaab..8f0d1b00e 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -19,7 +19,7 @@ if has('reltime') lockvar! g:_SYNTASTIC_START endif -let g:_SYNTASTIC_VERSION = '3.8.0-47' +let g:_SYNTASTIC_VERSION = '3.8.0-48' lockvar g:_SYNTASTIC_VERSION " Sanity checks {{{1 diff --git a/syntax_checkers/c/cppclean.vim b/syntax_checkers/c/cppclean.vim new file mode 100644 index 000000000..bddd979b7 --- /dev/null +++ b/syntax_checkers/c/cppclean.vim @@ -0,0 +1,40 @@ +"============================================================================ +"File: cppclean.vim +"Description: Syntax checking plugin for syntastic +"Maintainer: LCD 47 +"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_c_cppclean_checker') + finish +endif +let g:loaded_syntastic_c_cppclean_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_c_cppclean_GetLocList() dict + let makeprg = self.makeprgBuild({}) + + let errorformat = '%f:%l: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'subtype': 'Style', + \ 'returns': [0, 1] }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'c', + \ 'name': 'cppclean' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: diff --git a/syntax_checkers/cpp/cppclean.vim b/syntax_checkers/cpp/cppclean.vim new file mode 100644 index 000000000..f2afa4c09 --- /dev/null +++ b/syntax_checkers/cpp/cppclean.vim @@ -0,0 +1,22 @@ +"============================================================================ +"File: cppclean.vim +"Description: Syntax checking plugin for syntastic +"Maintainer: Benjamin Bannier +"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_cpp_cppclean_checker') + finish +endif +let g:loaded_syntastic_cpp_cppclean_checker = 1 + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'cpp', + \ 'name': 'cppclean', + \ 'redirect': 'c/cppclean'}) + +" vim: set sw=4 sts=4 et fdm=marker: