mirror of
				https://github.com/amix/vimrc
				synced 2025-10-31 14:43:35 +08:00 
			
		
		
		
	Updated plugins
This commit is contained in:
		
							
								
								
									
										34
									
								
								sources_non_forked/ale/ale_linters/clojure/clj_kondo.vim
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								sources_non_forked/ale/ale_linters/clojure/clj_kondo.vim
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,34 @@ | ||||
| " Author: Masashi Iizuka <liquidz.uo@gmail.com> | ||||
| " Description: linter for clojure using clj-kondo https://github.com/borkdude/clj-kondo | ||||
|  | ||||
| function! ale_linters#clojure#clj_kondo#HandleCljKondoFormat(buffer, lines) abort | ||||
|     " output format | ||||
|     " <filename>:<line>:<column>: <issue type>: <message> | ||||
|     let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):(\d+):? ((Exception|error|warning): ?(.+))$' | ||||
|     let l:output = [] | ||||
|  | ||||
|     for l:match in ale#util#GetMatches(a:lines, l:pattern) | ||||
|         let l:type = 'E' | ||||
|  | ||||
|         if l:match[4] is? 'warning' | ||||
|             let l:type = 'W' | ||||
|         endif | ||||
|  | ||||
|         call add(l:output, { | ||||
|         \   'lnum': l:match[1] + 0, | ||||
|         \   'col': l:match[2] + 0, | ||||
|         \   'text': l:match[3], | ||||
|         \   'type': l:type, | ||||
|         \}) | ||||
|     endfor | ||||
|  | ||||
|     return l:output | ||||
| endfunction | ||||
|  | ||||
| call ale#linter#Define('clojure', { | ||||
| \   'name': 'clj-kondo', | ||||
| \   'output_stream': 'stdout', | ||||
| \   'executable': 'clj-kondo', | ||||
| \   'command': 'clj-kondo --lint %t', | ||||
| \   'callback': 'ale_linters#clojure#clj_kondo#HandleCljKondoFormat', | ||||
| \}) | ||||
		Reference in New Issue
	
	Block a user
	 Amir Salihefendic
					Amir Salihefendic