mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
* feat: Add Zig zlint linter and handler for ALE * docs: Add zlint documentation to ALE Zig integration guide * docs: Updating docs for zlint support * tests: Adding tests for checking zlint executable and command * refactor: Move zlint configuration test to separate test file
45 lines
1.1 KiB
Plaintext
45 lines
1.1 KiB
Plaintext
Before:
|
|
runtime ale_linters/zig/zlint.vim
|
|
|
|
After:
|
|
call ale#linter#Reset()
|
|
|
|
Execute(The zlint handler should parse GitHub Actions format correctly):
|
|
" Create a temporary buffer
|
|
let buffer = bufnr('')
|
|
|
|
" Define input lines
|
|
let input_lines = [
|
|
\ '::warning file=test.zig,line=61,col=47,title=unsafe-undefined::`undefined` is missing a safety comment',
|
|
\ '',
|
|
\ '::error file=test2.zig,line=4,col=33,title=no-unresolved::Unresolved import to ''test3.zig''',
|
|
\ '',
|
|
\ ]
|
|
|
|
" Define expected output
|
|
let expected_output = [
|
|
\ {
|
|
\ 'filename': 'test.zig',
|
|
\ 'lnum': 61,
|
|
\ 'col': 47,
|
|
\ 'text': '`undefined` is missing a safety comment',
|
|
\ 'type': 'W',
|
|
\ 'code': 'unsafe-undefined'
|
|
\ },
|
|
\ {
|
|
\ 'filename': 'test2.zig',
|
|
\ 'lnum': 4,
|
|
\ 'col': 33,
|
|
\ 'text': 'Unresolved import to ''test3.zig''',
|
|
\ 'type': 'E',
|
|
\ 'code': 'no-unresolved'
|
|
\ },
|
|
\ ]
|
|
|
|
" Get actual output
|
|
let actual_output = ale_linters#zig#zlint#Handle(buffer, input_lines)
|
|
|
|
" Assert equality
|
|
AssertEqual expected_output, actual_output
|
|
|