From d4d939bea9a51f13fb78a5ab1d7367866a180768 Mon Sep 17 00:00:00 2001 From: w0rp Date: Thu, 26 Oct 2017 23:31:07 +0100 Subject: [PATCH] Fix #1039 - Only check the file on disk for dartanalyzer --- README.md | 2 +- ale_linters/dart/dartanalyzer.vim | 3 ++- doc/ale-dart.txt | 2 ++ doc/ale.txt | 2 +- .../test_dartanalyzer_command_callback.vader | 6 +++--- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 10c63b86..7d154ce1 100644 --- a/README.md +++ b/README.md @@ -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) | diff --git a/ale_linters/dart/dartanalyzer.vim b/ale_linters/dart/dartanalyzer.vim index f7b82c4b..ef33c9d4 100644 --- a/ale_linters/dart/dartanalyzer.vim +++ b/ale_linters/dart/dartanalyzer.vim @@ -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, \}) diff --git a/doc/ale-dart.txt b/doc/ale-dart.txt index 37ba6fa0..c6faa5c2 100644 --- a/doc/ale-dart.txt +++ b/doc/ale-dart.txt @@ -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 ------------------------------------------------------------------------------- diff --git a/doc/ale.txt b/doc/ale.txt index 8aea7f80..fb5a6348 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -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` diff --git a/test/command_callback/test_dartanalyzer_command_callback.vader b/test/command_callback/test_dartanalyzer_command_callback.vader index dbd8290c..6685ab4a 100644 --- a/test/command_callback/test_dartanalyzer_command_callback.vader +++ b/test/command_callback/test_dartanalyzer_command_callback.vader @@ -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(''))