diff --git a/doc/syntastic-checkers.txt b/doc/syntastic-checkers.txt index 48536491..ea3f5a43 100644 --- a/doc/syntastic-checkers.txt +++ b/doc/syntastic-checkers.txt @@ -5953,6 +5953,7 @@ SYNTAX CHECKERS FOR SOLIDITY *syntastic-checkers-solidity* The following checkers are available for Solidity (filetype "solidity"): 1. solc.....................|syntastic-solidity-solc| + 1. solium...................|syntastic-solidity-solium| ------------------------------------------------------------------------------ 1. solc *syntastic-solidity-solc* @@ -5977,6 +5978,35 @@ You probably also need a plugin to set |filetype| for Solidity files, such as https://github.com/tomlion/vim-solidity +------------------------------------------------------------------------------ +1. solium *syntastic-solidity-solium* + +Name: solium +Maintainer: Matthijs van den Bos + +Solium is a linter for Solidity which uses Abstract Syntax Trees and allows +the user to enable/disable existing rules and add their own ones. See the +project's page for details: + + https://github.com/duaraghav8/Solium + +Checker options~ + +This checker is configured by the .soliumrc.json file. + +Note + +Solium doesn't run without a .soliumrc.json in the directory where it is run +from. In the case of this checker, that is the directory where the file being +checked is located. If there is no .soliumrc.json there, the checker won't +work. + +Note~ + +You probably also need a plugin to set |filetype| for Solidity files, such as +"vim-solidity": + + https://github.com/tomlion/vim-solidity ============================================================================== SYNTAX CHECKERS FOR SQL *syntastic-checkers-sql* diff --git a/plugin/syntastic/registry.vim b/plugin/syntastic/registry.vim index 69ef5817..004c961f 100644 --- a/plugin/syntastic/registry.vim +++ b/plugin/syntastic/registry.vim @@ -86,7 +86,7 @@ let s:_DEFAULT_CHECKERS = { \ 'slim': ['slimrb'], \ 'sml': ['smlnj'], \ 'spec': ['rpmlint'], - \ 'solidity': ['solc'], + \ 'solidity': ['solc', 'solium'], \ 'sql': ['sqlint'], \ 'stylus': ['stylint'], \ 'tcl': ['nagelfar'], diff --git a/syntax_checkers/solidity/solium.vim b/syntax_checkers/solidity/solium.vim new file mode 100644 index 00000000..f9802528 --- /dev/null +++ b/syntax_checkers/solidity/solium.vim @@ -0,0 +1,41 @@ +"============================================================================ +"File: solium.vim +"Description: Solidity syntax checker - using solium +"Maintainer: Matthijs van den Bos +"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_solidity_solium_checker') + finish +endif +let g:loaded_syntastic_solidity_solium_checker = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_solidity_solium_GetLocList() dict + let makeprg = self.makeprgBuild({ + \ 'exe': 'solium', + \ 'fname': expand('%:p',1), + \ 'args': '-R gcc --file'}) + + let errorformat = '%f:%l:%c: %trror: %m' + + return SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat }) +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'solidity', + \ 'name': 'solium'}) + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set sw=4 sts=4 et fdm=marker: