Merge pull request #716 from sobrinho/master
Fix brakeman handler when there is no output
This commit is contained in:
		
						commit
						b2e730fb5e
					
				@ -5,6 +5,10 @@ let g:ale_ruby_brakeman_options =
 | 
			
		||||
\   get(g:, 'ale_ruby_brakeman_options', '')
 | 
			
		||||
 | 
			
		||||
function! ale_linters#ruby#brakeman#Handle(buffer, lines) abort
 | 
			
		||||
    if len(a:lines) == 0
 | 
			
		||||
        return []
 | 
			
		||||
    endif
 | 
			
		||||
 | 
			
		||||
    let l:result = json_decode(join(a:lines, ''))
 | 
			
		||||
 | 
			
		||||
    let l:output = []
 | 
			
		||||
 | 
			
		||||
@ -73,3 +73,9 @@ Execute(The brakeman handler should parse JSON correctly):
 | 
			
		||||
  \    ']',
 | 
			
		||||
  \  '}'
 | 
			
		||||
  \  ])
 | 
			
		||||
 | 
			
		||||
Execute(The brakeman handler should parse JSON correctly when there is no output from brakeman):
 | 
			
		||||
  AssertEqual
 | 
			
		||||
  \ [],
 | 
			
		||||
  \ ale_linters#ruby#brakeman#Handle(347, [
 | 
			
		||||
  \ ])
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user