remark-lint without saving to disk

This commit is contained in:
Takashi WADA
2018-07-10 22:06:43 +09:00
committed by WADA Takashi
parent f369aa65a2
commit dbf051e62b
3 changed files with 7 additions and 8 deletions

View File

@@ -140,7 +140,7 @@ formatting.
| Lua | [luac](https://www.lua.org/manual/5.1/luac.html), [luacheck](https://github.com/mpeterv/luacheck) | | Lua | [luac](https://www.lua.org/manual/5.1/luac.html), [luacheck](https://github.com/mpeterv/luacheck) |
| Mail | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale) | | Mail | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale) |
| Make | [checkmake](https://github.com/mrtazz/checkmake) | | Make | [checkmake](https://github.com/mrtazz/checkmake) |
| Markdown | [alex](https://github.com/wooorm/alex) !!, [markdownlint](https://github.com/DavidAnson/markdownlint) !!, [mdl](https://github.com/mivok/markdownlint), [prettier](https://github.com/prettier/prettier), [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [remark-lint](https://github.com/wooorm/remark-lint) !!, [textlint](https://textlint.github.io/), [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good) | | Markdown | [alex](https://github.com/wooorm/alex) !!, [markdownlint](https://github.com/DavidAnson/markdownlint) !!, [mdl](https://github.com/mivok/markdownlint), [prettier](https://github.com/prettier/prettier), [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [remark-lint](https://github.com/wooorm/remark-lint), [textlint](https://textlint.github.io/), [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good) |
| MATLAB | [mlint](https://www.mathworks.com/help/matlab/ref/mlint.html) | | MATLAB | [mlint](https://www.mathworks.com/help/matlab/ref/mlint.html) |
| Mercury | [mmc](http://mercurylang.org) !! | | Mercury | [mmc](http://mercurylang.org) !! |
| NASM | [nasm](https://www.nasm.us/) !! | | NASM | [nasm](https://www.nasm.us/) !! |

View File

@@ -16,7 +16,7 @@ function! ale_linters#markdown#remark_lint#GetCommand(buffer) abort
return ale#node#Executable(a:buffer, l:executable) return ale#node#Executable(a:buffer, l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '') \ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' --no-stdout --no-color %s' \ . ' --no-stdout --no-color'
endfunction endfunction
function! ale_linters#markdown#remark_lint#Handle(buffer, lines) abort function! ale_linters#markdown#remark_lint#Handle(buffer, lines) abort
@@ -47,6 +47,5 @@ call ale#linter#Define('markdown', {
\ 'executable_callback': 'ale_linters#markdown#remark_lint#GetExecutable', \ 'executable_callback': 'ale_linters#markdown#remark_lint#GetExecutable',
\ 'command_callback': 'ale_linters#markdown#remark_lint#GetCommand', \ 'command_callback': 'ale_linters#markdown#remark_lint#GetCommand',
\ 'callback': 'ale_linters#markdown#remark_lint#Handle', \ 'callback': 'ale_linters#markdown#remark_lint#Handle',
\ 'lint_file': 1,
\ 'output_stream': 'stderr', \ 'output_stream': 'stderr',
\}) \})

View File

@@ -7,19 +7,19 @@ After:
Execute(The default command should be correct): Execute(The default command should be correct):
AssertLinter 'remark', AssertLinter 'remark',
\ ale#Escape('remark') . ' --no-stdout --no-color %s' \ ale#Escape('remark') . ' --no-stdout --no-color'
Execute(The executable should be configurable): Execute(The executable should be configurable):
let b:ale_markdown_remark_lint_executable = 'foobar' let b:ale_markdown_remark_lint_executable = 'foobar'
AssertLinter 'foobar', AssertLinter 'foobar',
\ ale#Escape('foobar') . ' --no-stdout --no-color %s' \ ale#Escape('foobar') . ' --no-stdout --no-color'
Execute(The options should be configurable): Execute(The options should be configurable):
let b:ale_markdown_remark_lint_options = '--something' let b:ale_markdown_remark_lint_options = '--something'
AssertLinter 'remark', AssertLinter 'remark',
\ ale#Escape('remark') . ' --something --no-stdout --no-color %s' \ ale#Escape('remark') . ' --something --no-stdout --no-color'
Execute(The local executable from .bin should be used if available): Execute(The local executable from .bin should be used if available):
call ale#test#SetFilename('remark_lint_paths/with_bin_path/foo.md') call ale#test#SetFilename('remark_lint_paths/with_bin_path/foo.md')
@@ -27,11 +27,11 @@ Execute(The local executable from .bin should be used if available):
AssertLinter AssertLinter
\ ale#path#Simplify(g:dir . '/remark_lint_paths/with_bin_path/node_modules/.bin/remark'), \ ale#path#Simplify(g:dir . '/remark_lint_paths/with_bin_path/node_modules/.bin/remark'),
\ ale#Escape(ale#path#Simplify(g:dir . '/remark_lint_paths/with_bin_path/node_modules/.bin/remark')) \ ale#Escape(ale#path#Simplify(g:dir . '/remark_lint_paths/with_bin_path/node_modules/.bin/remark'))
\ . ' --no-stdout --no-color %s' \ . ' --no-stdout --no-color'
Execute(The global executable should be uesd if the option is set): Execute(The global executable should be uesd if the option is set):
let b:ale_markdown_remark_lint_use_global = 1 let b:ale_markdown_remark_lint_use_global = 1
call ale#test#SetFilename('remark_lint_paths/with_bin_path/foo.md') call ale#test#SetFilename('remark_lint_paths/with_bin_path/foo.md')
AssertLinter 'remark', ale#Escape('remark') AssertLinter 'remark', ale#Escape('remark')
\ . ' --no-stdout --no-color %s' \ . ' --no-stdout --no-color'