Skip to content

Commit

Permalink
checkstyle: support 'info' level
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanueltouzery committed Oct 9, 2024
1 parent 27f44d1 commit 8b44409
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lua/lint/linters/checkstyle.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local format = '[%tRROR] %f:%l:%c: %m, [%tRROR] %f:%l: %m, [%tARN] %f:%l:%c: %m, [%tARN] %f:%l: %m'
local format = '[%tRROR] %f:%l:%c: %m, [%tRROR] %f:%l: %m, [%tARN] %f:%l:%c: %m, [%tARN] %f:%l: %m, [%tNFO] %f:%l:%c: %m, [%tNFO] %f:%l: %m'

local M

Expand Down
13 changes: 12 additions & 1 deletion tests/checkstyle_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,22 @@ Starting audit...
[WARN] src/main/java/com/foo/bar/ApiClient.java:75:1: 'member def modifier' has incorrect indentation level 0, expected level should be 2. [Indentation]
[ERROR] src/main/java/com/foo/bar/ApiClient.java:187: Line is longer than 120 characters (found 143). [LineLength]
[ERROR] src/main/java/com/foo/bar/ApiClient.java:6:3: 'method def' child has incorrect indentation level 2, expected level should be 4. [Indentation]
[INFO] src/main/java/com/foo/bar/ApiClient.java:6:3: 'method def' child has incorrect indentation level 2, expected level should be 4. [Indentation]
Audit done.
Checkstyle ends with 1 errors.
]])
assert.are.same(3, #result)
assert.are.same(4, #result)
local expected = {
source = 'checkstyle',
message = "'method def' child has incorrect indentation level 2, expected level should be 4. [Indentation]",
lnum = 5,
col = 2,
end_lnum = 5,
end_col = 2,
severity = vim.diagnostic.severity.INFO,
}
assert.are.same(expected, result[4])
expected = {
source = 'checkstyle',
message = "'method def' child has incorrect indentation level 2, expected level should be 4. [Indentation]",
lnum = 5,
Expand Down

0 comments on commit 8b44409

Please sign in to comment.