New checker cmakelint for CMake.

This commit is contained in:
LCD 47 2017-04-26 11:37:35 +03:00
parent 2cfb29d0a4
commit 6cf4f5ca76
5 changed files with 79 additions and 9 deletions

View File

@ -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

View File

@ -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 <lcd047@gmail.com>
"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*

View File

@ -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

View File

@ -19,6 +19,7 @@ let s:_DEFAULT_CHECKERS = {
\ 'c': ['gcc'],
\ 'cabal': ['cabal'],
\ 'chef': ['foodcritic'],
\ 'cmake': ['cmakelint'],
\ 'co': ['coco'],
\ 'cobol': ['cobc'],
\ 'coffee': ['coffee', 'coffeelint'],

View File

@ -0,0 +1,40 @@
"============================================================================
"File: cmakelint.vim
"Description: Syntax checking plugin for syntastic
"Maintainer: LCD 47 <lcd047 at gmail dot com>
"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: