<commit_before>" Author: <NAME> <<EMAIL>>
" Description: A linter for Vala using Vala-Lint.

function! ale_linters#vala#vala_lint#GetCommand(buffer) abort
    let l:command = 'io.elementary.vala-lint '

    let l:config_path = ale#path#FindNearestFile(a:buffer, 'vala-lint.conf')
    if !empty(l:config_path)
        let l:command .= '-c ' . l:config_path . ' '
    endif

    return l:command . '%s'
endfunction

function! ale_linters#vala#vala_lint#Handle(buffer, lines) abort
    let l:pattern = '^\s*\(\d\+\)\.\(\d\+\)\s\+\(error\|warn\)\s\+\(.\+\)\s\([A-Za-z0-9_\-]\+\)'
    let l:output = []
<commit_msg>support flags for enable/disable config<commit_after>" Author: <NAME> <<EMAIL>>
" Description: A linter for Vala using Vala-Lint.

let g:ale_vala_vala_lint_enable_config = get(g:, 'ale_vala_vala_lint_enable_config', 0)
let g:ale_vala_vala_lint_config_filename = get(g:, 'ale_vala_vala_lint_config_filename', 'vala-lint.conf')

function! ale_linters#vala#vala_lint#GetCommand(buffer) abort
    let l:command = 'io.elementary.vala-lint '

    if ale#Var(a:buffer, 'vala_vala_lint_enable_config')
        let l:config_filename = ale#Var(a:buffer, 'vala_vala_lint_config_filename')
        let l:config_path = ale#path#FindNearestFile(a:buffer, l:config_filename)
        if !empty(l:config_path)
            let l:command .= '-c ' . l:config_path . ' '
        endif
    endif

    return l:command . '%s'
endfunction

function! ale_linters#vala#vala_lint#Handle(buffer, lines) abort
    let l:pattern = '^\s*\(\d\+\)\.\(\d\+\)\s\+\(error\|warn\)\s\+\(.\+\)\s\([A-Za-z0-9_\-]\+\)'
    let l:output = []

{'fraction_non_alphanumeric': 0.18012422360248448, 'fraction_numerical': 0.003105590062111801, 'mean_word_length': 3.794642857142857, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '1981495', 'n_tokens_mistral': 637, 'n_tokens_neox': 626, 'n_words': 104}