<commit_before>"============================================================================
"File:        shellcheck.vim
"Description: Shell script syntax/style checking plugin for syntastic.vim
"============================================================================

if exists("g:loaded_syntastic_sh_shellcheck_checker")
    finish
endif
let g:loaded_syntastic_sh_shellcheck_checker = 1

function! SyntaxCheckers_sh_shellcheck_Preprocess(json)
    " A hat tip to <NAME> for this trick
    " http://stackoverflow.com/a/19105763
    let errors = eval(join(a:json, ''))

    call filter(errors, 'v:val["level"] =~? ''\v^(error|warning|style)$''')
    return map(errors, 'v:val["level"][0] . ":" . v:val["line"] . ":" . v:val["column"] . ":" . v:val["message"]')
endfunction

function! SyntaxCheckers_sh_shellcheck_GetLocList()
    let makeprg = expand(self.getExec()) . ' < ' . syntastic#util#shexpand('%')

    let errorformat = '%t:%l:%v:%m'

    let loclist = SyntasticMake({
        \ 'makeprg': makeprg,
        \ 'errorformat': errorformat,
        \ 'preprocess': 'SyntaxCheckers_sh_shellcheck_Preprocess',
        \ 'defaults': {'bufnr': bufnr("")},
        \ 'returns': [0] })

    for e in loclist
        if e['type'] ==? 's'
            let e['type'] = 'w'
            let e['subtype'] = 'Style'
        endif<commit_msg>Update for shellcheck.<commit_after>"============================================================================
"File:        shellcheck.vim
"Description: Shell script syntax/style checking plugin for syntastic.vim
"============================================================================

if exists("g:loaded_syntastic_sh_shellcheck_checker")
    finish
endif
let g:loaded_syntastic_sh_shellcheck_checker = 1

function! SyntaxCheckers_sh_shellcheck_Preprocess(json)
    " A hat tip to <NAME> for this trick
    " http://stackoverflow.com/a/19105763
    let errors = eval(join(a:json, ''))

    call filter(errors, 'v:val["level"] =~? ''\v^(error|warning|style)$''')
    return map(errors, 'v:val["level"][0] . ":" . v:val["line"] . ":" . v:val["column"] . ":" . v:val["message"]')
endfunction

function! SyntaxCheckers_sh_shellcheck_GetLocList() dict
    let makeprg = expand(self.getExec()) . ' < ' . syntastic#util#shexpand('%')

    let errorformat = '%t:%l:%v:%m'

    let loclist = SyntasticMake({
        \ 'makeprg': makeprg,
        \ 'errorformat': errorformat,
        \ 'preprocess': 'SyntaxCheckers_sh_shellcheck_Preprocess',
        \ 'defaults': {'bufnr': bufnr("")},
        \ 'returns': [0] })

    for e in loclist
        if e['type'] ==? 's'
            let e['type'] = 'w'
            let e['subtype'] = 'Style'
        endif
{'fraction_non_alphanumeric': 0.26431226765799254, 'fraction_numerical': 0.008178438661710037, 'mean_word_length': 3.955801104972376, 'pattern_counts': {'":': 6, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4871826', 'n_tokens_mistral': 871, 'n_tokens_neox': 832, 'n_words': 162}