X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/0ee596c5c5e11fc79598407eaf22f83d279f7e9e..5a4872f466ebd76ddd532bdf2798554421c53df4:/.vim/bundle/ale/ale_linters/solidity/solhint.vim diff --git a/.vim/bundle/ale/ale_linters/solidity/solhint.vim b/.vim/bundle/ale/ale_linters/solidity/solhint.vim new file mode 100644 index 00000000..9dc308fe --- /dev/null +++ b/.vim/bundle/ale/ale_linters/solidity/solhint.vim @@ -0,0 +1,83 @@ +" Authors: Franco Victorio <@fvictorio>, Henrique Barcelos <@hbarcelos> +" Description: Report errors in Solidity code with solhint + +call ale#Set('solidity_solhint_options', '') +call ale#Set('solidity_solhint_executable', 'solhint') +call ale#Set('solidity_solhint_use_global', get(g:, 'ale_use_global_executables', 0)) + +function! ale_linters#solidity#solhint#Handle(buffer, lines) abort + let l:output = [] + + " Matches lines like the following: + " contracts/Bounty.sol:14:3: Expected indentation of 4 spaces but found 2 [Error/indent] + let l:lint_pattern = '\v^[^:]+:(\d+):(\d+): %(Parse error: )@ +\ ale#node#Executable(b, ale_linters#solidity#solhint#GetExecutable(b)) +\ . ale#Pad(ale#Var(b, 'solidity_solhint_options')) +\ . ' --formatter unix %s' +\ }, +\ 'callback': 'ale_linters#solidity#solhint#Handle', +\})