From 6cf4f5ca76059caf229bc32c8e613cb137e0faed Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Wed, 26 Apr 2017 11:37:35 +0300 Subject: [PATCH] New checker cmakelint for CMake. --- README.markdown | 16 ++++++------ doc/syntastic-checkers.txt | 29 +++++++++++++++++++++ plugin/syntastic.vim | 2 +- plugin/syntastic/registry.vim | 1 + syntax_checkers/cmake/cmakelint.vim | 40 +++++++++++++++++++++++++++++ 5 files changed, 79 insertions(+), 9 deletions(-) create mode 100644 syntax_checkers/cmake/cmakelint.vim diff --git a/README.markdown b/README.markdown index 5c86183e..8f0e4607 100644 --- a/README.markdown +++ b/README.markdown @@ -58,15 +58,15 @@ their script to find them. At the time of this writing, syntastic has checking plugins for ACPI Source Language, ActionScript, Ada, Ansible configurations, API Blueprint, -AppleScript, AsciiDoc, Assembly languages, BEMHTML, Bro, Bourne shell, C, -C++, C#, Cabal, Chef, CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, +AppleScript, AsciiDoc, Assembly languages, BEMHTML, Bro, Bourne shell, C, C++, +C#, Cabal, Chef, CMake, CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dockerfile, Dust, Elixir, Erlang, eRuby, Fortran, Gentoo metadata, -GLSL, Go, Haml, Haskell, Haxe, Handlebars, HSS, HTML, Java, JavaScript, JSON, -JSX, Julia, LESS, Lex, Limbo, LISP, LLVM intermediate language, Lua, Markdown, -MATLAB, Mercury, NASM, Nix, Objective-C, Objective-C++, OCaml, Perl, Perl -POD, PHP, gettext Portable Object, OS X and iOS property lists, Pug (formerly -Jade), Puppet, Python, QML, R, Racket, RDF TriG, RDF Turtle, Relax NG, -reStructuredText, RPM spec, Ruby, SASS/SCSS, Scala, Slim, SML, Solidity, +GLSL, Go, Haml, Haskell, Haxe, Handlebars, HSS, HTML, Java, JavaScript, +JSON, JSX, Julia, LESS, Lex, Limbo, LISP, LLVM intermediate language, Lua, +Markdown, MATLAB, Mercury, NASM, Nix, Objective-C, Objective-C++, OCaml, Perl, +Perl POD, PHP, gettext Portable Object, OS X and iOS property lists, Pug +(formerly Jade), Puppet, Python, QML, R, Racket, RDF TriG, RDF Turtle, Relax +NG, reStructuredText, RPM spec, Ruby, SASS/SCSS, Scala, Slim, SML, Solidity, Sphinx, SQL, Stylus, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, Vim help, VimL, xHtml, XML, XSLT, XQuery, YACC, YAML, YANG data models, z80, Zope page templates, and Zsh. See the [manual][checkers] for details about the diff --git a/doc/syntastic-checkers.txt b/doc/syntastic-checkers.txt index 41287c60..e70d61a0 100644 --- a/doc/syntastic-checkers.txt +++ b/doc/syntastic-checkers.txt @@ -23,6 +23,7 @@ SYNTAX CHECKERS BY LANGUAGE *syntastic-checkers-lang* C++......................................|syntastic-checkers-cpp| Cabal....................................|syntastic-checkers-cabal| Chef.....................................|syntastic-checkers-chef| + CMake....................................|syntastic-checkers-cmake| COBOL....................................|syntastic-checkers-cobol| Coco.....................................|syntastic-checkers-co| CoffeeScript.............................|syntastic-checkers-coffee| @@ -1486,6 +1487,34 @@ You probably also need a plugin to set |filetype| for Chef files, such as https://github.com/dougireton/vim-chef +============================================================================== +SYNTAX CHECKERS FOR CMAKE *syntastic-checkers-cmake* + +The following checkers are available for CMake (filetype "cmake"): + + 1. cmakelint................|syntastic-cmake-cmakelint| + +------------------------------------------------------------------------------ +1. cmakelint *syntastic-cmake-cmakelint* + +Name: cmakelint +Maintainer: LCD 47 + +"cmakelint" is a style checker for "CMake" files (https://cmake.org/). +See the project's page at GitHub more information: + + https://github.com/richq/cmake-lint + +Installation~ + +Install it with "pip": > + pip install cmakelint +< +Checker options~ + +This checker is initialised using the "makeprgBuild()" function and thus it +accepts the standard options described at |syntastic-config-makeprg|. + ============================================================================== SYNTAX CHECKERS FOR COBOL *syntastic-checkers-cobol* diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 53aa8678..06d60cc9 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-50' +let g:_SYNTASTIC_VERSION = '3.8.0-51' lockvar g:_SYNTASTIC_VERSION " Sanity checks {{{1 diff --git a/plugin/syntastic/registry.vim b/plugin/syntastic/registry.vim index 4c1136f9..4efd5098 100644 --- a/plugin/syntastic/registry.vim +++ b/plugin/syntastic/registry.vim @@ -19,6 +19,7 @@ let s:_DEFAULT_CHECKERS = { \ 'c': ['gcc'], \ 'cabal': ['cabal'], \ 'chef': ['foodcritic'], + \ 'cmake': ['cmakelint'], \ 'co': ['coco'], \ 'cobol': ['cobc'], \ 'coffee': ['coffee', 'coffeelint'], diff --git a/syntax_checkers/cmake/cmakelint.vim b/syntax_checkers/cmake/cmakelint.vim new file mode 100644 index 00000000..84686081 --- /dev/null +++ b/syntax_checkers/cmake/cmakelint.vim @@ -0,0 +1,40 @@ +"============================================================================ +"File: cmakelint.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_cmake_cmakelint_checker') + finish +endif +let g:loaded_syntastic_cmake_cmakelint_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_cmake_cmakelint_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': 'cmake', + \ 'name': 'cmakelint' }) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: