mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Removed syntastic and replaced it with ale
Read more here: https://github.com/w0rp/ale
This commit is contained in:
11
sources_non_forked/ale/ale_linters/markdown/alex.vim
Normal file
11
sources_non_forked/ale/ale_linters/markdown/alex.vim
Normal file
@ -0,0 +1,11 @@
|
||||
" Author: Johannes Wienke <languitar@semipol.de>
|
||||
" Description: alex for markdown files
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'alex',
|
||||
\ 'executable': 'alex',
|
||||
\ 'command': 'alex %s -t',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale#handlers#alex#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
11
sources_non_forked/ale/ale_linters/markdown/markdownlint.vim
Normal file
11
sources_non_forked/ale/ale_linters/markdown/markdownlint.vim
Normal file
@ -0,0 +1,11 @@
|
||||
" Author: Ty-Lucas Kelley <tylucaskelley@gmail.com>
|
||||
" Description: Adds support for markdownlint
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'markdownlint',
|
||||
\ 'executable': 'markdownlint',
|
||||
\ 'lint_file': 1,
|
||||
\ 'output_stream': 'both',
|
||||
\ 'command': 'markdownlint %s',
|
||||
\ 'callback': 'ale#handlers#markdownlint#Handle'
|
||||
\ })
|
40
sources_non_forked/ale/ale_linters/markdown/mdl.vim
Normal file
40
sources_non_forked/ale/ale_linters/markdown/mdl.vim
Normal file
@ -0,0 +1,40 @@
|
||||
" Author: Steve Dignam <steve@dignam.xyz>, Josh Leeb-du Toit <joshleeb.com>
|
||||
" Description: Support for mdl, a markdown linter.
|
||||
|
||||
call ale#Set('markdown_mdl_executable', 'mdl')
|
||||
call ale#Set('markdown_mdl_options', '')
|
||||
|
||||
function! ale_linters#markdown#mdl#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'markdown_mdl_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#markdown#mdl#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#markdown#mdl#GetExecutable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'markdown_mdl_options')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#markdown#mdl#Handle(buffer, lines) abort
|
||||
" matches: '(stdin):173: MD004 Unordered list style'
|
||||
let l:pattern = ':\(\d*\): \(.*\)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'text': l:match[2],
|
||||
\ 'type': 'W',
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'mdl',
|
||||
\ 'executable_callback': 'ale_linters#markdown#mdl#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#markdown#mdl#GetCommand',
|
||||
\ 'callback': 'ale_linters#markdown#mdl#Handle'
|
||||
\})
|
@ -0,0 +1,9 @@
|
||||
" Author: poohzrn https://github.com/poohzrn
|
||||
" Description: proselint for Markdown files
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'proselint',
|
||||
\ 'executable': 'proselint',
|
||||
\ 'command': 'proselint %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
9
sources_non_forked/ale/ale_linters/markdown/redpen.vim
Normal file
9
sources_non_forked/ale/ale_linters/markdown/redpen.vim
Normal file
@ -0,0 +1,9 @@
|
||||
" Author: rhysd https://rhysd.github.io
|
||||
" Description: Redpen, a proofreading tool (http://redpen.cc)
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'redpen',
|
||||
\ 'executable': 'redpen',
|
||||
\ 'command': 'redpen -f markdown -r json %t',
|
||||
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
|
||||
\})
|
34
sources_non_forked/ale/ale_linters/markdown/remark_lint.vim
Normal file
34
sources_non_forked/ale/ale_linters/markdown/remark_lint.vim
Normal file
@ -0,0 +1,34 @@
|
||||
" Author rhysd https://rhysd.github.io/, Dirk Roorda (dirkroorda), Adrián González Rus (@adrigzr)
|
||||
" Description: remark-lint for Markdown files
|
||||
|
||||
function! ale_linters#markdown#remark_lint#Handle(buffer, lines) abort
|
||||
" matches: ' 1:4 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint'
|
||||
" matches: ' 18:71-19:1 error Missing new line after list item list-item-spacing remark-lint',
|
||||
let l:pattern = '^ \+\(\d\+\):\(\d\+\)\(-\(\d\+\):\(\d\+\)\)\? \(warning\|error\) \(.\+\)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:item = {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'col': l:match[2] + 0,
|
||||
\ 'type': l:match[6] is# 'error' ? 'E' : 'W',
|
||||
\ 'text': l:match[7],
|
||||
\}
|
||||
if l:match[3] isnot# ''
|
||||
let l:item.end_lnum = l:match[4] + 0
|
||||
let l:item.end_col = l:match[5] + 0
|
||||
endif
|
||||
call add(l:output, l:item)
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'remark-lint',
|
||||
\ 'executable': 'remark',
|
||||
\ 'command': 'remark --no-stdout --no-color %s',
|
||||
\ 'callback': 'ale_linters#markdown#remark_lint#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\ 'output_stream': 'stderr',
|
||||
\})
|
9
sources_non_forked/ale/ale_linters/markdown/textlint.vim
Normal file
9
sources_non_forked/ale/ale_linters/markdown/textlint.vim
Normal file
@ -0,0 +1,9 @@
|
||||
" Author: tokida https://rouger.info, Yasuhiro Kiyota <yasuhiroki.duck@gmail.com>
|
||||
" Description: textlint, a proofreading tool (https://textlint.github.io/)
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'textlint',
|
||||
\ 'executable_callback': 'ale#handlers#textlint#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#textlint#GetCommand',
|
||||
\ 'callback': 'ale#handlers#textlint#HandleTextlintOutput',
|
||||
\})
|
9
sources_non_forked/ale/ale_linters/markdown/vale.vim
Normal file
9
sources_non_forked/ale/ale_linters/markdown/vale.vim
Normal file
@ -0,0 +1,9 @@
|
||||
" Author: chew-z https://github.com/chew-z
|
||||
" Description: vale for Markdown files
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'vale',
|
||||
\ 'executable': 'vale',
|
||||
\ 'command': 'vale --output=JSON %t',
|
||||
\ 'callback': 'ale#handlers#vale#Handle',
|
||||
\})
|
@ -0,0 +1,9 @@
|
||||
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||
" Description: write-good for Markdown files
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'write-good',
|
||||
\ 'executable_callback': 'ale#handlers#writegood#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#writegood#GetCommand',
|
||||
\ 'callback': 'ale#handlers#writegood#Handle',
|
||||
\})
|
Reference in New Issue
Block a user