mirror of https://github.com/dense-analysis/ale
Fix #1039 - Only check the file on disk for dartanalyzer
This commit is contained in:
parent
6490d3a5e6
commit
d4d939bea9
|
@ -86,7 +86,7 @@ formatting.
|
|||
| CSS | [csslint](http://csslint.net/), [stylelint](https://github.com/stylelint/stylelint), [prettier](https://github.com/prettier/prettier) |
|
||||
| Cython (pyrex filetype) | [cython](http://cython.org/) |
|
||||
| D | [dmd](https://dlang.org/dmd-linux.html) |
|
||||
| Dart | [dartanalyzer](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) |
|
||||
| Dart | [dartanalyzer](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) !! |
|
||||
| Dockerfile | [hadolint](https://github.com/lukasmartinelli/hadolint) |
|
||||
| Elixir | [credo](https://github.com/rrrene/credo), [dogma](https://github.com/lpil/dogma) !! |
|
||||
| Elm | [elm-format](https://github.com/avh4/elm-format), [elm-make](https://github.com/elm-lang/elm-make) |
|
||||
|
|
|
@ -13,7 +13,7 @@ function! ale_linters#dart#dartanalyzer#GetCommand(buffer) abort
|
|||
|
||||
return ale#Escape(l:executable)
|
||||
\ . (!empty(l:path) ? ' --packages ' . ale#Escape(l:path) : '')
|
||||
\ . ' %t'
|
||||
\ . ' %s'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#dart#dartanalyzer#Handle(buffer, lines) abort
|
||||
|
@ -37,4 +37,5 @@ call ale#linter#Define('dart', {
|
|||
\ 'executable_callback': 'ale_linters#dart#dartanalyzer#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#dart#dartanalyzer#GetCommand',
|
||||
\ 'callback': 'ale_linters#dart#dartanalyzer#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
|
|
@ -20,6 +20,8 @@ If you have installed Dart on Linux, you can also try the following: >
|
|||
... or similarly for wherever your Dart SDK lives. This should work without
|
||||
having to modify `$PATH`.
|
||||
|
||||
ALE can only check for problems with `dartanalyzer` with the file on disk.
|
||||
See |ale-lint-file-linters|
|
||||
|
||||
Options
|
||||
-------------------------------------------------------------------------------
|
||||
|
|
|
@ -267,7 +267,7 @@ Notes:
|
|||
* CSS: `csslint`, `stylelint`, `prettier`
|
||||
* Cython (pyrex filetype): `cython`
|
||||
* D: `dmd`
|
||||
* Dart: `dartanalyzer`
|
||||
* Dart: `dartanalyzer`!!
|
||||
* Dockerfile: `hadolint`
|
||||
* Elixir: `credo`, `dogma`!!
|
||||
* Elm: `elm-format, elm-make`
|
||||
|
|
|
@ -17,7 +17,7 @@ Execute(The default command and executable should be correct):
|
|||
\ 'dartanalyzer',
|
||||
\ ale_linters#dart#dartanalyzer#GetExecutable(bufnr(''))
|
||||
AssertEqual
|
||||
\ ale#Escape('dartanalyzer') . ' %t',
|
||||
\ ale#Escape('dartanalyzer') . ' %s',
|
||||
\ ale_linters#dart#dartanalyzer#GetCommand(bufnr(''))
|
||||
|
||||
Execute(The executable should be configurable):
|
||||
|
@ -27,7 +27,7 @@ Execute(The executable should be configurable):
|
|||
\ '/usr/lib/dart/bin/dartanalyzer',
|
||||
\ ale_linters#dart#dartanalyzer#GetExecutable(bufnr(''))
|
||||
AssertEqual
|
||||
\ ale#Escape('/usr/lib/dart/bin/dartanalyzer') . ' %t',
|
||||
\ ale#Escape('/usr/lib/dart/bin/dartanalyzer') . ' %s',
|
||||
\ ale_linters#dart#dartanalyzer#GetCommand(bufnr(''))
|
||||
|
||||
Execute(The .packages file should be set if detected):
|
||||
|
@ -36,5 +36,5 @@ Execute(The .packages file should be set if detected):
|
|||
AssertEqual
|
||||
\ ale#Escape('dartanalyzer')
|
||||
\ . ' --packages ' . ale#Escape(ale#path#Winify(g:dir . '/dart_paths/.packages'))
|
||||
\ . ' %t',
|
||||
\ . ' %s',
|
||||
\ ale_linters#dart#dartanalyzer#GetCommand(bufnr(''))
|
||||
|
|
Loading…
Reference in New Issue