<commit_before>function! neomake#makers#ft#rust#EnabledMakers() abort
    return ['cargo']
endfunction

function! neomake#makers#ft#rust#rustc() abort
    return {
        \ 'errorformat':
            \ '%-Gerror: aborting due to previous error,'.
            \ '%-Gerror: aborting due to %\\d%\\+ previous errors,'.
            \ '%-Gerror: Could not compile `%s`.,'.
            \ '%Eerror[E%n]: %m,'.
            \ '%Eerror: %m,'.
            \ '%Wwarning: %m,'.
            \ '%Inote: %m,'.
            \ '%-Z\ %#-->\ %f:%l:%c,'.
            \ '%G\ %#\= %*[^:]: %m,'.
            \ '%G\ %#|\ %#%\\^%\\+ %m,'.
            \ '%I%>help:\ %#%m,'.
            \ '%Z\ %#%m,'.
            \ '%-G%s',
        \ }
endfunction

function! neomake#makers#ft#rust#cargo() abort
    return {
        \ 'args': ['test', '--no-run', '--message-format=json', '--quiet'],
        \ 'append_file': 0,
        \ 'errorformat':
            \ '[%t%n] "%f" %l:%v %m,'.
            \ '[%t] "%f" %l:%v %m',
        \ 'process_output': function('neomake#makers#ft#rust#CargoProcessOutput'),
        \ }
endfunction

function! neomake#makers#ft#rust#CargoProcessOutput(context) abort
    let errors = []
    for line in a:context['output']
        if line[0] !=# '{'
            continue
        endif

        let decoded = neomake#utils#JSONdecode(line)
        let data = get(decoded, 'message', -1)
        if type(data) != type({}) || !len(data['spans'])
            continue
        endif

        let error = {'maker_name': 'cargo'}
        let code_dict = get(data, 'code', -1)
        if code_dict is g:neomake#compat#json_null
            if get(data, 'level', '') ==# 'warning'
                let error.type = 'W'
            else
                let error.type = 'E'<commit_msg>rust: cargo: use cargo-check by default (#1195)<commit_after>function! neomake#makers#ft#rust#EnabledMakers() abort
    return ['cargo']
endfunction

function! neomake#makers#ft#rust#rustc() abort
    return {
        \ 'errorformat':
            \ '%-Gerror: aborting due to previous error,'.
            \ '%-Gerror: aborting due to %\\d%\\+ previous errors,'.
            \ '%-Gerror: Could not compile `%s`.,'.
            \ '%Eerror[E%n]: %m,'.
            \ '%Eerror: %m,'.
            \ '%Wwarning: %m,'.
            \ '%Inote: %m,'.
            \ '%-Z\ %#-->\ %f:%l:%c,'.
            \ '%G\ %#\= %*[^:]: %m,'.
            \ '%G\ %#|\ %#%\\^%\\+ %m,'.
            \ '%I%>help:\ %#%m,'.
            \ '%Z\ %#%m,'.
            \ '%-G%s',
        \ }
endfunction

function! neomake#makers#ft#rust#cargo() abort
    let maker_command = get(b:, 'neomake_rust_cargo_command',
                \ get(g:, 'neomake_rust_cargo_command', ['check']))
    return {
        \ 'args': maker_command + ['--message-format=json', '--quiet'],
        \ 'append_file': 0,
        \ 'errorformat':
            \ '[%t%n] "%f" %l:%v %m,'.
            \ '[%t] "%f" %l:%v %m',
        \ 'process_output': function('neomake#makers#ft#rust#CargoProcessOutput'),
        \ }
endfunction

function! neomake#makers#ft#rust#CargoProcessOutput(context) abort
    let errors = []
    for line in a:context['output']
        if line[0] !=# '{'
            continue
        endif

        let decoded = neomake#utils#JSONdecode(line)
        let data = get(decoded, 'message', -1)
        if type(data) != type({}) || !len(data['spans'])
            continue
        endif

        let error = {'maker_name': 'cargo'}
        let code_dict = get(data, 'code', -1)
        if code_dict is g:neomake#compat#json_null
            if get(data, 'level', '') ==# 'warning'
                let error.type = 'W'
            else
                let error.type = 'E'
{'fraction_non_alphanumeric': 0.2050865800865801, 'fraction_numerical': 0.003246753246753247, 'mean_word_length': 1.7651458489154823, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2958454', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1266, 'n_words': 257}