Skip to content

Commit af32d47

Browse files
committed
Fix npm-groovy-lint
1 parent ca1da76 commit af32d47

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

ale_linters/groovy/npmgroovylint.vim

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
" Description: Integration of npm-groovy-lint for Groovy files.
33

44
call ale#Set('groovy_npmgroovylint_executable', 'npm-groovy-lint')
5-
call ale#Set('groovy_npmgroovylint_options', '--loglevel warning')
5+
call ale#Set('groovy_npmgroovylint_options', '--noserver')
66

77
function! ale_linters#groovy#npmgroovylint#GetCommand(buffer) abort
88
let l:options = ale#Var(a:buffer, 'groovy_npmgroovylint_options')
@@ -19,9 +19,8 @@ function! ale_linters#groovy#npmgroovylint#Handle(buffer, lines) abort
1919
for [l:filename, l:file] in items(get(l:json, 'files', {}))
2020
for l:error in get(l:file, 'errors', [])
2121
let l:output_line = {
22-
\ 'filename': l:filename,
2322
\ 'lnum': l:error.line,
24-
\ 'text': l:error.msg,
23+
\ 'text': l:error.msg . ' [' . l:error.rule . ']',
2524
\ 'type': toupper(l:error.severity[0]),
2625
\}
2726

test/handler/test_npmgroovylint_handler.vader

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ Execute(The npm-groovy-lint handler should parse JSON):
1111
\ 'col': 0,
1212
\ 'end_col': 1,
1313
\ 'end_lnum': 2,
14-
\ 'filename': 'test2.groovy',
1514
\ 'lnum': 2,
16-
\ 'text': 'Some error message',
15+
\ 'text': 'Some error message [SomeOtherRule]',
1716
\ 'type': 'E',
1817
\ },
1918
\ {
20-
\ 'filename': 'test.groovy',
2119
\ 'lnum': 1,
22-
\ 'text': 'Some warning message',
20+
\ 'text': 'Some warning message [SomeRule]',
2321
\ 'type': 'W',
2422
\ },
2523
\ ],

test/linter/test_npmgroovylint.vader

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ After:
99

1010
Execute(The default npm-groovy-lint command should be correct):
1111
AssertLinter 'npm-groovy-lint',
12-
\ ale#Escape('npm-groovy-lint') . ' --failon none --output json --loglevel warning %t'
12+
\ ale#Escape('npm-groovy-lint') . ' --failon none --output json --noserver %t'
1313

1414
Execute(Default options should be configurable):
1515
let b:ale_groovy_npmgroovylint_options = '--loglevel info'

0 commit comments

Comments
 (0)