File tree Expand file tree Collapse file tree
lua/guard-collection/linter Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ return {
2+ cmd = ' buf' ,
3+ args = { ' lint' , ' --error-format=json' },
4+ fname = true ,
5+ parse = require (' guard.lint' ).from_json ({
6+ lines = true ,
7+ attributes = {
8+ lnum = ' start_line' ,
9+ col = ' start_column' ,
10+ end_lnum = ' end_line' ,
11+ end_col = ' end_column' ,
12+ code = ' type' ,
13+ message = ' message' ,
14+ },
15+ source = ' buf' ,
16+ }),
17+ }
Original file line number Diff line number Diff line change 11return {
2+ buf = require (' guard-collection.linter.buf' ),
23 checkmake = require (' guard-collection.linter.checkmake' ),
34 [' clang-tidy' ] = require (' guard-collection.linter.clang-tidy' ),
45 codespell = require (' guard-collection.linter.codespell' ),
Original file line number Diff line number Diff line change 1+ describe (' buf' , function ()
2+ it (' can lint' , function ()
3+ local helper = require (' test.linter.helper' )
4+ local ns = helper .namespace
5+ local ft = require (' guard.filetype' )
6+ ft (' proto' ):lint (' buf' )
7+
8+ local buf , diagnostics = helper .test_with (' proto' , {
9+ [[ syntax = "proto3"; message Foo { string bar = 1 }]] ,
10+ })
11+ assert .are .same ({
12+ {
13+ bufnr = buf ,
14+ col = 48 ,
15+ end_col = 48 ,
16+ end_lnum = 0 ,
17+ lnum = 0 ,
18+ message = " syntax error: expecting ';'" ,
19+ namespace = ns ,
20+ severity = 4 ,
21+ source = ' buf' ,
22+ },
23+ }, diagnostics )
24+ end )
25+ end )
You can’t perform that action at this time.
0 commit comments