<commit_before>if exists("g:loaded_syntastic_postprocess_autoload")
    finish
endif
let g:loaded_syntastic_postprocess_autoload = 1

let s:save_cpo = &cpo
set cpo&vim

function! s:compareErrorItems(a, b)
    if a:a['bufnr'] != a:b['bufnr']
        " group by files
        return a:a['bufnr'] - a:b['bufnr']
    elseif a:a['lnum'] != a:b['lnum']
        return a:a['lnum'] - a:b['lnum']
    elseif a:a['type'] !=? a:b['type']
        " errors take precedence over warnings
        return a:a['type'] ==? 'e' ? -1 : 1
    else
        return get(a:a, 'col') - get(a:b, 'col')
    endif
endfunction

" natural sort
function! syntastic#postprocess#sort(errors)
    return sort(a:errors, 's:compareErrorItems')
endfunction

function syntastic#postprocess#compressWhitespace(errors)
    let llist = []

    for e in a:errors
        let e['text'] = substitute(e['text'], '\n', ' ', 'g')
        let e['text'] = substitute(e['text'], '\s\{2,}', ' ', 'g')
        call add(llist, e)
    endfor

    return llist
endfunction

" remove spurious CR under Cygwin
function! syntastic#postprocess#cygwinRemoveCR(errors)
    if has('win32unix')
        let llist = []

        for e in a:errors
            let e['text'] = substitute(e['text'], '\r', '', 'g')
            call add(llist, e)
        endfor
    else
        let llist = a:errors
    endif

    return llist
endfunction

" decode XML entities
function! syntastic#postprocess#decodeXMLEntities(errors)
    let llist = []

    for e in a:errors
        let e['text'] = syntastic#util#decodeXMLEntities(e['text'])
        call add(llist, e)
    endfor

    return llist
endfunction

let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:
<commit_msg>Leftover from 7eda5de.  How embarrasing.<commit_after>if exists("g:loaded_syntastic_postprocess_autoload")
    finish
endif
let g:loaded_syntastic_postprocess_autoload = 1

let s:save_cpo = &cpo
set cpo&vim

function! s:compareErrorItems(a, b)
    if a:a['bufnr'] != a:b['bufnr']
        " group by files
        return a:a['bufnr'] - a:b['bufnr']
    elseif a:a['lnum'] != a:b['lnum']
        return a:a['lnum'] - a:b['lnum']
    elseif a:a['type'] !=? a:b['type']
        " errors take precedence over warnings
        return a:a['type'] ==? 'e' ? -1 : 1
    else
        return get(a:a, 'col') - get(a:b, 'col')
    endif
endfunction

" natural sort
function! syntastic#postprocess#sort(errors)
    return sort(a:errors, 's:compareErrorItems')
endfunction

function syntastic#postprocess#compressWhitespace(errors)
    let llist = []

    for e in a:errors
        let e['text'] = substitute(e['text'], "\001", '', 'g')
        let e['text'] = substitute(e['text'], '\n', ' ', 'g')
        let e['text'] = substitute(e['text'], '\s\{2,}', ' ', 'g')
        call add(llist, e)
    endfor

    return llist
endfunction

" remove spurious CR under Cygwin
function! syntastic#postprocess#cygwinRemoveCR(errors)
    if has('win32unix')
        let llist = []

        for e in a:errors
            let e['text'] = substitute(e['text'], '\r', '', 'g')
            call add(llist, e)
        endfor
    else
        let llist = a:errors
    endif

    return llist
endfunction

" decode XML entities
function! syntastic#postprocess#decodeXMLEntities(errors)
    let llist = []

    for e in a:errors
        let e['text'] = syntastic#util#decodeXMLEntities(e['text'])
        call add(llist, e)
    endfor

    return llist
endfunction

let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

{'fraction_non_alphanumeric': 0.1497432972047918, 'fraction_numerical': 0.005989731888191671, 'mean_word_length': 3.0403225806451615, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5033766', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1243, 'n_words': 303}