Added Solium checker for Solidity

This commit is contained in:
Matthijs van den Bos 2017-03-16 01:29:53 +01:00
parent 48e8b0e9d2
commit 3fda1fd29f
3 changed files with 72 additions and 1 deletions

View File

@ -5953,6 +5953,7 @@ SYNTAX CHECKERS FOR SOLIDITY *syntastic-checkers-solidity*
The following checkers are available for Solidity (filetype "solidity"): The following checkers are available for Solidity (filetype "solidity"):
1. solc.....................|syntastic-solidity-solc| 1. solc.....................|syntastic-solidity-solc|
1. solium...................|syntastic-solidity-solium|
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
1. solc *syntastic-solidity-solc* 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 https://github.com/tomlion/vim-solidity
------------------------------------------------------------------------------
1. solium *syntastic-solidity-solium*
Name: solium
Maintainer: Matthijs van den Bos <matthijs@vandenbos.org>
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* SYNTAX CHECKERS FOR SQL *syntastic-checkers-sql*

View File

@ -86,7 +86,7 @@ let s:_DEFAULT_CHECKERS = {
\ 'slim': ['slimrb'], \ 'slim': ['slimrb'],
\ 'sml': ['smlnj'], \ 'sml': ['smlnj'],
\ 'spec': ['rpmlint'], \ 'spec': ['rpmlint'],
\ 'solidity': ['solc'], \ 'solidity': ['solc', 'solium'],
\ 'sql': ['sqlint'], \ 'sql': ['sqlint'],
\ 'stylus': ['stylint'], \ 'stylus': ['stylint'],
\ 'tcl': ['nagelfar'], \ 'tcl': ['nagelfar'],

View File

@ -0,0 +1,41 @@
"============================================================================
"File: solium.vim
"Description: Solidity syntax checker - using solium
"Maintainer: Matthijs van den Bos <matthijs@vandenbos.org>
"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: