From 7e0cdb53ecf9c94bb8777a57de8bf2aacca46b5d Mon Sep 17 00:00:00 2001 From: w0rp Date: Sat, 29 Aug 2020 16:05:49 +0100 Subject: Fix #3247 - Use --always-make for make -n by default --- doc/ale-c.txt | 16 ++++++++++++++++ doc/ale-cpp.txt | 1 + 2 files changed, 17 insertions(+) (limited to 'doc') diff --git a/doc/ale-c.txt b/doc/ale-c.txt index fe28cf4a..b0d94b8e 100644 --- a/doc/ale-c.txt +++ b/doc/ale-c.txt @@ -8,6 +8,17 @@ runs either `clang`, or `gcc`. See |ale-c-cc|. =============================================================================== Global Options +g:ale_c_always_make *g:ale_c_always_make* + *b:ale_c_always_make* + Type: |Number| + Default: `has('unix') && !has('macunix')` + + If set to `1`, use `--always-make` for `make`, which means that output will + always be parsed from `make` dry runs with GNU make. BSD `make` does not + support this option, so you probably want to turn this option off when using + a BSD variant. + + g:ale_c_build_dir_names *g:ale_c_build_dir_names* *b:ale_c_build_dir_names* @@ -58,6 +69,11 @@ g:ale_c_parse_makefile *g:ale_c_parse_makefile* set for C or C++ compilers. This can make it easier to determine the correct build flags to use for different files. + NOTE: When using this option on BSD, you may need to set + |g:ale_c_always_make| to `0`, and `make -n` will not provide consistent + results if binaries have already been built, so use `make clean` when + editing your files. + WARNING: Running `make -n` automatically can execute arbitrary code, even though it's supposed to be a dry run, so enable this option with care. You might prefer to use the buffer-local version of the option instead with diff --git a/doc/ale-cpp.txt b/doc/ale-cpp.txt index 651b4160..17894e6e 100644 --- a/doc/ale-cpp.txt +++ b/doc/ale-cpp.txt @@ -10,6 +10,7 @@ Global Options The following C options also apply to some C++ linters too. +* |g:ale_c_always_make| * |g:ale_c_build_dir_names| * |g:ale_c_build_dir| * |g:ale_c_parse_makefile| -- cgit v1.2.3 From f1ecc2e06828243bb0425036ce2dc3ca36cd114f Mon Sep 17 00:00:00 2001 From: w0rp Date: Sat, 29 Aug 2020 16:31:47 +0100 Subject: Fix psalm options. Retry on some test failures --- doc/ale-php.txt | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) (limited to 'doc') diff --git a/doc/ale-php.txt b/doc/ale-php.txt index 645decd7..9fe868f8 100644 --- a/doc/ale-php.txt +++ b/doc/ale-php.txt @@ -189,42 +189,55 @@ g:ale_php_psalm_executable *g:ale_php_psalm_executable* This variable sets the executable used for psalm. -g:ale_psalm_langserver_options *g:ale_psalm_langserver_options* - *b:ale_psalm_langserver_options* + +g:ale_php_psalm_options *g:ale_php_psalm_options* + *b:ale_php_psalm_options* Type: |String| Default: `''` This variable can be set to pass additional options to psalm. + +g:ale_php_psalm_use_global *g:ale_php_psalm_use_global* + *b:ale_php_psalm_use_global* + Type: |Boolean| + Default: `get(g:, 'ale_use_global_executables', 0)` + + See |ale-integrations-local-executables| + + =============================================================================== -php-cs-fixer *ale-php-php-cs-fixer* +php-cs-fixer *ale-php-php-cs-fixer* -g:ale_php_cs_fixer_executable *g:ale_php_cs_fixer_executable* - *b:ale_php_cs_fixer_executable* +g:ale_php_cs_fixer_executable *g:ale_php_cs_fixer_executable* + *b:ale_php_cs_fixer_executable* Type: |String| Default: `'php-cs-fixer'` This variable sets executable used for php-cs-fixer. -g:ale_php_cs_fixer_use_global *g:ale_php_cs_fixer_use_global* - *b:ale_php_cs_fixer_use_global* - Type: |Boolean| - Default: `get(g:, 'ale_use_global_executables', 0)` - - This variable force globally installed fixer. -g:ale_php_cs_fixer_options *g:ale_php_cs_fixer_options* - *b:ale_php_cs_fixer_options* +g:ale_php_cs_fixer_options *g:ale_php_cs_fixer_options* + *b:ale_php_cs_fixer_options* Type: |String| Default: `''` This variable can be set to pass additional options to php-cs-fixer. + +g:ale_php_cs_fixer_use_global *g:ale_php_cs_fixer_use_global* + *b:ale_php_cs_fixer_use_global* + Type: |Boolean| + Default: `get(g:, 'ale_use_global_executables', 0)` + + See |ale-integrations-local-executables| + + =============================================================================== -php *ale-php-php* +php *ale-php-php* -g:ale_php_php_executable *g:ale_php_php_executable* - *b:ale_php_php_executable* +g:ale_php_php_executable *g:ale_php_php_executable* + *b:ale_php_php_executable* Type: |String| Default: `'php'` -- cgit v1.2.3 From 6e2e51b154d526c1ab0b506bb2110b45421b7a06 Mon Sep 17 00:00:00 2001 From: w0rp Date: Sat, 29 Aug 2020 17:27:53 +0100 Subject: Fix #2971 - Disable automatic completion while 'paste' is active --- doc/ale.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc') diff --git a/doc/ale.txt b/doc/ale.txt index 5ec542f9..be49b6e9 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -463,6 +463,9 @@ is loaded. The delay for completion can be configured with |g:ale_completion_delay|. This setting should not be enabled if you wish to use ALE as a completion source for other plugins. +ALE automatic completion will not work when 'paste' is active. Only set +'paste' when you are copy and pasting text into your buffers. + ALE provides an 'omnifunc' function |ale#completion#OmniFunc| for triggering completion manually with CTRL-X CTRL-O. |i_CTRL-X_CTRL-O| > @@ -729,6 +732,9 @@ g:ale_completion_enabled *g:ale_completion_enabled* This setting should not be enabled if you wish to use ALE as a completion source for other completion plugins. + ALE automatic completion will not work when 'paste' is active. Only set + 'paste' when you are copy and pasting text into your buffers. + A buffer-local version of this setting `b:ale_completion_enabled` can be set to `0` to disable ALE's automatic completion support for a single buffer. ALE's completion support must be enabled globally to be enabled locally. -- cgit v1.2.3 From 303bed6ec131f4046980f0508355d0f4043c9e3a Mon Sep 17 00:00:00 2001 From: w0rp Date: Sat, 29 Aug 2020 20:40:50 +0100 Subject: #2107 - Document completion fallbacks and insert-completion trick --- doc/ale.txt | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'doc') diff --git a/doc/ale.txt b/doc/ale.txt index be49b6e9..f7fae380 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -466,12 +466,53 @@ use ALE as a completion source for other plugins. ALE automatic completion will not work when 'paste' is active. Only set 'paste' when you are copy and pasting text into your buffers. +ALE automatic completion will interfere with default insert completion with +`CTRL-N` and so on (|compl-vim|). You can write your own keybinds and a +function in your |vimrc| file to force insert completion instead, like so: > + + function! SmartInsertCompletion() abort + " Use the default CTRL-N in completion menus + if pumvisible() + return "\" + endif + + " Exit and re-enter insert mode, and use insert completion + return "\a\" + endfunction + + inoremap =SmartInsertCompletion() +< ALE provides an 'omnifunc' function |ale#completion#OmniFunc| for triggering completion manually with CTRL-X CTRL-O. |i_CTRL-X_CTRL-O| > " Use ALE's function for omnicompletion. set omnifunc=ale#completion#OmniFunc < + *ale-completion-fallback* + +You can write your own completion function and fallback on other methods of +completion by checking if there are no results that ALE can determine. For +example, for Python code, you could fall back on the `python3complete` +function. > + + function! TestCompletionFunc(findstart, base) abort + let l:result = ale#completion#OmniFunc(a:findstart, a:base) + + " Check if ALE couldn't find anything. + if (a:findstart && l:result is -3) + \|| (!a:findstart && empty(l:result)) + " Defer to another omnifunc if ALE couldn't find anything. + return python3complete#Complete(a:findstart, a:base) + endif + + return l:result + endfunction + + set omnifunc=TestCompletionFunc +< +See |complete-functions| for documentation on how to write completion +functions. + ALE will only suggest so many possible matches for completion. The maximum number of items can be controlled with |g:ale_completion_max_suggestions|. -- cgit v1.2.3 From 33202a39f57a9cf75aed5896764976d56cb1ac7a Mon Sep 17 00:00:00 2001 From: w0rp Date: Sat, 29 Aug 2020 20:45:45 +0100 Subject: #2107 - Recommend instead, which avoids autocmd functions --- doc/ale.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/ale.txt b/doc/ale.txt index f7fae380..d45cada7 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -477,7 +477,7 @@ function in your |vimrc| file to force insert completion instead, like so: > endif " Exit and re-enter insert mode, and use insert completion - return "\a\" + return "\a\" endfunction inoremap =SmartInsertCompletion() -- cgit v1.2.3 From 1462de6685d7d71b7adba9f1b5e4f568b40da6b1 Mon Sep 17 00:00:00 2001 From: Konstantin Alekseev Date: Tue, 22 Oct 2019 00:38:54 +0300 Subject: Run flake8 from project root by default. Option `per-file-ignores` was introduced in flake8 version 3.7.0. It allows to ignore specific errors in specific files using glob syntax. For example `per-file-ignores = src/generated/*.py:F401` will ignore `F401` error in all python files in `src/generated`. Thus ale has to run flake8 from project root where .flake8 config is placed otherwise glob won't match linted file. --- doc/ale-python.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/ale-python.txt b/doc/ale-python.txt index 60b0771d..6b1a6d33 100644 --- a/doc/ale-python.txt +++ b/doc/ale-python.txt @@ -169,13 +169,14 @@ flake8 *ale-python-flake8* g:ale_python_flake8_change_directory *g:ale_python_flake8_change_directory* *b:ale_python_flake8_change_directory* - Type: |Number| - Default: `1` + Type: |String| + Default: `project` - If set to `1`, ALE will switch to the directory the Python file being - checked with `flake8` is in before checking it. This helps `flake8` find - configuration files more easily. This option can be turned off if you want - to control the directory Python is executed from yourself. + If set to `project`, ALE will switch to the project root before checking file. + If set to `file`, ALE will switch to directory the Python file being + checked with `flake8` is in before checking it. + You can turn it off with `off` option if you want to control the directory + Python is executed from yourself. g:ale_python_flake8_executable *g:ale_python_flake8_executable* -- cgit v1.2.3