From 3e11cbd18da3852fab5dee3f743bc60dc87f0775 Mon Sep 17 00:00:00 2001 From: w0rp Date: Wed, 6 Feb 2019 18:05:13 +0000 Subject: Update syntax checking * Line continuation characters should be on the same lines. * .vim file line indentation should be a multiple of 4. --- autoload/ale/c.vim | 10 +++++----- autoload/ale/completion.vim | 2 +- autoload/ale/filetypes.vim | 2 +- autoload/ale/fixers/jq.vim | 20 ++++++++++---------- autoload/ale/fixers/prettier.vim | 4 ++-- autoload/ale/fixers/qmlfmt.vim | 6 +++--- autoload/ale/fixers/stylelint.vim | 9 ++++----- autoload/ale/go.vim | 12 ++++++------ autoload/ale/handlers/flawfinder.vim | 3 ++- autoload/ale/handlers/haskell.vim | 8 ++++---- autoload/ale/handlers/markdownlint.vim | 8 ++++---- autoload/ale/handlers/sml.vim | 31 ++++++++++++++++--------------- autoload/ale/hover.vim | 4 ++-- autoload/ale/lsp/response.vim | 16 ++++++++++------ autoload/ale/preview.vim | 3 ++- autoload/ale/python.vim | 2 +- autoload/ale/ruby.vim | 2 +- autoload/ale/sign.vim | 2 +- autoload/ale/statusline.vim | 6 ++++-- autoload/ale/test.vim | 6 +++--- 20 files changed, 82 insertions(+), 74 deletions(-) (limited to 'autoload') diff --git a/autoload/ale/c.vim b/autoload/ale/c.vim index 6ac2d398..031de885 100644 --- a/autoload/ale/c.vim +++ b/autoload/ale/c.vim @@ -86,8 +86,8 @@ function! ale#c#ParseCFlags(path_prefix, cflag_line) abort let l:next_option_index = l:option_index + 1 " Join space-separated option - while l:next_option_index < len(l:split_lines) && - \ stridx(l:split_lines[l:next_option_index], '-') != 0 + while l:next_option_index < len(l:split_lines) + \&& stridx(l:split_lines[l:next_option_index], '-') != 0 let l:next_option_index += 1 endwhile @@ -96,9 +96,9 @@ function! ale#c#ParseCFlags(path_prefix, cflag_line) abort call insert(l:split_lines, l:option, l:option_index) " Ignore invalid or conflicting options - if stridx(l:option, '-') != 0 || - \ stridx(l:option, '-o') == 0 || - \ stridx(l:option, '-c') == 0 + if stridx(l:option, '-') != 0 + \|| stridx(l:option, '-o') == 0 + \|| stridx(l:option, '-c') == 0 call remove(l:split_lines, l:option_index) let l:option_index = l:option_index - 1 " Fix relative path diff --git a/autoload/ale/completion.vim b/autoload/ale/completion.vim index 9baf29fd..d0e27cc4 100644 --- a/autoload/ale/completion.vim +++ b/autoload/ale/completion.vim @@ -316,7 +316,7 @@ function! ale#completion#ParseTSServerCompletionEntryDetails(response) abort endfunction function! ale#completion#NullFilter(buffer, item) abort - return 1 + return 1 endfunction function! ale#completion#ParseLSPCompletions(response) abort diff --git a/autoload/ale/filetypes.vim b/autoload/ale/filetypes.vim index 6174aa0e..6cdc9ece 100644 --- a/autoload/ale/filetypes.vim +++ b/autoload/ale/filetypes.vim @@ -5,7 +5,7 @@ function! ale#filetypes#LoadExtensionMap() abort " Output includes: " '*.erl setf erlang' redir => l:output - silent exec 'autocmd' + silent exec 'autocmd' redir end let l:map = {} diff --git a/autoload/ale/fixers/jq.vim b/autoload/ale/fixers/jq.vim index 1b743e49..cd9b9138 100644 --- a/autoload/ale/fixers/jq.vim +++ b/autoload/ale/fixers/jq.vim @@ -7,16 +7,16 @@ function! ale#fixers#jq#GetExecutable(buffer) abort endfunction function! ale#fixers#jq#Fix(buffer) abort - let l:options = ale#Var(a:buffer, 'json_jq_options') - let l:filters = ale#Var(a:buffer, 'json_jq_filters') + let l:options = ale#Var(a:buffer, 'json_jq_options') + let l:filters = ale#Var(a:buffer, 'json_jq_filters') - if empty(l:filters) - return 0 - endif + if empty(l:filters) + return 0 + endif - return { - \ 'command': ale#Escape(ale#fixers#jq#GetExecutable(a:buffer)) - \ . ' ' . l:filters . ' ' - \ . l:options, - \} + return { + \ 'command': ale#Escape(ale#fixers#jq#GetExecutable(a:buffer)) + \ . ' ' . l:filters . ' ' + \ . l:options, + \} endfunction diff --git a/autoload/ale/fixers/prettier.vim b/autoload/ale/fixers/prettier.vim index 95932474..0f99ae97 100644 --- a/autoload/ale/fixers/prettier.vim +++ b/autoload/ale/fixers/prettier.vim @@ -51,9 +51,9 @@ function! ale#fixers#prettier#ApplyFixForVersion(buffer, version_output) abort " filetype (scratch buffer), Prettier needs `parser` set to know how " to process the buffer. if ale#semver#GTE(l:version, [1, 16, 0]) - let l:parser = 'babel' + let l:parser = 'babel' else - let l:parser = 'babylon' + let l:parser = 'babylon' endif let l:prettier_parsers = { diff --git a/autoload/ale/fixers/qmlfmt.vim b/autoload/ale/fixers/qmlfmt.vim index d750d1c4..90b25679 100644 --- a/autoload/ale/fixers/qmlfmt.vim +++ b/autoload/ale/fixers/qmlfmt.vim @@ -5,7 +5,7 @@ function! ale#fixers#qmlfmt#GetExecutable(buffer) abort endfunction function! ale#fixers#qmlfmt#Fix(buffer) abort - return { - \ 'command': ale#Escape(ale#fixers#qmlfmt#GetExecutable(a:buffer)), - \} + return { + \ 'command': ale#Escape(ale#fixers#qmlfmt#GetExecutable(a:buffer)), + \} endfunction diff --git a/autoload/ale/fixers/stylelint.vim b/autoload/ale/fixers/stylelint.vim index 30309c7e..6bfb2fde 100644 --- a/autoload/ale/fixers/stylelint.vim +++ b/autoload/ale/fixers/stylelint.vim @@ -5,13 +5,12 @@ call ale#Set('stylelint_executable', 'stylelint') call ale#Set('stylelint_use_global', get(g:, 'ale_use_global_executables', 0)) function! ale#fixers#stylelint#GetExecutable(buffer) abort - return ale#node#FindExecutable(a:buffer, 'stylelint', [ - \ 'node_modules/stylelint/bin/stylelint.js', - \ 'node_modules/.bin/stylelint', - \]) + return ale#node#FindExecutable(a:buffer, 'stylelint', [ + \ 'node_modules/stylelint/bin/stylelint.js', + \ 'node_modules/.bin/stylelint', + \]) endfunction - function! ale#fixers#stylelint#Fix(buffer) abort let l:executable = ale#fixers#stylelint#GetExecutable(a:buffer) diff --git a/autoload/ale/go.vim b/autoload/ale/go.vim index a166480a..cd7d9503 100644 --- a/autoload/ale/go.vim +++ b/autoload/ale/go.vim @@ -9,18 +9,18 @@ function! ale#go#FindProjectRoot(buffer) abort let l:filename = ale#path#Simplify(expand('#' . a:buffer . ':p')) for l:name in split($GOPATH, l:sep) - let l:path_dir = ale#path#Simplify(l:name) + let l:path_dir = ale#path#Simplify(l:name) - " Use the directory from GOPATH if the current filename starts with it. - if l:filename[: len(l:path_dir) - 1] is? l:path_dir - return l:path_dir - endif + " Use the directory from GOPATH if the current filename starts with it. + if l:filename[: len(l:path_dir) - 1] is? l:path_dir + return l:path_dir + endif endfor let l:default_go_path = ale#path#Simplify(expand('~/go')) if isdirectory(l:default_go_path) - return l:default_go_path + return l:default_go_path endif return '' diff --git a/autoload/ale/handlers/flawfinder.vim b/autoload/ale/handlers/flawfinder.vim index a650d6dd..b7d2bec3 100644 --- a/autoload/ale/handlers/flawfinder.vim +++ b/autoload/ale/handlers/flawfinder.vim @@ -1,3 +1,4 @@ +scriptencoding utf-8 " Author: Christian Gibbons " Description: This file defines a handler function that should work for the " flawfinder format with the -CDQS flags. @@ -30,7 +31,7 @@ function! ale#handlers#flawfinder#HandleFlawfinderFormat(buffer, lines) abort \ 'lnum': str2nr(l:match[2]), \ 'col': str2nr(l:match[3]), \ 'type': (l:severity < ale#Var(a:buffer, 'c_flawfinder_error_severity')) - \ ? 'W' : 'E', + \ ? 'W' : 'E', \ 'text': s:RemoveUnicodeQuotes(join(split(l:match[4])[1:]) . ': ' . l:match[5]), \} diff --git a/autoload/ale/handlers/haskell.vim b/autoload/ale/handlers/haskell.vim index 9e495b36..3613b1bb 100644 --- a/autoload/ale/handlers/haskell.vim +++ b/autoload/ale/handlers/haskell.vim @@ -66,11 +66,11 @@ function! ale#handlers#haskell#HandleGHCFormat(buffer, lines) abort let l:errors = matchlist(l:match[4], '\v([wW]arning|[eE]rror): ?(.*)') if len(l:errors) > 0 - let l:ghc_type = l:errors[1] - let l:text = l:errors[2] + let l:ghc_type = l:errors[1] + let l:text = l:errors[2] else - let l:ghc_type = '' - let l:text = l:match[4][:0] is# ' ' ? l:match[4][1:] : l:match[4] + let l:ghc_type = '' + let l:text = l:match[4][:0] is# ' ' ? l:match[4][1:] : l:match[4] endif if l:ghc_type is? 'Warning' diff --git a/autoload/ale/handlers/markdownlint.vim b/autoload/ale/handlers/markdownlint.vim index 12fc501c..daaa1d66 100644 --- a/autoload/ale/handlers/markdownlint.vim +++ b/autoload/ale/handlers/markdownlint.vim @@ -7,10 +7,10 @@ function! ale#handlers#markdownlint#Handle(buffer, lines) abort for l:match in ale#util#GetMatches(a:lines, l:pattern) call add(l:output, { - \ 'lnum': l:match[1] + 0, - \ 'text': '(' . l:match[2] . l:match[3] . l:match[4] . ')' . l:match[5], - \ 'type': 'W', - \ }) + \ 'lnum': l:match[1] + 0, + \ 'text': '(' . l:match[2] . l:match[3] . l:match[4] . ')' . l:match[5], + \ 'type': 'W', + \}) endfor return l:output diff --git a/autoload/ale/handlers/sml.vim b/autoload/ale/handlers/sml.vim index 92c5f83b..e5e528a5 100644 --- a/autoload/ale/handlers/sml.vim +++ b/autoload/ale/handlers/sml.vim @@ -64,26 +64,27 @@ function! ale#handlers#sml#Handle(buffer, lines) abort let l:match2 = matchlist(l:line, l:pattern2) if len(l:match2) != 0 - call add(l:out, { - \ 'bufnr': a:buffer, - \ 'lnum': l:match2[1] + 0, - \ 'col' : l:match2[2] - 1, - \ 'text': l:match2[3], - \ 'type': l:match2[3] =~# '^Warning' ? 'W' : 'E', - \}) - continue + call add(l:out, { + \ 'bufnr': a:buffer, + \ 'lnum': l:match2[1] + 0, + \ 'col' : l:match2[2] - 1, + \ 'text': l:match2[3], + \ 'type': l:match2[3] =~# '^Warning' ? 'W' : 'E', + \}) + + continue endif let l:match = matchlist(l:line, l:pattern) if len(l:match) != 0 - call add(l:out, { - \ 'bufnr': a:buffer, - \ 'lnum': l:match[1] + 0, - \ 'text': l:match[2] . ': ' . l:match[3], - \ 'type': l:match[2] is# 'error' ? 'E' : 'W', - \}) - continue + call add(l:out, { + \ 'bufnr': a:buffer, + \ 'lnum': l:match[1] + 0, + \ 'text': l:match[2] . ': ' . l:match[3], + \ 'type': l:match[2] is# 'error' ? 'E' : 'W', + \}) + continue endif endfor diff --git a/autoload/ale/hover.vim b/autoload/ale/hover.vim index 490cc406..873c9558 100644 --- a/autoload/ale/hover.vim +++ b/autoload/ale/hover.vim @@ -78,8 +78,8 @@ function! ale#hover#HandleLSPResponse(conn_id, response) abort let l:result = l:result.contents if type(l:result) is v:t_string - " The result can be just a string. - let l:result = [l:result] + " The result can be just a string. + let l:result = [l:result] endif if type(l:result) is v:t_dict diff --git a/autoload/ale/lsp/response.vim b/autoload/ale/lsp/response.vim index 5e62a29a..b91d875b 100644 --- a/autoload/ale/lsp/response.vim +++ b/autoload/ale/lsp/response.vim @@ -58,16 +58,20 @@ function! ale#lsp#response#ReadDiagnostics(response) abort if has_key(l:diagnostic, 'relatedInformation') let l:related = deepcopy(l:diagnostic.relatedInformation) call map(l:related, {key, val -> - \ ale#path#FromURI(val.location.uri) . - \ ':' . (val.location.range.start.line + 1) . - \ ':' . (val.location.range.start.character + 1) . - \ ":\n\t" . val.message - \ }) + \ ale#path#FromURI(val.location.uri) . + \ ':' . (val.location.range.start.line + 1) . + \ ':' . (val.location.range.start.character + 1) . + \ ":\n\t" . val.message + \}) let l:loclist_item.detail = l:diagnostic.message . "\n" . join(l:related, "\n") endif if has_key(l:diagnostic, 'source') - let l:loclist_item.detail = printf('[%s] %s', l:diagnostic.source, l:diagnostic.message) + let l:loclist_item.detail = printf( + \ '[%s] %s', + \ l:diagnostic.source, + \ l:diagnostic.message + \) endif call add(l:loclist, l:loclist_item) diff --git a/autoload/ale/preview.vim b/autoload/ale/preview.vim index 5b8fdcdb..a94da594 100644 --- a/autoload/ale/preview.vim +++ b/autoload/ale/preview.vim @@ -52,7 +52,8 @@ function! ale#preview#ShowSelection(item_list, ...) abort let l:filename = l:item.filename if get(l:options, 'use_relative_paths') - let l:filename = substitute(l:item.filename, '^' . getcwd() . l:sep, '', '') " no-custom-checks + let l:cwd = getcwd() " no-custom-checks + let l:filename = substitute(l:filename, '^' . l:cwd . l:sep, '', '') endif call add( diff --git a/autoload/ale/python.vim b/autoload/ale/python.vim index 8d6bf1f0..5c569561 100644 --- a/autoload/ale/python.vim +++ b/autoload/ale/python.vim @@ -48,7 +48,7 @@ function! ale#python#FindProjectRoot(buffer) abort let l:ini_root = ale#python#FindProjectRootIni(a:buffer) if !empty(l:ini_root) - return l:ini_root + return l:ini_root endif for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h')) diff --git a/autoload/ale/ruby.vim b/autoload/ale/ruby.vim index 3d9c5a51..69d7a0c0 100644 --- a/autoload/ale/ruby.vim +++ b/autoload/ale/ruby.vim @@ -26,7 +26,7 @@ function! ale#ruby#FindProjectRoot(buffer) abort let l:dir = ale#ruby#FindRailsRoot(a:buffer) if isdirectory(l:dir) - return l:dir + return l:dir endif for l:name in ['.solargraph.yml', 'Rakefile', 'Gemfile'] diff --git a/autoload/ale/sign.vim b/autoload/ale/sign.vim index af863682..fc1ea5b6 100644 --- a/autoload/ale/sign.vim +++ b/autoload/ale/sign.vim @@ -116,7 +116,7 @@ endfunction " Read sign data for a buffer to a list of lines. function! ale#sign#ReadSigns(buffer) abort redir => l:output - silent execute 'sign place buffer=' . a:buffer + silent execute 'sign place buffer=' . a:buffer redir end return split(l:output, "\n") diff --git a/autoload/ale/statusline.vim b/autoload/ale/statusline.vim index 3040985f..6b93ba51 100644 --- a/autoload/ale/statusline.vim +++ b/autoload/ale/statusline.vim @@ -78,8 +78,10 @@ endfunction function! s:UpdateCacheIfNecessary(buffer) abort " Cache is cold, so manually ask for an update. if !has_key(g:ale_buffer_info[a:buffer], 'count') - call ale#statusline#Update(a:buffer, - \ g:ale_buffer_info[a:buffer].loclist) + call ale#statusline#Update( + \ a:buffer, + \ g:ale_buffer_info[a:buffer].loclist + \) endif endfunction diff --git a/autoload/ale/test.vim b/autoload/ale/test.vim index e6ec70dc..9685fc81 100644 --- a/autoload/ale/test.vim +++ b/autoload/ale/test.vim @@ -55,9 +55,9 @@ endfunction function! s:RemoveModule(results) abort for l:item in a:results - if has_key(l:item, 'module') - call remove(l:item, 'module') - endif + if has_key(l:item, 'module') + call remove(l:item, 'module') + endif endfor endfunction -- cgit v1.2.3