diff --git a/sources_non_forked/ale/Dockerfile b/sources_non_forked/ale/Dockerfile
new file mode 100644
index 00000000..e7b0cfb0
--- /dev/null
+++ b/sources_non_forked/ale/Dockerfile
@@ -0,0 +1,27 @@
+FROM testbed/vim:20
+
+RUN install_vim -tag v8.0.0027 -build \
+ -tag v8.2.4693 -build \
+ -tag neovim:v0.2.0 -build \
+ -tag neovim:v0.6.1 -build
+
+ENV PACKAGES="\
+ bash \
+ git \
+ python2 \
+ python3 \
+ py3-pip \
+ grep \
+ sed \
+"
+RUN apk --update add $PACKAGES && \
+ rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
+
+RUN pip install vim-vint==0.3.21
+
+RUN git clone https://github.com/junegunn/vader.vim vader && \
+ cd vader && git checkout c6243dd81c98350df4dec608fa972df98fa2a3af
+
+ARG GIT_VERSION
+LABEL Version=${GIT_VERSION}
+LABEL Name=denseanalysis/ale
diff --git a/sources_non_forked/ale/README.md b/sources_non_forked/ale/README.md
new file mode 100644
index 00000000..793148d7
--- /dev/null
+++ b/sources_non_forked/ale/README.md
@@ -0,0 +1,963 @@
+# Asynchronous Lint Engine [![GitHub Build Status](https://github.com/dense-analysis/ale/workflows/CI/badge.svg)](https://github.com/dense-analysis/ale/actions?query=event%3Apush+workflow%3ACI+branch%3Amaster++) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/r0ef1xu8xjmik58d/branch/master?svg=true)](https://ci.appveyor.com/project/dense-analysis/ale) [![Join the chat at https://gitter.im/vim-ale/Lobby](https://badges.gitter.im/vim-ale/Lobby.svg)](https://gitter.im/vim-ale/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
+
+![ALE Logo by Mark Grealish - https://www.bhalash.com/](https://user-images.githubusercontent.com/3518142/59195920-2c339500-8b85-11e9-9c22-f6b7f69637b8.jpg)
+
+ALE (Asynchronous Lint Engine) is a plugin providing linting (syntax checking
+and semantic errors) in NeoVim 0.2.0+ and Vim 8 while you edit your text files,
+and acts as a Vim [Language Server Protocol](https://langserver.org/) client.
+
+
+
+ALE makes use of NeoVim and Vim 8 job control functions and timers to
+run linters on the contents of text buffers and return errors as
+text is changed in Vim. This allows for displaying warnings and
+errors in files being edited in Vim before files have been saved
+back to a filesystem.
+
+In other words, this plugin allows you to lint while you type.
+
+ALE offers support for fixing code with command line tools in a non-blocking
+manner with the `:ALEFix` feature, supporting tools in many languages, like
+`prettier`, `eslint`, `autopep8`, and more.
+
+ALE acts as a "language client" to support a variety of Language Server Protocol
+features, including:
+
+* Diagnostics (via Language Server Protocol linters)
+* Go To Definition (`:ALEGoToDefinition`)
+* Completion (Built in completion support, or with Deoplete)
+* Finding references (`:ALEFindReferences`)
+* Hover information (`:ALEHover`)
+* Symbol search (`:ALESymbolSearch`)
+
+If you don't care about Language Server Protocol, ALE won't load any of the code
+for working with it unless needed. One of ALE's general missions is that you
+won't pay for the features that you don't use.
+
+**Help Wanted:** If you would like to help maintain this plugin by managing the
+many issues and pull requests that are submitted, please send the author an
+email at [dev@w0rp.com](mailto:dev@w0rp.com?subject=Helping%20with%20ALE).
+
+If you enjoy this plugin, feel free to contribute or check out the author's
+other content at [w0rp.com](https://w0rp.com).
+
+## Table of Contents
+
+1. [Supported Languages and Tools](#supported-languages)
+2. [Usage](#usage)
+ 1. [Linting](#usage-linting)
+ 2. [Fixing](#usage-fixing)
+ 3. [Completion](#usage-completion)
+ 4. [Go To Definition](#usage-go-to-definition)
+ 5. [Find References](#usage-find-references)
+ 6. [Hovering](#usage-hover)
+ 7. [Symbol Search](#usage-symbol-search)
+ 8. [Refactoring: Rename, Actions](#usage-refactoring)
+3. [Installation](#installation)
+ 1. [Installation with Vim package management](#standard-installation)
+ 2. [Installation with Pathogen](#installation-with-pathogen)
+ 3. [Installation with Vundle](#installation-with-vundle)
+ 4. [Installation with Vim-Plug](#installation-with-vim-plug)
+4. [Contributing](#contributing)
+5. [FAQ](#faq)
+ 1. [How do I disable particular linters?](#faq-disable-linters)
+ 2. [How can I see what ALE has configured for the current file?](#faq-get-info)
+ 3. [How can I use ALE and coc.nvim together?](#faq-coc-nvim)
+ 4. [How can I keep the sign gutter open?](#faq-keep-signs)
+ 5. [How can I change the signs ALE uses?](#faq-change-signs)
+ 6. [How can I change or disable the highlights ALE uses?](#faq-change-highlights)
+ 7. [How can I show errors or warnings in my statusline?](#faq-statusline)
+ 8. [How can I show errors or warnings in my lightline?](#faq-lightline)
+ 9. [How can I change the format for echo messages?](#faq-echo-format)
+ 10. [How can I execute some code when ALE starts or stops linting?](#faq-autocmd)
+ 11. [How can I navigate between errors quickly?](#faq-navigation)
+ 12. [How can I run linters only when I save files?](#faq-lint-on-save)
+ 13. [How can I use the quickfix list instead of the loclist?](#faq-quickfix)
+ 14. [How can I check JSX files with both stylelint and eslint?](#faq-jsx-stylelint-eslint)
+ 15. [How can I check Vue files with ESLint?](#faq-vue-eslint)
+ 16. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
+ 17. [How can I configure my C or C++ project?](#faq-c-configuration)
+ 18. [How can I configure ALE differently for different buffers?](#faq-buffer-configuration)
+ 19. [How can I configure the height of the list in which ALE displays errors?](#faq-list-window-height)
+ 20. [How can I run linters or fixers via Docker or a VM?](#faq-vm)
+ 21. [How can I change the borders for floating preview windows?](#faq-window-borders)
+ 22. [How can I use ALE and vim-lsp together?](#faq-vim-lsp)
+
+
+
+## 1. Supported Languages and Tools
+
+ALE supports a wide variety of languages and tools. See the
+[full list](supported-tools.md) in the
+[Supported Languages and Tools](supported-tools.md) page.
+
+
+
+## 2. Usage
+
+
+
+### 2.i Linting
+
+Once this plugin is installed, while editing your files in supported
+languages and tools which have been correctly installed,
+this plugin will send the contents of your text buffers to a variety of
+programs for checking the syntax and semantics of your programs. By default,
+linters will be re-run in the background to check your syntax when you open
+new buffers or as you make edits to your files.
+
+The behavior of linting can be configured with a variety of options,
+documented in [the Vim help file](doc/ale.txt). For more information on the
+options ALE offers, consult `:help ale-options` for global options and `:help
+ale-integration-options` for options specified to particular linters.
+
+
+
+### 2.ii Fixing
+
+ALE can fix files with the `ALEFix` command. Functions need to be configured
+either in each buffer with a `b:ale_fixers`, or globally with `g:ale_fixers`.
+
+The recommended way to configure fixers is to define a List in an ftplugin file.
+
+```vim
+" In ~/.vim/ftplugin/javascript.vim, or somewhere similar.
+
+" Fix files with prettier, and then ESLint.
+let b:ale_fixers = ['prettier', 'eslint']
+" Equivalent to the above.
+let b:ale_fixers = {'javascript': ['prettier', 'eslint']}
+```
+
+You can also configure your fixers from vimrc using `g:ale_fixers`, before or
+after ALE has been loaded.
+
+A `*` in place of the filetype will apply a List of fixers to all files which
+do not match some filetype in the Dictionary.
+
+Note that using a plain List for `g:ale_fixers` is not supported.
+
+```vim
+" In ~/.vim/vimrc, or somewhere similar.
+let g:ale_fixers = {
+\ '*': ['remove_trailing_lines', 'trim_whitespace'],
+\ 'javascript': ['eslint'],
+\}
+```
+
+If you want to automatically fix files when you save them, you need to turn
+a setting on in vimrc.
+
+```vim
+" Set this variable to 1 to fix files when you save them.
+let g:ale_fix_on_save = 1
+```
+
+The `:ALEFixSuggest` command will suggest some supported tools for fixing code.
+Both `g:ale_fixers` and `b:ale_fixers` can also accept functions, including
+lambda functions, as fixers, for fixing files with custom tools.
+
+See `:help ale-fix` for complete information on how to fix files with ALE.
+
+
+
+### 2.iii Completion
+
+ALE offers some support for completion via hijacking of omnicompletion while you
+type. All of ALE's completion information must come from Language Server
+Protocol linters, or from `tsserver` for TypeScript.
+
+ALE integrates with [Deoplete](https://github.com/Shougo/deoplete.nvim) as a
+completion source, named `'ale'`. You can configure Deoplete to only use ALE as
+the source of completion information, or mix it with other sources.
+
+```vim
+" Use ALE and also some plugin 'foobar' as completion sources for all code.
+call deoplete#custom#option('sources', {
+\ '_': ['ale', 'foobar'],
+\})
+```
+
+ALE also offers its own automatic completion support, which does not require any
+other plugins, and can be enabled by changing a setting before ALE is loaded.
+
+```vim
+" Enable completion where available.
+" This setting must be set before ALE is loaded.
+"
+" You should not turn this setting on if you wish to use ALE as a completion
+" source for other completion plugins, like Deoplete.
+let g:ale_completion_enabled = 1
+```
+
+ALE provides an omni-completion function you can use for triggering
+completion manually with ``.
+
+```vim
+set omnifunc=ale#completion#OmniFunc
+```
+
+ALE supports automatic imports from external modules. This behavior is enabled
+by default and can be disabled by setting:
+
+```vim
+let g:ale_completion_autoimport = 0
+```
+
+Note that disabling auto import can result in missing completion items from some
+LSP servers (e.g. eclipselsp). See `:help ale-completion` for more information.
+
+
+
+### 2.iv Go To Definition
+
+ALE supports jumping to the definition of words under your cursor with the
+`:ALEGoToDefinition` command using any enabled Language Server Protocol linters
+and `tsserver`.
+
+See `:help ale-go-to-definition` for more information.
+
+
+
+### 2.v Find References
+
+ALE supports finding references for words under your cursor with the
+`:ALEFindReferences` command using any enabled Language Server Protocol linters
+and `tsserver`.
+
+See `:help ale-find-references` for more information.
+
+
+
+### 2.vi Hovering
+
+ALE supports "hover" information for printing brief information about symbols at
+the cursor taken from Language Server Protocol linters and `tsserver` with the
+`ALEHover` command.
+
+Truncated information will be displayed when the cursor rests on a symbol by
+default, as long as there are no problems on the same line.
+
+The information can be displayed in a `balloon` tooltip in Vim or GVim by
+hovering your mouse over symbols. Mouse hovering is enabled by default in GVim,
+and needs to be configured for Vim 8.1+ in terminals.
+
+See `:help ale-hover` for more information.
+
+
+
+### 2.vii Symbol Search
+
+ALE supports searching for workspace symbols via Language Server Protocol
+linters with the `ALESymbolSearch` command.
+
+Search queries can be performed to find functions, types, and more which are
+similar to a given query string.
+
+See `:help ale-symbol-search` for more information.
+
+
+
+### 2.viii Refactoring: Rename, Actions
+
+ALE supports renaming symbols in symbols in code such as variables or class
+names with the `ALERename` command.
+
+`ALEFileRename` will rename file and fix import paths (tsserver
+only).
+
+`ALECodeAction` will execute actions on the cursor or applied to a visual
+range selection, such as automatically fixing errors.
+
+See `:help ale-refactor` for more information.
+
+
+
+## 3. Installation
+
+To install this plugin, you should use one of the following methods.
+For Windows users, replace usage of the Unix `~/.vim` directory with
+`%USERPROFILE%\vimfiles`, or another directory if you have configured
+Vim differently. On Windows, your `~/.vimrc` file will be similarly
+stored in `%USERPROFILE%\_vimrc`.
+
+
+
+### 3.i. Installation with Vim package management
+
+In Vim 8 and NeoVim, you can install plugins easily without needing to use
+any other tools. Simply clone the plugin into your `pack` directory.
+
+#### Vim 8 on Unix
+
+```bash
+mkdir -p ~/.vim/pack/git-plugins/start
+git clone --depth 1 https://github.com/dense-analysis/ale.git ~/.vim/pack/git-plugins/start/ale
+```
+
+#### NeoVim on Unix
+
+```bash
+mkdir -p ~/.local/share/nvim/site/pack/git-plugins/start
+git clone --depth 1 https://github.com/dense-analysis/ale.git ~/.local/share/nvim/site/pack/git-plugins/start/ale
+```
+
+#### Vim 8 on Windows
+
+```bash
+# Run these commands in the "Git for Windows" Bash terminal
+mkdir -p ~/vimfiles/pack/git-plugins/start
+git clone --depth 1 https://github.com/dense-analysis/ale.git ~/vimfiles/pack/git-plugins/start/ale
+```
+
+#### Generating Vim help files
+
+You can add the following line to your vimrc files to generate documentation
+tags automatically, if you don't have something similar already, so you can use
+the `:help` command to consult ALE's online documentation:
+
+```vim
+" Put these lines at the very end of your vimrc file.
+
+" Load all plugins now.
+" Plugins need to be added to runtimepath before helptags can be generated.
+packloadall
+" Load all of the helptags now, after plugins have been loaded.
+" All messages and errors will be ignored.
+silent! helptags ALL
+```
+
+
+
+### 3.ii. Installation with Pathogen
+
+To install this module with [Pathogen](https://github.com/tpope/vim-pathogen),
+you should clone this repository to your bundle directory, and ensure
+you have the line `execute pathogen#infect()` in your `~/.vimrc` file.
+You can run the following commands in your terminal to do so:
+
+```bash
+cd ~/.vim/bundle
+git clone https://github.com/dense-analysis/ale.git
+```
+
+
+
+### 3.iii. Installation with Vundle
+
+You can install this plugin using [Vundle](https://github.com/VundleVim/Vundle.vim)
+by adding the GitHub path for this repository to your `~/.vimrc`:
+
+```vim
+Plugin 'dense-analysis/ale'
+```
+
+Then run the command `:PluginInstall` in Vim.
+
+See the Vundle documentation for more information.
+
+
+
+### 3.iiii. Installation with Vim-Plug
+
+You can install this plugin using [Vim-Plug](https://github.com/junegunn/vim-plug)
+by adding the GitHub path for this repository to your `~/.vimrc`:
+
+```vim
+Plug 'dense-analysis/ale'
+```
+
+Then run the command `:PlugInstall` in Vim.
+
+See the Vim-Plug documentation for more information.
+
+
+
+## 4. Contributing
+
+If you would like to see support for more languages and tools, please
+[create an issue](https://github.com/dense-analysis/ale/issues)
+or [create a pull request](https://github.com/dense-analysis/ale/pulls).
+If your tool can read from stdin or you have code to suggest which is good,
+support can be happily added for it.
+
+If you are interested in the general direction of the project, check out the
+[wiki home page](https://github.com/dense-analysis/ale/wiki). The wiki includes
+a Roadmap for the future, and more.
+
+If you'd liked to discuss the project more directly, check out the `#vim-ale` channel
+on Libera Chat. Web chat is available [here](https://web.libera.chat/#vim-ale).
+
+
+
+## 5. FAQ
+
+
+
+### 5.i. How do I disable particular linters?
+
+By default, all available tools for all supported languages will be run. If you
+want to only select a subset of the tools, you can define `b:ale_linters` for a
+single buffer, or `g:ale_linters` globally.
+
+The recommended way to configure linters is to define a List in an ftplugin
+file.
+
+```vim
+" In ~/.vim/ftplugin/javascript.vim, or somewhere similar.
+
+" Enable ESLint only for JavaScript.
+let b:ale_linters = ['eslint']
+
+" Equivalent to the above.
+let b:ale_linters = {'javascript': ['eslint']}
+```
+
+You can also declare which linters you want to run in your vimrc file, before or
+after ALE has been loaded.
+
+```vim
+" In ~/.vim/vimrc, or somewhere similar.
+let g:ale_linters = {
+\ 'javascript': ['eslint'],
+\}
+```
+
+For all languages unspecified in the dictionary, all possible linters will
+be run for those languages, just as when the dictionary is not defined.
+Running many linters should not typically obstruct editing in Vim,
+as they will all be executed in separate processes simultaneously.
+
+If you don't want ALE to run anything other than what you've explicitly asked
+for, you can set `g:ale_linters_explicit` to `1`.
+
+```vim
+" Only run linters named in ale_linters settings.
+let g:ale_linters_explicit = 1
+```
+
+This plugin will look for linters in the [`ale_linters`](ale_linters) directory.
+Each directory within corresponds to a particular filetype in Vim, and each file
+in each directory corresponds to the name of a particular linter.
+
+
+
+### 5.ii. How can I see what ALE has configured for the current file?
+
+Run the following to see what is currently configured:
+
+```vim
+:ALEInfo
+```
+
+
+
+### 5.iii. How can I use ALE and coc.nvim together?
+
+[coc.nvim](https://github.com/neoclide/coc.nvim) is a popular Vim plugin written
+in TypeScript and dependent on the [npm](https://www.npmjs.com/) ecosystem for
+providing full IDE features to Vim. Both ALE and coc.nvim implement
+[Language Server Protocol](https://microsoft.github.io/language-server-protocol/)
+(LSP) clients for supporting diagnostics (linting with a live server), and other
+features like auto-completion, and others listed above.
+
+ALE is primarily focused on integrating with external programs through virtually
+any means, provided the plugin remains almost entirely written in Vim script.
+coc.nvim is primarily focused on bringing IDE features to Vim. If you want to
+run external programs on your files to check for errors, and also use the most
+advanced IDE features, you might want to use both plugins at the same time.
+
+The easiest way to get both plugins to work together is to configure coc.nvim to
+send diagnostics to ALE, so ALE controls how all problems are presented to you,
+and to disable all LSP features in ALE, so ALE doesn't try to provide LSP
+features already provided by coc.nvim, such as auto-completion.
+
+1. Open your coc.nvim configuration file with `:CocConfig` and add
+ `"diagnostic.displayByAle": true` to your settings.
+2. Add `let g:ale_disable_lsp = 1` to your vimrc file, before plugins are
+ loaded.
+
+You can also use `b:ale_disable_lsp` in your ftplugin files to enable or disable
+LSP features in ALE for different filetypes. After you configure coc.nvim and
+ALE this way, you can further configure how problems appear to you by using all
+of the settings mentioned in ALE's help file, including how often diagnostics
+are requested. See `:help ale-lint`.
+
+The integration between ALE and coc.nvim works using an API ALE offers for
+letting any other plugin integrate with ALE. If you are interested in writing a
+similar integration, see `:help ale-lint-other-sources`.
+
+
+
+### 5.iv. How can I keep the sign gutter open?
+
+You can keep the sign gutter open at all times by setting the
+`g:ale_sign_column_always` to 1
+
+```vim
+let g:ale_sign_column_always = 1
+```
+
+
+
+### 5.v. How can I change the signs ALE uses?
+
+Use these options to specify what text should be used for signs:
+
+```vim
+let g:ale_sign_error = '>>'
+let g:ale_sign_warning = '--'
+```
+
+ALE sets some background colors automatically for warnings and errors
+in the sign gutter, with the names `ALEErrorSign` and `ALEWarningSign`.
+These colors can be customised, or even removed completely:
+
+```vim
+highlight clear ALEErrorSign
+highlight clear ALEWarningSign
+```
+
+
+
+### 5.vi. How can I change or disable the highlights ALE uses?
+
+ALE's highlights problems with highlight groups which link to `SpellBad`,
+`SpellCap`, `error`, and `todo` groups by default. The characters that are
+highlighted depend on the linters being used, and the information provided to
+ALE.
+
+Highlighting can be disabled completely by setting `g:ale_set_highlights` to
+`0`.
+
+```vim
+" Set this in your vimrc file to disabling highlighting
+let g:ale_set_highlights = 0
+```
+
+You can control all of the highlights ALE uses, say if you are using a different
+color scheme which produces ugly highlights. For example:
+
+```vim
+highlight ALEWarning ctermbg=DarkMagenta
+```
+
+See `:help ale-highlights` for more information.
+
+
+
+### 5.vii. How can I show errors or warnings in my statusline?
+
+[vim-airline](https://github.com/vim-airline/vim-airline) integrates with ALE
+for displaying error information in the status bar. If you want to see the
+status for ALE in a nice format, it is recommended to use vim-airline with ALE.
+The airline extension can be enabled by adding the following to your vimrc:
+
+```vim
+" Set this. Airline will handle the rest.
+let g:airline#extensions#ale#enabled = 1
+```
+
+If you don't want to use vim-airline, you can implement your own statusline
+function without adding any other plugins. ALE provides some functions to
+assist in this endeavour, including:
+
+* `ale#statusline#Count`: Which returns the number of problems found by ALE
+ for a specified buffer.
+* `ale#statusline#FirstProblem`: Which returns a dictionary containing the
+ full loclist details of the first problem of a specified type found by ALE
+ in a buffer. (e.g. The first style warning in the current buffer.)
+ This can be useful for displaying more detailed information such as the
+ line number of the first problem in a file.
+
+Say you want to display all errors as one figure, and all non-errors as another
+figure. You can do the following:
+
+```vim
+function! LinterStatus() abort
+ let l:counts = ale#statusline#Count(bufnr(''))
+
+ let l:all_errors = l:counts.error + l:counts.style_error
+ let l:all_non_errors = l:counts.total - l:all_errors
+
+ return l:counts.total == 0 ? 'OK' : printf(
+ \ '%dW %dE',
+ \ all_non_errors,
+ \ all_errors
+ \)
+endfunction
+
+set statusline=%{LinterStatus()}
+```
+
+See `:help ale#statusline#Count()` or `:help ale#statusline#FirstProblem()`
+for more information.
+
+
+
+### 5.viii. How can I show errors or warnings in my lightline?
+
+[lightline](https://github.com/itchyny/lightline.vim) does not have built-in
+support for ALE, nevertheless there is a plugin that adds this functionality: [maximbaz/lightline-ale](https://github.com/maximbaz/lightline-ale).
+
+For more information, check out the sources of that plugin, `:help ale#statusline#Count()` and [lightline documentation](https://github.com/itchyny/lightline.vim#advanced-configuration).
+
+
+
+### 5.ix. How can I change the format for echo messages?
+
+There are 3 global options that allow customizing the echoed message.
+
+- `g:ale_echo_msg_format` where:
+ * `%s` is the error message itself
+ * `%...code...%` is an optional error code, and most characters can be
+ written between the `%` characters.
+ * `%linter%` is the linter name
+ * `%severity%` is the severity type
+- `g:ale_echo_msg_error_str` is the string used for error severity.
+- `g:ale_echo_msg_warning_str` is the string used for warning severity.
+
+So for example this:
+
+```vim
+let g:ale_echo_msg_error_str = 'E'
+let g:ale_echo_msg_warning_str = 'W'
+let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
+```
+
+Will give you:
+
+![Echoed message](https://user-images.githubusercontent.com/3518142/59195927-348bd000-8b85-11e9-88b6-508a094f1548.png)
+
+See `:help g:ale_echo_msg_format` for more information.
+
+
+
+### 5.x. How can I execute some code when ALE starts or stops linting?
+
+ALE runs its own [autocmd](http://vimdoc.sourceforge.net/htmldoc/autocmd.html)
+events when a lint or fix cycle are started and stopped. There is also an event
+that runs when a linter job has been successfully started. These events can be
+used to call arbitrary functions during these respective parts of the ALE's
+operation.
+
+```vim
+augroup YourGroup
+ autocmd!
+ autocmd User ALELintPre call YourFunction()
+ autocmd User ALELintPost call YourFunction()
+
+ autocmd User ALEJobStarted call YourFunction()
+
+ autocmd User ALEFixPre call YourFunction()
+ autocmd User ALEFixPost call YourFunction()
+augroup END
+```
+
+
+
+### 5.xi. How can I navigate between errors quickly?
+
+ALE offers some commands with `` keybinds for moving between warnings and
+errors quickly. You can map the keys Ctrl+j and Ctrl+k to moving between errors
+for example:
+
+```vim
+nmap (ale_previous_wrap)
+nmap (ale_next_wrap)
+```
+
+For more information, consult the online documentation with
+`:help ale-navigation-commands`.
+
+
+
+### 5.xii. How can I run linters only when I save files?
+
+ALE offers an option `g:ale_lint_on_save` for enabling running the linters
+when files are saved. This option is enabled by default. If you only
+wish to run linters when files are saved, you can turn the other
+options off.
+
+```vim
+" Write this in your vimrc file
+let g:ale_lint_on_text_changed = 'never'
+let g:ale_lint_on_insert_leave = 0
+" You can disable this option too
+" if you don't want linters to run on opening a file
+let g:ale_lint_on_enter = 0
+```
+
+If for whatever reason you don't wish to run linters again when you save
+files, you can set `g:ale_lint_on_save` to `0`.
+
+
+
+### 5.xiii. How can I use the quickfix list instead of the loclist?
+
+The quickfix list can be enabled by turning the `g:ale_set_quickfix`
+option on. If you wish to also disable the loclist, you can disable
+the `g:ale_set_loclist` option.
+
+```vim
+" Write this in your vimrc file
+let g:ale_set_loclist = 0
+let g:ale_set_quickfix = 1
+```
+
+If you wish to show Vim windows for the loclist or quickfix items
+when a file contains warnings or errors, `g:ale_open_list` can be
+set to `1`. `g:ale_keep_list_window_open` can be set to `1`
+if you wish to keep the window open even after errors disappear.
+
+```vim
+let g:ale_open_list = 1
+" Set this if you want to.
+" This can be useful if you are combining ALE with
+" some other plugin which sets quickfix errors, etc.
+let g:ale_keep_list_window_open = 1
+```
+
+You can also set `let g:ale_list_vertical = 1` to open the windows vertically
+instead of the default horizontally.
+
+
+
+### 5.xiv. How can I check JSX files with both stylelint and eslint?
+
+If you configure ALE options correctly in your vimrc file, and install
+the right tools, you can check JSX files with stylelint and eslint.
+
+First, install eslint and install stylelint with
+[stylelint-processor-styled-components](https://github.com/styled-components/stylelint-processor-styled-components).
+
+Supposing you have installed both tools correctly, configure your .jsx files so
+`jsx` is included in the filetype. You can use an `autocmd` for this.
+
+```vim
+augroup FiletypeGroup
+ autocmd!
+ au BufNewFile,BufRead *.jsx set filetype=javascript.jsx
+augroup END
+```
+
+Supposing the filetype has been set correctly, you can set the following
+options in a jsx.vim ftplugin file.
+
+```vim
+" In ~/.vim/ftplugin/jsx.vim, or somewhere similar.
+let b:ale_linter_aliases = ['css', 'javascript']
+let b:ale_linters = ['stylelint', 'eslint']
+```
+
+Or if you want, you can configure the linters from your vimrc file.
+
+```vim
+" In ~/.vim/vimrc, or somewhere similar.
+let g:ale_linter_aliases = {'jsx': ['css', 'javascript']}
+let g:ale_linters = {'jsx': ['stylelint', 'eslint']}
+```
+
+ALE will alias the `jsx` filetype so it uses the `css` filetype linters, and
+use the original Array of selected linters for `jsx` from the `g:ale_linters`
+object. All available linters will be used for the filetype `javascript`, and
+no linter will be run twice for the same file.
+
+
+
+### 5.xv. How can I check Vue files with ESLint?
+
+To check Vue files with ESLint, your ESLint project configuration file must be
+configured to use the [Vue plugin](https://github.com/vuejs/eslint-plugin-vue).
+After that, you need to configure ALE so it will run the JavaScript ESLint
+linter on your files. The settings you need are similar to the settings needed
+for checking JSX code with both stylelint and ESLint, in the previous section.
+
+```vim
+" In ~/.vim/ftplugin/vue.vim, or somewhere similar.
+
+" Run both javascript and vue linters for vue files.
+let b:ale_linter_aliases = ['javascript', 'vue']
+" Select the eslint and vls linters.
+let b:ale_linters = ['eslint', 'vls']
+```
+
+Run `:ALEInfo` to see which linters are available after telling ALE to run
+JavaScript linters on Vue files. Not all linters support checking Vue files.
+
+If you don't want to configure your linters in ftplugin files for some reason,
+you can configure them from your vimrc file instead.
+
+```vim
+" In ~/.vim/vimrc, or somewhere similar.
+let g:ale_linter_aliases = {'vue': ['vue', 'javascript']}
+let g:ale_linters = {'vue': ['eslint', 'vls']}
+```
+
+
+
+### 5.xvi. Will this plugin eat all of my laptop battery power?
+
+ALE takes advantage of the power of various tools to check your code. This of
+course means that CPU time will be used to continuously check your code. If you
+are concerned about the CPU time ALE will spend, which will of course imply
+some cost to battery life, you can adjust your settings to make your CPU do
+less work.
+
+First, consider increasing the delay before which ALE will run any linters
+while you type. ALE uses a timeout which is cancelled and reset every time you
+type, and this delay can be increased so linters are run less often. See
+`:help g:ale_lint_delay` for more information.
+
+If you don't wish to run linters while you type, you can disable that behavior.
+Set `g:ale_lint_on_text_changed` to `never`. You won't get as frequent error
+checking, but ALE shouldn't block your ability to edit a document after you save
+a file, so the asynchronous nature of the plugin will still be an advantage.
+
+If you are still concerned, you can turn the automatic linting off altogether,
+including the option `g:ale_lint_on_enter`, and you can run ALE manually with
+`:ALELint`.
+
+
+
+### 5.xvii. How can I configure my C or C++ project?
+
+The structure of C and C++ projects varies wildly from project to project, with
+many different build tools being used for building them, and many different
+formats for project configuration files. ALE can run compilers easily, but
+ALE cannot easily detect which compiler flags to use.
+
+Some tools and build configurations can generate
+[compile_commands.json](https://clang.llvm.org/docs/JSONCompilationDatabase.html)
+files. The `cppcheck`, `clangcheck`, `clangtidy` and `cquery` linters can read
+these files for automatically determining the appropriate compiler flags to
+use.
+
+For linting with compilers like `gcc` and `clang`, and with other tools, you
+will need to tell ALE which compiler flags to use yourself. You can use
+different options for different projects with the `g:ale_pattern_options`
+setting. Consult the documentation for that setting for more information.
+`b:ale_linters` can be used to select which tools you want to run, say if you
+want to use only `gcc` for one project, and only `clang` for another.
+
+ALE will attempt to parse `compile_commands.json` files to discover compiler
+flags to use when linting code. See `:help g:ale_c_parse_compile_commands` for
+more information. See Clang's documentation for
+[compile_commands.json files](https://clang.llvm.org/docs/JSONCompilationDatabase.html).
+You should strongly consider generating them in your builds, which is easy to do
+with CMake.
+
+You can also configure ALE to automatically run `make -n` to run dry runs on
+`Makefile`s to discover compiler flags. This can execute arbitrary code, so the
+option is disabled by default. See `:help g:ale_c_parse_makefile`.
+
+You may also configure buffer-local settings for linters with project-specific
+vimrc files. [local_vimrc](https://github.com/LucHermitte/local_vimrc) can be
+used for executing local vimrc files which can be shared in your project.
+
+
+
+### 5.xviii. How can I configure ALE differently for different buffers?
+
+ALE offers various ways to configure which linters or fixers are run, and
+other settings. For the majority of ALE's settings, they can either be
+configured globally with a `g:` variable prefix, or for a specific buffer
+with a `b:` variable prefix. For example, you can configure a Python ftplugin
+file like so.
+
+```vim
+" In ~/.vim/ftplugin/python.vim
+
+" Check Python files with flake8 and pylint.
+let b:ale_linters = ['flake8', 'pylint']
+" Fix Python files with autopep8 and yapf.
+let b:ale_fixers = ['autopep8', 'yapf']
+" Disable warnings about trailing whitespace for Python files.
+let b:ale_warn_about_trailing_whitespace = 0
+```
+
+For configuring files based on regular expression patterns matched against the
+absolute path to a file, you can use `g:ale_pattern_options`.
+
+```vim
+" Do not lint or fix minified files.
+let g:ale_pattern_options = {
+\ '\.min\.js$': {'ale_linters': [], 'ale_fixers': []},
+\ '\.min\.css$': {'ale_linters': [], 'ale_fixers': []},
+\}
+" If you configure g:ale_pattern_options outside of vimrc, you need this.
+let g:ale_pattern_options_enabled = 1
+```
+
+Buffer-local variables for settings always override the global settings.
+
+
+
+### 5.xix. How can I configure the height of the list in which ALE displays errors?
+
+To set a default height for the error list, use the `g:ale_list_window_size` variable.
+
+```vim
+" Show 5 lines of errors (default: 10)
+let g:ale_list_window_size = 5
+```
+
+
+
+### 5.xx. How can I run linters or fixers via Docker or a VM?
+
+ALE supports running linters or fixers via Docker, virtual machines, or in
+combination with any remote machine with a different file system, so long as the
+tools are well-integrated with ALE, and ALE is properly configured to run the
+correct commands and map filename paths between different file systems. See
+`:help ale-lint-other-machines` for the full documentation on how to configure
+ALE to support this.
+
+
+
+### 5.xxi. How can I change the borders for floating preview windows?
+
+Borders for floating preview windows are enabled by default. You can use the
+`g:ale_floating_window_border` setting to configure them.
+
+You could disable the border with an empty list.
+
+```vim
+let g:ale_floating_window_border = []
+```
+
+If the terminal supports Unicode, you might try setting the value like below, to
+make it look nicer.
+
+```vim
+let g:ale_floating_window_border = ['│', '─', '╭', '╮', '╯', '╰']
+```
+
+Since vim's default uses nice unicode characters when possible, you can trick
+ale into using that default with
+
+```vim
+let g:ale_floating_window_border = repeat([''], 6)
+```
+
+
+
+### 5.xxii. How can I use ALE and vim-lsp together?
+
+[vim-lsp](https://github.com/prabirshrestha/vim-lsp) is a popular plugin as
+implementation of Language Server Protocol (LSP) client for Vim. It provides
+all the LSP features including auto completion, diagnostics, go to definitions,
+etc.
+
+ALE also provides LSP support for diagnostics. When you use both ALE and
+vim-lsp, one option is disabling ALE's LSP support by
+`let g:ale_disable_lsp = 1`. However ALE provides integration of external
+programs. Showing errors from language servers by vim-lsp and showing errors
+from other external programs by ALE are confusing and problematic.
+
+[vim-lsp-ale](https://github.com/rhysd/vim-lsp-ale) is a bridge plugin to solve
+the problem when using both ALE and vim-lsp. With the plugin, diagnostics are
+provided by vim-lsp and ALE can handle all the errors. Please read
+[vim-lsp-ale's documentation](https://github.com/rhysd/vim-lsp-ale/blob/master/doc/vim-lsp-ale.txt)
+for more details.
diff --git a/sources_non_forked/ale/ale_linters/ada/cspell.vim b/sources_non_forked/ale/ale_linters/ada/cspell.vim
new file mode 100644
index 00000000..7342d2b6
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/ada/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for Ada files.
+
+call ale#handlers#cspell#DefineLinter('ada')
diff --git a/sources_non_forked/ale/ale_linters/ansible/ansible_lint.vim b/sources_non_forked/ale/ale_linters/ansible/ansible_lint.vim
index 3b443369..d5d98bc4 100644
--- a/sources_non_forked/ale/ale_linters/ansible/ansible_lint.vim
+++ b/sources_non_forked/ale/ale_linters/ansible/ansible_lint.vim
@@ -18,9 +18,30 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, version, lines) abort
endif
endfor
- let l:version_group = ale#semver#GTE(a:version, [5, 0, 0]) ? '>=5.0.0' : '<5.0.0'
+ let l:version_group = ale#semver#GTE(a:version, [6, 0, 0]) ? '>=6.0.0' :
+ \ ale#semver#GTE(a:version, [5, 0, 0]) ? '>=5.0.0' :
+ \ '<5.0.0'
let l:output = []
+ if '>=6.0.0' is# l:version_group
+ let l:error_codes = { 'blocker': 'E', 'critical': 'E', 'major': 'W', 'minor': 'W', 'info': 'I' }
+ let l:linter_issues = json_decode(join(a:lines, ''))
+
+ for l:issue in l:linter_issues
+ if ale#path#IsBufferPath(a:buffer, l:issue.location.path)
+ call add(l:output, {
+ \ 'lnum': exists('l:issue.location.lines.begin.column') ? l:issue.location.lines.begin.line :
+ \ l:issue.location.lines.begin,
+ \ 'col': exists('l:issue.location.lines.begin.column') ? l:issue.location.lines.begin.column : 0,
+ \ 'text': l:issue.check_name,
+ \ 'detail': l:issue.description,
+ \ 'code': l:issue.severity,
+ \ 'type': l:error_codes[l:issue.severity],
+ \})
+ endif
+ endfor
+ endif
+
if '>=5.0.0' is# l:version_group
" Matches patterns line the following:
" test.yml:3:148: syntax-check 'var' is not a valid attribute for a Play
@@ -73,10 +94,13 @@ endfunction
function! ale_linters#ansible#ansible_lint#GetCommand(buffer, version) abort
let l:commands = {
+ \ '>=6.0.0': '%e --nocolor -f json -x yaml %s',
\ '>=5.0.0': '%e --nocolor --parseable-severity -x yaml %s',
\ '<5.0.0': '%e --nocolor -p %t'
\}
- let l:command = ale#semver#GTE(a:version, [5, 0]) ? l:commands['>=5.0.0'] : l:commands['<5.0.0']
+ let l:command = ale#semver#GTE(a:version, [6, 0]) ? l:commands['>=6.0.0'] :
+ \ ale#semver#GTE(a:version, [5, 0]) ? l:commands['>=5.0.0'] :
+ \ l:commands['<5.0.0']
return l:command
endfunction
diff --git a/sources_non_forked/ale/ale_linters/asciidoc/cspell.vim b/sources_non_forked/ale/ale_linters/asciidoc/cspell.vim
new file mode 100644
index 00000000..b228b2e8
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/asciidoc/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for ASCIIDoc files.
+
+call ale#handlers#cspell#DefineLinter('asciidoc')
diff --git a/sources_non_forked/ale/ale_linters/avra/avra.vim b/sources_non_forked/ale/ale_linters/avra/avra.vim
new file mode 100644
index 00000000..edf15c09
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/avra/avra.vim
@@ -0,0 +1,36 @@
+" Author: Utkarsh Verma
+" Description: AVRA linter for avra syntax.
+
+call ale#Set('avra_avra_executable', 'avra')
+call ale#Set('avra_avra_options', '')
+
+function! ale_linters#avra#avra#GetCommand(buffer) abort
+ return '%e'
+ \ . ' %t'
+ \ . ale#Pad(ale#Var(a:buffer, 'avra_avra_options'))
+ \ . ' -o ' . g:ale#util#nul_file
+endfunction
+
+function! ale_linters#avra#avra#Handle(buffer, lines) abort
+ " Note that we treat 'fatal' as errors.
+ let l:pattern = '^\S\+(\(\d\+\))\s\+:\s\+\(\S\+\)\s\+:\s\+\(.\+\)$'
+ let l:output = []
+
+ for l:match in ale#util#GetMatches(a:lines, l:pattern)
+ call add(l:output, {
+ \ 'lnum': l:match[1] + 0,
+ \ 'type': l:match[2] =~? 'Error' ? 'E' : 'W',
+ \ 'text': l:match[3],
+ \})
+ endfor
+
+ return l:output
+endfunction
+
+call ale#linter#Define('avra', {
+\ 'name': 'avra',
+\ 'output_stream': 'stderr',
+\ 'executable': {b -> ale#Var(b, 'avra_avra_executable')},
+\ 'command': function('ale_linters#avra#avra#GetCommand'),
+\ 'callback': 'ale_linters#avra#avra#Handle',
+\})
diff --git a/sources_non_forked/ale/ale_linters/awk/gawk.vim b/sources_non_forked/ale/ale_linters/awk/gawk.vim
index f795c57d..fe961ae3 100644
--- a/sources_non_forked/ale/ale_linters/awk/gawk.vim
+++ b/sources_non_forked/ale/ale_linters/awk/gawk.vim
@@ -9,8 +9,9 @@ function! ale_linters#awk#gawk#GetCommand(buffer) abort
" gawk from attempting to execute the body of the script
" it is linting.
return '%e --source ' . ale#Escape('BEGIN { exit } END { exit 1 }')
+ \ . ' --lint'
\ . ale#Pad(ale#Var(a:buffer, 'awk_gawk_options'))
- \ . ' -f %t --lint /dev/null'
+ \ . ' -f %t /dev/null'
endfunction
call ale#linter#Define('awk', {
diff --git a/sources_non_forked/ale/ale_linters/bitbake/oelint_adv.vim b/sources_non_forked/ale/ale_linters/bitbake/oelint_adv.vim
new file mode 100644
index 00000000..fb85a9b9
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/bitbake/oelint_adv.vim
@@ -0,0 +1,47 @@
+" Author: offa
+" Description: oelint-adv for BitBake files
+
+call ale#Set('bitbake_oelint_adv_executable', 'oelint-adv')
+call ale#Set('bitbake_oelint_adv_options', '')
+call ale#Set('bitbake_oelint_adv_config', '.oelint.cfg')
+
+function! ale_linters#bitbake#oelint_adv#Command(buffer) abort
+ let l:config_file = ale#path#FindNearestFile(a:buffer,
+ \ ale#Var(a:buffer, 'bitbake_oelint_adv_config'))
+
+ return ((!empty(l:config_file))
+ \ ? 'OELINT_CONFIG=' . ale#Escape(l:config_file) . ' '
+ \ : '')
+ \ . '%e --quiet '
+ \ . ale#Pad(ale#Var(a:buffer, 'bitbake_oelint_adv_options')) . '%s'
+endfunction
+
+function! ale_linters#bitbake#oelint_adv#Handle(buffer, lines) abort
+ let l:pattern = '\v^(.+):(.+):(.+):(.+):(.+)$'
+ let l:output = []
+
+ for l:match in ale#util#GetMatches(a:lines, l:pattern)
+ call add(l:output, {
+ \ 'lnum': str2nr(l:match[2]),
+ \ 'type': l:match[3] is# 'error'
+ \ ? 'E' : (l:match[3] is# 'warning' ? 'W' : 'I'),
+ \ 'text': StripAnsiCodes(l:match[5]),
+ \ 'code': l:match[4]
+ \ })
+ endfor
+
+ return l:output
+endfunction
+
+function! StripAnsiCodes(line) abort
+ return substitute(a:line, '\e\[[0-9;]\+[mK]', '', 'g')
+endfunction
+
+call ale#linter#Define('bitbake', {
+\ 'name': 'oelint_adv',
+\ 'output_stream': 'both',
+\ 'executable': {b -> ale#Var(b, 'bitbake_oelint_adv_executable')},
+\ 'cwd': '%s:h',
+\ 'command': function('ale_linters#bitbake#oelint_adv#Command'),
+\ 'callback': 'ale_linters#bitbake#oelint_adv#Handle',
+\ })
diff --git a/sources_non_forked/ale/ale_linters/c/cpplint.vim b/sources_non_forked/ale/ale_linters/c/cpplint.vim
new file mode 100644
index 00000000..4b997941
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/c/cpplint.vim
@@ -0,0 +1,20 @@
+" Author: Justin Huang
+" Description: cpplint for c files
+
+call ale#Set('c_cpplint_executable', 'cpplint')
+call ale#Set('c_cpplint_options', '')
+
+function! ale_linters#c#cpplint#GetCommand(buffer) abort
+ let l:options = ale#Var(a:buffer, 'c_cpplint_options')
+
+ return '%e' . ale#Pad(l:options) . ' %s'
+endfunction
+
+call ale#linter#Define('c', {
+\ 'name': 'cpplint',
+\ 'output_stream': 'stderr',
+\ 'executable': {b -> ale#Var(b, 'c_cpplint_executable')},
+\ 'command': function('ale_linters#c#cpplint#GetCommand'),
+\ 'callback': 'ale#handlers#cpplint#HandleCppLintFormat',
+\ 'lint_file': 1,
+\})
diff --git a/sources_non_forked/ale/ale_linters/c/cspell.vim b/sources_non_forked/ale/ale_linters/c/cspell.vim
new file mode 100644
index 00000000..5f016548
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/c/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for C files.
+
+call ale#handlers#cspell#DefineLinter('c')
diff --git a/sources_non_forked/ale/ale_linters/cmake/cmake_lint.vim b/sources_non_forked/ale/ale_linters/cmake/cmake_lint.vim
new file mode 100644
index 00000000..3c44c92f
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/cmake/cmake_lint.vim
@@ -0,0 +1,43 @@
+" Author: Carl Smedstad
+" Description: cmake-lint for cmake files
+
+let g:ale_cmake_cmake_lint_executable =
+\ get(g:, 'ale_cmake_cmake_lint_executable', 'cmake-lint')
+
+let g:ale_cmake_cmake_lint_options =
+\ get(g:, 'ale_cmake_cmake_lint_options', '')
+
+function! ale_linters#cmake#cmake_lint#Executable(buffer) abort
+ return ale#Var(a:buffer, 'cmake_cmake_lint_executable')
+endfunction
+
+function! ale_linters#cmake#cmake_lint#Command(buffer) abort
+ let l:executable = ale_linters#cmake#cmake_lint#Executable(a:buffer)
+ let l:options = ale#Var(a:buffer, 'cmake_cmake_lint_options')
+
+ return ale#Escape(l:executable) . ' ' . l:options . ' %t'
+endfunction
+
+function! ale_linters#cmake#cmake_lint#Handle(buffer, lines) abort
+ let l:pattern = '\v^[^:]+:(\d+),?(\d+)?:\s\[([A-Z]\d+)\]\s(.+)$'
+ let l:output = []
+
+ for l:match in ale#util#GetMatches(a:lines, l:pattern)
+ call add(l:output, {
+ \ 'lnum': l:match[1] + 0,
+ \ 'col': l:match[2] + 0,
+ \ 'type': 'W',
+ \ 'code': l:match[3],
+ \ 'text': l:match[4],
+ \})
+ endfor
+
+ return l:output
+endfunction
+
+call ale#linter#Define('cmake', {
+\ 'name': 'cmake_lint',
+\ 'executable': function('ale_linters#cmake#cmake_lint#Executable'),
+\ 'command': function('ale_linters#cmake#cmake_lint#Command'),
+\ 'callback': 'ale_linters#cmake#cmake_lint#Handle',
+\})
diff --git a/sources_non_forked/ale/ale_linters/cpp/cspell.vim b/sources_non_forked/ale/ale_linters/cpp/cspell.vim
new file mode 100644
index 00000000..ace4c3b2
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/cpp/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for C++ files.
+
+call ale#handlers#cspell#DefineLinter('cpp')
diff --git a/sources_non_forked/ale/ale_linters/cs/cspell.vim b/sources_non_forked/ale/ale_linters/cs/cspell.vim
new file mode 100644
index 00000000..c62dd11b
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/cs/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for C# files.
+
+call ale#handlers#cspell#DefineLinter('cs')
diff --git a/sources_non_forked/ale/ale_linters/css/cspell.vim b/sources_non_forked/ale/ale_linters/css/cspell.vim
new file mode 100644
index 00000000..d42375b4
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/css/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for CSS files.
+
+call ale#handlers#cspell#DefineLinter('css')
diff --git a/sources_non_forked/ale/ale_linters/css/vscodecss.vim b/sources_non_forked/ale/ale_linters/css/vscodecss.vim
new file mode 100644
index 00000000..2d59adf0
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/css/vscodecss.vim
@@ -0,0 +1,16 @@
+" Author: Dalius Dobravolskas
+" Description: VSCode css language server
+
+function! ale_linters#css#vscodecss#GetProjectRoot(buffer) abort
+ let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
+
+ return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
+endfunction
+
+call ale#linter#Define('css', {
+\ 'name': 'vscodecss',
+\ 'lsp': 'stdio',
+\ 'executable': 'vscode-css-language-server',
+\ 'command': '%e --stdio',
+\ 'project_root': function('ale_linters#css#vscodecss#GetProjectRoot'),
+\})
diff --git a/sources_non_forked/ale/ale_linters/dart/dartanalyzer.vim b/sources_non_forked/ale/ale_linters/dart/dartanalyzer.vim
deleted file mode 100644
index 0a4d9742..00000000
--- a/sources_non_forked/ale/ale_linters/dart/dartanalyzer.vim
+++ /dev/null
@@ -1,36 +0,0 @@
-" Author: w0rp
-" Description: Check Dart files with dartanalyzer
-
-call ale#Set('dart_dartanalyzer_executable', 'dartanalyzer')
-
-function! ale_linters#dart#dartanalyzer#GetCommand(buffer) abort
- let l:path = ale#path#FindNearestFile(a:buffer, '.packages')
-
- return '%e'
- \ . (!empty(l:path) ? ' --packages ' . ale#Escape(l:path) : '')
- \ . ' %s'
-endfunction
-
-function! ale_linters#dart#dartanalyzer#Handle(buffer, lines) abort
- let l:pattern = '\v^ ([a-z]+) . (.+) at (.+):(\d+):(\d+) . (.+)$'
- let l:output = []
-
- for l:match in ale#util#GetMatches(a:lines, l:pattern)
- call add(l:output, {
- \ 'type': l:match[1] is# 'error' ? 'E' : 'W',
- \ 'text': l:match[6] . ': ' . l:match[2],
- \ 'lnum': str2nr(l:match[4]),
- \ 'col': str2nr(l:match[5]),
- \})
- endfor
-
- return l:output
-endfunction
-
-call ale#linter#Define('dart', {
-\ 'name': 'dartanalyzer',
-\ 'executable': {b -> ale#Var(b, 'dart_dartanalyzer_executable')},
-\ 'command': function('ale_linters#dart#dartanalyzer#GetCommand'),
-\ 'callback': 'ale_linters#dart#dartanalyzer#Handle',
-\ 'lint_file': 1,
-\})
diff --git a/sources_non_forked/ale/ale_linters/elixir/cspell.vim b/sources_non_forked/ale/ale_linters/elixir/cspell.vim
new file mode 100644
index 00000000..12dc271f
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/elixir/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for Elixir files.
+
+call ale#handlers#cspell#DefineLinter('elixir')
diff --git a/sources_non_forked/ale/ale_linters/erlang/elvis.vim b/sources_non_forked/ale/ale_linters/erlang/elvis.vim
index 31dea3dd..0fb85c07 100644
--- a/sources_non_forked/ale/ale_linters/erlang/elvis.vim
+++ b/sources_non_forked/ale/ale_linters/erlang/elvis.vim
@@ -12,6 +12,7 @@ function! ale_linters#erlang#elvis#Handle(buffer, lines) abort
\ 'lnum': str2nr(l:match[1]),
\ 'text': s:AbbreviateMessage(l:match[2]),
\ 'type': 'W',
+ \ 'sub_type': 'style',
\})
endfor
diff --git a/sources_non_forked/ale/ale_linters/go/cspell.vim b/sources_non_forked/ale/ale_linters/go/cspell.vim
new file mode 100644
index 00000000..f986a31a
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/go/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for Go files.
+
+call ale#handlers#cspell#DefineLinter('go')
diff --git a/sources_non_forked/ale/ale_linters/go/golangci_lint.vim b/sources_non_forked/ale/ale_linters/go/golangci_lint.vim
index 2c4b1a4f..80431b99 100644
--- a/sources_non_forked/ale/ale_linters/go/golangci_lint.vim
+++ b/sources_non_forked/ale/ale_linters/go/golangci_lint.vim
@@ -24,7 +24,7 @@ function! ale_linters#go#golangci_lint#GetCommand(buffer) abort
endfunction
function! ale_linters#go#golangci_lint#GetMatches(lines) abort
- let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:?:?:?\s\*?(.+)$'
+ let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:?:?:?\s\*?(.+)\s+\((.+)\)$'
return ale#util#GetMatches(a:lines, l:pattern)
endfunction
@@ -34,14 +34,20 @@ function! ale_linters#go#golangci_lint#Handler(buffer, lines) abort
let l:output = []
for l:match in ale_linters#go#golangci_lint#GetMatches(a:lines)
+ if l:match[5] is# 'typecheck'
+ let l:msg_type = 'E'
+ else
+ let l:msg_type = 'W'
+ endif
+
" l:match[1] will already be an absolute path, output from
" golangci_lint
call add(l:output, {
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
- \ 'type': 'E',
- \ 'text': l:match[4],
+ \ 'type': l:msg_type,
+ \ 'text': l:match[4] . ' (' . l:match[5] . ')',
\})
endfor
diff --git a/sources_non_forked/ale/ale_linters/handlebars/embertemplatelint.vim b/sources_non_forked/ale/ale_linters/handlebars/embertemplatelint.vim
index 8362bb1c..17c4d08e 100644
--- a/sources_non_forked/ale/ale_linters/handlebars/embertemplatelint.vim
+++ b/sources_non_forked/ale/ale_linters/handlebars/embertemplatelint.vim
@@ -11,10 +11,17 @@ function! ale_linters#handlebars#embertemplatelint#GetExecutable(buffer) abort
endfunction
function! ale_linters#handlebars#embertemplatelint#GetCommand(buffer, version) abort
- " Reading from stdin was introduced in ember-template-lint@1.6.0
- return ale#semver#GTE(a:version, [1, 6, 0])
- \ ? '%e --json --filename %s'
- \ : '%e --json %t'
+ if ale#semver#GTE(a:version, [4, 0, 0])
+ " --json was removed in favor of --format=json in ember-template-lint@4.0.0
+ return '%e --format=json --filename %s'
+ endif
+
+ if ale#semver#GTE(a:version, [1, 6, 0])
+ " Reading from stdin was introduced in ember-template-lint@1.6.0
+ return '%e --json --filename %s'
+ endif
+
+ return '%e --json %t'
endfunction
function! ale_linters#handlebars#embertemplatelint#GetCommandWithVersionCheck(buffer) abort
diff --git a/sources_non_forked/ale/ale_linters/haskell/cspell.vim b/sources_non_forked/ale/ale_linters/haskell/cspell.vim
new file mode 100644
index 00000000..b0971a9e
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/haskell/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for Haskell files.
+
+call ale#handlers#cspell#DefineLinter('haskell')
diff --git a/sources_non_forked/ale/ale_linters/haskell/hls.vim b/sources_non_forked/ale/ale_linters/haskell/hls.vim
index ae0556a4..7f9efc38 100644
--- a/sources_non_forked/ale/ale_linters/haskell/hls.vim
+++ b/sources_non_forked/ale/ale_linters/haskell/hls.vim
@@ -4,6 +4,7 @@
" ). It search more project root files.
"
call ale#Set('haskell_hls_executable', 'haskell-language-server-wrapper')
+call ale#Set('haskell_hls_config', {})
function! ale_linters#haskell#hls#FindRootFile(buffer) abort
let l:serach_root_files = [
@@ -60,4 +61,5 @@ call ale#linter#Define('haskell', {
\ 'command': function('ale_linters#haskell#hls#GetCommand'),
\ 'executable': {b -> ale#Var(b, 'haskell_hls_executable')},
\ 'project_root': function('ale_linters#haskell#hls#GetProjectRoot'),
+\ 'lsp_config': {b -> ale#Var(b, 'haskell_hls_config')},
\})
diff --git a/sources_non_forked/ale/ale_linters/help/cspell.vim b/sources_non_forked/ale/ale_linters/help/cspell.vim
new file mode 100644
index 00000000..92eb9501
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/help/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for help files.
+
+call ale#handlers#cspell#DefineLinter('help')
diff --git a/sources_non_forked/ale/ale_linters/html/angular.vim b/sources_non_forked/ale/ale_linters/html/angular.vim
index 17c0a751..4f368fb4 100644
--- a/sources_non_forked/ale/ale_linters/html/angular.vim
+++ b/sources_non_forked/ale/ale_linters/html/angular.vim
@@ -11,10 +11,7 @@ function! ale_linters#html#angular#GetProjectRoot(buffer) abort
endfunction
function! ale_linters#html#angular#GetExecutable(buffer) abort
- return ale#path#FindExecutable(a:buffer, 'html_angular', [
- \ 'node_modules/@angular/language-server/bin/ngserver',
- \ 'node_modules/@angular/language-server/index.js',
- \])
+ return 'node'
endfunction
function! ale_linters#html#angular#GetCommand(buffer) abort
@@ -34,9 +31,16 @@ function! ale_linters#html#angular#GetCommand(buffer) abort
\ fnamemodify(l:language_service_dir, ':h:h')
\ . '/typescript'
\)
- let l:executable = ale_linters#html#angular#GetExecutable(a:buffer)
+ let l:script = ale#path#FindExecutable(a:buffer, 'html_angular', [
+ \ 'node_modules/@angular/language-server/bin/ngserver',
+ \ 'node_modules/@angular/language-server/index.js',
+ \])
- return ale#node#Executable(a:buffer, l:executable)
+ if !filereadable(l:script)
+ return ''
+ endif
+
+ return ale#Escape('node') . ' ' . ale#Escape(l:script)
\ . ' --ngProbeLocations ' . ale#Escape(l:language_service_dir)
\ . ' --tsProbeLocations ' . ale#Escape(l:typescript_dir)
\ . ' --stdio'
diff --git a/sources_non_forked/ale/ale_linters/html/cspell.vim b/sources_non_forked/ale/ale_linters/html/cspell.vim
new file mode 100644
index 00000000..743350ea
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/html/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for HTML files.
+
+call ale#handlers#cspell#DefineLinter('html')
diff --git a/sources_non_forked/ale/ale_linters/html/vscodehtml.vim b/sources_non_forked/ale/ale_linters/html/vscodehtml.vim
new file mode 100644
index 00000000..46814a0b
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/html/vscodehtml.vim
@@ -0,0 +1,16 @@
+" Author: Dalius Dobravolskas
+" Description: VSCode html language server
+
+function! ale_linters#html#vscodehtml#GetProjectRoot(buffer) abort
+ let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
+
+ return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
+endfunction
+
+call ale#linter#Define('html', {
+\ 'name': 'vscodehtml',
+\ 'lsp': 'stdio',
+\ 'executable': 'vscode-html-language-server',
+\ 'command': '%e --stdio',
+\ 'project_root': function('ale_linters#html#vscodehtml#GetProjectRoot'),
+\})
diff --git a/sources_non_forked/ale/ale_linters/java/cspell.vim b/sources_non_forked/ale/ale_linters/java/cspell.vim
new file mode 100644
index 00000000..a6eecc0b
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/java/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for Java files.
+
+call ale#handlers#cspell#DefineLinter('java')
diff --git a/sources_non_forked/ale/ale_linters/java/eclipselsp.vim b/sources_non_forked/ale/ale_linters/java/eclipselsp.vim
index adfd1b09..ad7cbeb4 100644
--- a/sources_non_forked/ale/ale_linters/java/eclipselsp.vim
+++ b/sources_non_forked/ale/ale_linters/java/eclipselsp.vim
@@ -192,4 +192,9 @@ call ale#linter#Define('java', {
\ 'command': function('ale_linters#java#eclipselsp#RunWithVersionCheck'),
\ 'language': 'java',
\ 'project_root': function('ale#java#FindProjectRoot'),
+\ 'initialization_options': {
+\ 'extendedClientCapabilities': {
+\ 'classFileContentsSupport': v:true
+\ }
+\ }
\})
diff --git a/sources_non_forked/ale/ale_linters/javascript/cspell.vim b/sources_non_forked/ale/ale_linters/javascript/cspell.vim
new file mode 100644
index 00000000..5a496779
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/javascript/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for JavaScript files.
+
+call ale#handlers#cspell#DefineLinter('javascript')
diff --git a/sources_non_forked/ale/ale_linters/json/cspell.vim b/sources_non_forked/ale/ale_linters/json/cspell.vim
new file mode 100644
index 00000000..0d7314a4
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/json/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for JSON files.
+
+call ale#handlers#cspell#DefineLinter('json')
diff --git a/sources_non_forked/ale/ale_linters/json/vscodejson.vim b/sources_non_forked/ale/ale_linters/json/vscodejson.vim
new file mode 100644
index 00000000..dcaee010
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/json/vscodejson.vim
@@ -0,0 +1,16 @@
+" Author: Dalius Dobravolskas
+" Description: VSCode json language server
+
+function! ale_linters#json#vscodejson#GetProjectRoot(buffer) abort
+ let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
+
+ return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
+endfunction
+
+call ale#linter#Define('json', {
+\ 'name': 'vscodejson',
+\ 'lsp': 'stdio',
+\ 'executable': 'vscode-json-language-server',
+\ 'command': '%e --stdio',
+\ 'project_root': function('ale_linters#json#vscodejson#GetProjectRoot'),
+\})
diff --git a/sources_non_forked/ale/ale_linters/lua/cspell.vim b/sources_non_forked/ale/ale_linters/lua/cspell.vim
new file mode 100644
index 00000000..215b82f8
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/lua/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for Lua files.
+
+call ale#handlers#cspell#DefineLinter('lua')
diff --git a/sources_non_forked/ale/ale_linters/lua/selene.vim b/sources_non_forked/ale/ale_linters/lua/selene.vim
new file mode 100644
index 00000000..6b33cbfd
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/lua/selene.vim
@@ -0,0 +1,46 @@
+call ale#Set('lua_selene_executable', 'selene')
+call ale#Set('lua_selene_options', '')
+
+function! ale_linters#lua#selene#GetCommand(buffer) abort
+ return '%e' . ale#Pad(ale#Var(a:buffer, 'lua_selene_options'))
+ \ . ' --display-style=json -'
+endfunction
+
+function! ale_linters#lua#selene#Handle(buffer, lines) abort
+ let l:output = []
+
+ for l:line in a:lines
+ " as of version 0.17.0, selene has no way to suppress summary
+ " information when outputting json, so stop processing when we hit it
+ " (PR for this here: https://github.com/Kampfkarren/selene/pull/356)
+ if l:line is# 'Results:'
+ break
+ endif
+
+ let l:json = json_decode(l:line)
+ let l:lint = {
+ \ 'lnum': l:json.primary_label.span.start_line + 1,
+ \ 'end_lnum': l:json.primary_label.span.end_line + 1,
+ \ 'col': l:json.primary_label.span.start_column + 1,
+ \ 'end_col': l:json.primary_label.span.end_column,
+ \ 'text': l:json.message,
+ \ 'code': l:json.code,
+ \ 'type': l:json.severity is# 'Warning' ? 'W' : 'E',
+ \}
+
+ if has_key(l:json, 'notes') && len(l:json.notes) > 0
+ let l:lint.detail = l:lint.text . "\n\n" . join(l:json.notes, "\n")
+ endif
+
+ call add(l:output, l:lint)
+ endfor
+
+ return l:output
+endfunction
+
+call ale#linter#Define('lua', {
+\ 'name': 'selene',
+\ 'executable': {b -> ale#Var(b, 'lua_selene_executable')},
+\ 'command': function('ale_linters#lua#selene#GetCommand'),
+\ 'callback': 'ale_linters#lua#selene#Handle',
+\})
diff --git a/sources_non_forked/ale/ale_linters/make/checkmake.vim b/sources_non_forked/ale/ale_linters/make/checkmake.vim
index 5ebdf91e..d5f95d6f 100644
--- a/sources_non_forked/ale/ale_linters/make/checkmake.vim
+++ b/sources_non_forked/ale/ale_linters/make/checkmake.vim
@@ -20,6 +20,6 @@ endfunction
call ale#linter#Define('make', {
\ 'name': 'checkmake',
\ 'executable': 'checkmake',
-\ 'command': 'checkmake %s --format="{{.LineNumber}}:{{.Rule}}:{{.Violation}}"',
+\ 'command': 'checkmake %s --format="{{.LineNumber}}:{{.Rule}}:{{.Violation}}{{\"\r\n\"}}"',
\ 'callback': 'ale_linters#make#checkmake#Handle',
\})
diff --git a/sources_non_forked/ale/ale_linters/markdown/cspell.vim b/sources_non_forked/ale/ale_linters/markdown/cspell.vim
new file mode 100644
index 00000000..45c586cc
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/markdown/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for Markdown files.
+
+call ale#handlers#cspell#DefineLinter('markdown')
diff --git a/sources_non_forked/ale/ale_linters/nix/nix.vim b/sources_non_forked/ale/ale_linters/nix/nix.vim
index 3d91a9ec..7c2ce963 100644
--- a/sources_non_forked/ale/ale_linters/nix/nix.vim
+++ b/sources_non_forked/ale/ale_linters/nix/nix.vim
@@ -5,7 +5,7 @@
function! ale_linters#nix#nix#Command(buffer, output, meta) abort
let l:version = a:output[0][22:]
- if l:version =~# '^\(2.4\|3\).*'
+ if l:version =~# '^\(2.[4-9]\|3\).*'
return 'nix-instantiate --log-format internal-json --parse -'
else
return 'nix-instantiate --parse -'
diff --git a/sources_non_forked/ale/ale_linters/nix/statix.vim b/sources_non_forked/ale/ale_linters/nix/statix.vim
new file mode 100644
index 00000000..a90a68a6
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/nix/statix.vim
@@ -0,0 +1,18 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: statix analysis and suggestions for Nix files
+
+call ale#Set('nix_statix_check_executable', 'statix')
+call ale#Set('nix_statix_check_options', '')
+
+function! ale_linters#nix#statix#GetCommand(buffer) abort
+ return '%e check -o errfmt --stdin'
+ \ . ale#Pad(ale#Var(a:buffer, 'nix_statix_check_options'))
+endfunction
+
+call ale#linter#Define('nix', {
+\ 'name': 'statix',
+\ 'executable': {b -> ale#Var(b, 'nix_statix_check_executable')},
+\ 'command': function('ale_linters#nix#statix#GetCommand'),
+\ 'callback': 'ale#handlers#statix#Handle',
+\})
diff --git a/sources_non_forked/ale/ale_linters/php/cspell.vim b/sources_non_forked/ale/ale_linters/php/cspell.vim
new file mode 100644
index 00000000..574df575
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/php/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for PHP files.
+
+call ale#handlers#cspell#DefineLinter('php')
diff --git a/sources_non_forked/ale/ale_linters/php/intelephense.vim b/sources_non_forked/ale/ale_linters/php/intelephense.vim
old mode 100644
new mode 100755
diff --git a/sources_non_forked/ale/ale_linters/php/phpactor.vim b/sources_non_forked/ale/ale_linters/php/phpactor.vim
new file mode 100644
index 00000000..b137eaf1
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/php/phpactor.vim
@@ -0,0 +1,23 @@
+" Author: Arizard
+" Description: PHPactor integration for ALE
+
+" Copied from langserver.vim
+function! ale_linters#php#phpactor#GetProjectRoot(buffer) abort
+ let l:composer_path = ale#path#FindNearestFile(a:buffer, 'composer.json')
+
+ if (!empty(l:composer_path))
+ return fnamemodify(l:composer_path, ':h')
+ endif
+
+ let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
+
+ return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
+endfunction
+
+call ale#linter#Define('php', {
+\ 'name': 'phpactor',
+\ 'lsp': 'stdio',
+\ 'executable': 'phpactor',
+\ 'command': '%e language-server',
+\ 'project_root': function('ale_linters#php#phpactor#GetProjectRoot'),
+\})
diff --git a/sources_non_forked/ale/ale_linters/php/phpstan.vim b/sources_non_forked/ale/ale_linters/php/phpstan.vim
index 58d4dce2..4dce5d5f 100644
--- a/sources_non_forked/ale/ale_linters/php/phpstan.vim
+++ b/sources_non_forked/ale/ale_linters/php/phpstan.vim
@@ -1,4 +1,4 @@
-" Author: medains , ardis
+" Author: medains , ardis , Arizard
" Description: phpstan for PHP files
" Set to change the ruleset
@@ -6,6 +6,7 @@ let g:ale_php_phpstan_executable = get(g:, 'ale_php_phpstan_executable', 'phpsta
let g:ale_php_phpstan_level = get(g:, 'ale_php_phpstan_level', '')
let g:ale_php_phpstan_configuration = get(g:, 'ale_php_phpstan_configuration', '')
let g:ale_php_phpstan_autoload = get(g:, 'ale_php_phpstan_autoload', '')
+let g:ale_php_phpstan_memory_limit = get(g:, 'ale_php_phpstan_memory_limit', '')
call ale#Set('php_phpstan_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
@@ -19,6 +20,11 @@ function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
\ ? ' -a ' . ale#Escape(l:autoload)
\ : ''
+ let l:memory_limit = ale#Var(a:buffer, 'php_phpstan_memory_limit')
+ let l:memory_limit_option = !empty(l:memory_limit)
+ \ ? ' --memory-limit ' . ale#Escape(l:memory_limit)
+ \ : ''
+
let l:level = ale#Var(a:buffer, 'php_phpstan_level')
let l:config_file_exists = ale#path#FindNearestFile(a:buffer, 'phpstan.neon')
let l:dist_config_file_exists = ale#path#FindNearestFile(a:buffer, 'phpstan.neon.dist')
@@ -41,6 +47,7 @@ function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
\ . l:configuration_option
\ . l:autoload_option
\ . l:level_option
+ \ . l:memory_limit_option
\ . ' %s'
endfunction
diff --git a/sources_non_forked/ale/ale_linters/php/psalm.vim b/sources_non_forked/ale/ale_linters/php/psalm.vim
index dbbe9453..f1280057 100644
--- a/sources_non_forked/ale/ale_linters/php/psalm.vim
+++ b/sources_non_forked/ale/ale_linters/php/psalm.vim
@@ -6,6 +6,12 @@ call ale#Set('php_psalm_options', '')
call ale#Set('php_psalm_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#php#psalm#GetProjectRoot(buffer) abort
+ let l:composer_path = ale#path#FindNearestFile(a:buffer, 'composer.json')
+
+ if (!empty(l:composer_path))
+ return fnamemodify(l:composer_path, ':h')
+ endif
+
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
diff --git a/sources_non_forked/ale/ale_linters/powershell/cspell.vim b/sources_non_forked/ale/ale_linters/powershell/cspell.vim
new file mode 100644
index 00000000..4a66dbaa
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/powershell/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for PowerShell files.
+
+call ale#handlers#cspell#DefineLinter('powershell')
diff --git a/sources_non_forked/ale/ale_linters/proto/buf_lint.vim b/sources_non_forked/ale/ale_linters/proto/buf_lint.vim
new file mode 100644
index 00000000..e68494a7
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/proto/buf_lint.vim
@@ -0,0 +1,23 @@
+" Author: Alex McKinney
+" Description: Run buf lint.
+
+call ale#Set('proto_buf_lint_executable', 'buf')
+call ale#Set('proto_buf_lint_config', '')
+
+function! ale_linters#proto#buf_lint#GetCommand(buffer) abort
+ let l:config = ale#Var(a:buffer, 'proto_buf_lint_config')
+
+ return '%e lint'
+ \ . (!empty(l:config) ? ' --config=' . ale#Escape(l:config) : '')
+ \ . ' %s#include_package_files=true'
+endfunction
+
+call ale#linter#Define('proto', {
+\ 'name': 'buf_lint',
+\ 'aliases': ['buf-lint'],
+\ 'lint_file': 1,
+\ 'output_stream': 'stdout',
+\ 'executable': {b -> ale#Var(b, 'proto_buf_lint_executable')},
+\ 'command': function('ale_linters#proto#buf_lint#GetCommand'),
+\ 'callback': 'ale#handlers#unix#HandleAsError',
+\})
diff --git a/sources_non_forked/ale/ale_linters/python/cspell.vim b/sources_non_forked/ale/ale_linters/python/cspell.vim
new file mode 100644
index 00000000..a2325311
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/python/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for Python files.
+
+call ale#handlers#cspell#DefineLinter('python')
diff --git a/sources_non_forked/ale/ale_linters/python/pydocstyle.vim b/sources_non_forked/ale/ale_linters/python/pydocstyle.vim
index aa0e8b20..ef0d818c 100644
--- a/sources_non_forked/ale/ale_linters/python/pydocstyle.vim
+++ b/sources_non_forked/ale/ale_linters/python/pydocstyle.vim
@@ -29,7 +29,7 @@ function! ale_linters#python#pydocstyle#GetCommand(buffer) abort
return ale#Escape(l:executable) . l:exec_args
\ . ale#Pad(ale#Var(a:buffer, 'python_pydocstyle_options'))
- \ . ' %s:t'
+ \ . ' %s'
endfunction
function! ale_linters#python#pydocstyle#Handle(buffer, lines) abort
diff --git a/sources_non_forked/ale/ale_linters/python/pylama.vim b/sources_non_forked/ale/ale_linters/python/pylama.vim
index 73b59b07..14f8071a 100644
--- a/sources_non_forked/ale/ale_linters/python/pylama.vim
+++ b/sources_non_forked/ale/ale_linters/python/pylama.vim
@@ -22,6 +22,22 @@ function! ale_linters#python#pylama#GetExecutable(buffer) abort
return ale#python#FindExecutable(a:buffer, 'python_pylama', ['pylama'])
endfunction
+function! ale_linters#python#pylama#RunWithVersionCheck(buffer) abort
+ let l:executable = ale_linters#python#pylama#GetExecutable(a:buffer)
+ let l:exec_args = l:executable =~? 'pipenv\|poetry$'
+ \ ? ' run pylama'
+ \ : ''
+
+ let l:command = ale#Escape(l:executable) . l:exec_args . ' --version'
+
+ return ale#semver#RunWithVersionCheck(
+ \ a:buffer,
+ \ l:executable,
+ \ l:command,
+ \ function('ale_linters#python#pylama#GetCommand'),
+ \)
+endfunction
+
function! ale_linters#python#pylama#GetCwd(buffer) abort
if ale#Var(a:buffer, 'python_pylama_change_directory')
" Pylama loads its configuration from the current directory only, and
@@ -35,27 +51,33 @@ function! ale_linters#python#pylama#GetCwd(buffer) abort
return ''
endfunction
-function! ale_linters#python#pylama#GetCommand(buffer) abort
+function! ale_linters#python#pylama#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#pylama#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run pylama'
\ : ''
+ " json format is added in version 8.1.4
+ " https://github.com/klen/pylama/blob/develop/Changelog
+ let l:format_json_args = ale#semver#GTE(a:version, [8, 1, 4])
+ \ ? ' --format json'
+ \ : ''
+
" Note: Using %t to lint changes would be preferable, but many pylama
" checks use surrounding paths (e.g. C0103 module name, E0402 relative
" import beyond top, etc.). Neither is ideal.
return ale#Escape(l:executable) . l:exec_args
\ . ale#Pad(ale#Var(a:buffer, 'python_pylama_options'))
+ \ . l:format_json_args
\ . ' %s'
endfunction
-function! ale_linters#python#pylama#Handle(buffer, lines) abort
+function! ale_linters#python#pylama#Handle(buffer, version, lines) abort
if empty(a:lines)
return []
endif
let l:output = ale#python#HandleTraceback(a:lines, 1)
- let l:pattern = '\v^.{-}:([0-9]+):([0-9]+): +%(([A-Z][0-9]+):? +)?(.*)$'
" First letter of error code is a pylint-compatible message type
" http://pylint.pycqa.org/en/latest/user_guide/output.html#source-code-analysis-section
@@ -75,16 +97,41 @@ function! ale_linters#python#pylama#Handle(buffer, lines) abort
\ 'D': 'style',
\}
- for l:match in ale#util#GetMatches(a:lines, l:pattern)
- call add(l:output, {
- \ 'lnum': str2nr(l:match[1]),
- \ 'col': str2nr(l:match[2]),
- \ 'code': l:match[3],
- \ 'type': get(l:pylint_type_to_ale_type, l:match[3][0], 'W'),
- \ 'sub_type': get(l:pylint_type_to_ale_sub_type, l:match[3][0], ''),
- \ 'text': l:match[4],
- \})
- endfor
+ if ale#semver#GTE(a:version, [8, 1, 4])
+ try
+ let l:errors = json_decode(join(a:lines, ''))
+ catch
+ return l:output
+ endtry
+
+ if empty(l:errors)
+ return l:output
+ endif
+
+ for l:error in l:errors
+ call add(l:output, {
+ \ 'lnum': l:error['lnum'],
+ \ 'col': l:error['col'],
+ \ 'code': l:error['number'],
+ \ 'type': get(l:pylint_type_to_ale_type, l:error['etype'], 'W'),
+ \ 'sub_type': get(l:pylint_type_to_ale_sub_type, l:error['etype'], ''),
+ \ 'text': printf('%s [%s]', l:error['message'], l:error['source']),
+ \})
+ endfor
+ else
+ let l:pattern = '\v^.{-}:([0-9]+):([0-9]+): +%(([A-Z][0-9]+):? +)?(.*)$'
+
+ for l:match in ale#util#GetMatches(a:lines, l:pattern)
+ call add(l:output, {
+ \ 'lnum': str2nr(l:match[1]),
+ \ 'col': str2nr(l:match[2]),
+ \ 'code': l:match[3],
+ \ 'type': get(l:pylint_type_to_ale_type, l:match[3][0], 'W'),
+ \ 'sub_type': get(l:pylint_type_to_ale_sub_type, l:match[3][0], ''),
+ \ 'text': l:match[4],
+ \})
+ endfor
+ endif
return l:output
endfunction
@@ -93,7 +140,15 @@ call ale#linter#Define('python', {
\ 'name': 'pylama',
\ 'executable': function('ale_linters#python#pylama#GetExecutable'),
\ 'cwd': function('ale_linters#python#pylama#GetCwd'),
-\ 'command': function('ale_linters#python#pylama#GetCommand'),
-\ 'callback': 'ale_linters#python#pylama#Handle',
+\ 'command': function('ale_linters#python#pylama#RunWithVersionCheck'),
+\ 'callback': {buffer, lines -> ale#semver#RunWithVersionCheck(
+\ buffer,
+\ ale_linters#python#pylama#GetExecutable(buffer),
+\ '%e --version',
+\ {buffer, version -> ale_linters#python#pylama#Handle(
+\ buffer,
+\ l:version,
+\ lines)},
+\ )},
\ 'lint_file': 1,
\})
diff --git a/sources_non_forked/ale/ale_linters/python/unimport.vim b/sources_non_forked/ale/ale_linters/python/unimport.vim
new file mode 100644
index 00000000..71fd80f0
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/python/unimport.vim
@@ -0,0 +1,75 @@
+" Author: Author: Jon Parise
+
+call ale#Set('python_unimport_executable', 'unimport')
+call ale#Set('python_unimport_options', '')
+call ale#Set('python_unimport_use_global', get(g:, 'ale_use_global_executables', 0))
+call ale#Set('python_unimport_auto_pipenv', 0)
+call ale#Set('python_unimport_auto_poetry', 0)
+
+function! ale_linters#python#unimport#GetExecutable(buffer) abort
+ if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_unimport_auto_pipenv'))
+ \ && ale#python#PipenvPresent(a:buffer)
+ return 'pipenv'
+ endif
+
+ if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_unimport_auto_poetry'))
+ \ && ale#python#PoetryPresent(a:buffer)
+ return 'poetry'
+ endif
+
+ return ale#python#FindExecutable(a:buffer, 'python_unimport', ['unimport'])
+endfunction
+
+function! ale_linters#python#unimport#GetCommand(buffer) abort
+ let l:executable = ale_linters#python#unimport#GetExecutable(a:buffer)
+ let l:exec_args = l:executable =~? 'pipenv\|poetry$'
+ \ ? ' run unimport'
+ \ : ''
+
+ return '%e' . l:exec_args
+ \ . ale#Pad(ale#Var(a:buffer, 'python_unimport_options'))
+ \ . ' --check'
+ \ . ' %t'
+endfunction
+
+
+function! ale_linters#python#unimport#GetCwd(buffer) abort
+ let l:project_root = ale#python#FindProjectRoot(a:buffer)
+
+ return !empty(l:project_root)
+ \ ? l:project_root
+ \ : expand('#' . a:buffer . ':p:h')
+endfunction
+
+
+function! ale_linters#python#unimport#Handle(buffer, lines) abort
+ let l:output = ale#python#HandleTraceback(a:lines, 10)
+
+ if !empty(l:output)
+ return l:output
+ endif
+
+ " Matches lines like:
+ "
+ " urllib.parse at path/to/file.py:9
+ let l:pattern = '\v(.+) at [^:]+:(\d+)$'
+
+ for l:match in ale#util#GetMatches(a:lines, l:pattern)
+ call add(l:output, {
+ \ 'lnum': l:match[2] + 0,
+ \ 'type': 'W',
+ \ 'text': 'unused: ' . l:match[1],
+ \})
+ endfor
+
+ return l:output
+endfunction
+
+
+call ale#linter#Define('python', {
+\ 'name': 'unimport',
+\ 'executable': function('ale_linters#python#unimport#GetExecutable'),
+\ 'cwd': function('ale_linters#python#unimport#GetCwd'),
+\ 'command': function('ale_linters#python#unimport#GetCommand'),
+\ 'callback': 'ale_linters#python#unimport#Handle',
+\})
diff --git a/sources_non_forked/ale/ale_linters/rego/cspell.vim b/sources_non_forked/ale/ale_linters/rego/cspell.vim
new file mode 100644
index 00000000..a54a5379
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/rego/cspell.vim
@@ -0,0 +1,4 @@
+scriptencoding utf-8
+" Description: cspell support for rego files.
+
+call ale#handlers#cspell#DefineLinter('rego')
diff --git a/sources_non_forked/ale/ale_linters/rego/opacheck.vim b/sources_non_forked/ale/ale_linters/rego/opacheck.vim
new file mode 100644
index 00000000..77d8c93a
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/rego/opacheck.vim
@@ -0,0 +1,56 @@
+" Description: opa check for rego files
+
+call ale#Set('rego_opacheck_executable', 'opa')
+call ale#Set('rego_opacheck_options', '')
+
+function! ale_linters#rego#opacheck#GetExecutable(buffer) abort
+ return ale#Var(a:buffer, 'rego_opacheck_executable')
+endfunction
+
+function! ale_linters#rego#opacheck#GetCommand(buffer) abort
+ let l:options = ale#Var(a:buffer, 'rego_opacheck_options')
+
+ return ale#Escape(ale_linters#rego#opacheck#GetExecutable(a:buffer))
+ \ . ' check %s --format json '
+ \ . (!empty(l:options) ? ' ' . l:options : '')
+endfunction
+
+function! ale_linters#rego#opacheck#Handle(buffer, lines) abort
+ let l:output = []
+
+ let l:errors = ale#util#FuzzyJSONDecode(a:lines, {'errors': []})
+ let l:dir = expand('#' . a:buffer . ':p:h')
+ let l:file = expand('#' . a:buffer . ':p')
+
+ for l:error in l:errors['errors']
+ if has_key(l:error, 'location')
+ call add(l:output, {
+ \ 'filename': ale#path#GetAbsPath(l:dir, l:error['location']['file']),
+ \ 'lnum': l:error['location']['row'],
+ \ 'col': l:error['location']['col'],
+ \ 'text': l:error['message'],
+ \ 'code': l:error['code'],
+ \ 'type': 'E',
+ \})
+ else
+ call add(l:output, {
+ \ 'filename': l:file,
+ \ 'lnum': 0,
+ \ 'col': 0,
+ \ 'text': l:error['message'],
+ \ 'code': l:error['code'],
+ \ 'type': 'E',
+ \})
+ endif
+ endfor
+
+ return l:output
+endfunction
+
+call ale#linter#Define('rego', {
+\ 'name': 'opacheck',
+\ 'output_stream': 'both',
+\ 'executable': function('ale_linters#rego#opacheck#GetExecutable'),
+\ 'command': function('ale_linters#rego#opacheck#GetCommand'),
+\ 'callback': 'ale_linters#rego#opacheck#Handle',
+\})
diff --git a/sources_non_forked/ale/ale_linters/rst/cspell.vim b/sources_non_forked/ale/ale_linters/rst/cspell.vim
new file mode 100644
index 00000000..14cfb42e
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/rst/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for ReStructuredText files.
+
+call ale#handlers#cspell#DefineLinter('rst')
diff --git a/sources_non_forked/ale/ale_linters/ruby/cspell.vim b/sources_non_forked/ale/ale_linters/ruby/cspell.vim
new file mode 100644
index 00000000..780356b1
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/ruby/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for Ruby files.
+
+call ale#handlers#cspell#DefineLinter('ruby')
diff --git a/sources_non_forked/ale/ale_linters/ruby/reek.vim b/sources_non_forked/ale/ale_linters/ruby/reek.vim
index 226b452e..b6fa9d76 100644
--- a/sources_non_forked/ale/ale_linters/ruby/reek.vim
+++ b/sources_non_forked/ale/ale_linters/ruby/reek.vim
@@ -19,6 +19,10 @@ function! ale_linters#ruby#reek#GetCommand(buffer, version) abort
\ . l:display_name_args
endfunction
+function! s:GetDocumentationLink(error) abort
+ return get(a:error, 'documentation_link', get(a:error, 'wiki_link', ''))
+endfunction
+
function! s:BuildText(buffer, error) abort
let l:parts = []
@@ -29,7 +33,7 @@ function! s:BuildText(buffer, error) abort
call add(l:parts, a:error.message)
if ale#Var(a:buffer, 'ruby_reek_show_wiki_link')
- call add(l:parts, '[' . a:error.wiki_link . ']')
+ call add(l:parts, '[' . s:GetDocumentationLink(a:error) . ']')
endif
return join(l:parts, ' ')
diff --git a/sources_non_forked/ale/ale_linters/rust/analyzer.vim b/sources_non_forked/ale/ale_linters/rust/analyzer.vim
index 77d946f7..3ead3871 100644
--- a/sources_non_forked/ale/ale_linters/rust/analyzer.vim
+++ b/sources_non_forked/ale/ale_linters/rust/analyzer.vim
@@ -9,9 +9,21 @@ function! ale_linters#rust#analyzer#GetCommand(buffer) abort
endfunction
function! ale_linters#rust#analyzer#GetProjectRoot(buffer) abort
+ " Try to find nearest Cargo.toml for cargo projects
let l:cargo_file = ale#path#FindNearestFile(a:buffer, 'Cargo.toml')
- return !empty(l:cargo_file) ? fnamemodify(l:cargo_file, ':h') : ''
+ if !empty(l:cargo_file)
+ return fnamemodify(l:cargo_file, ':h')
+ endif
+
+ " Try to find nearest rust-project.json for non-cargo projects
+ let l:rust_project = ale#path#FindNearestFile(a:buffer, 'rust-project.json')
+
+ if !empty(l:rust_project)
+ return fnamemodify(l:rust_project, ':h')
+ endif
+
+ return ''
endfunction
call ale#linter#Define('rust', {
diff --git a/sources_non_forked/ale/ale_linters/rust/cspell.vim b/sources_non_forked/ale/ale_linters/rust/cspell.vim
new file mode 100644
index 00000000..d2523c7d
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/rust/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for Rust files.
+
+call ale#handlers#cspell#DefineLinter('rust')
diff --git a/sources_non_forked/ale/ale_linters/rust/rustc.vim b/sources_non_forked/ale/ale_linters/rust/rustc.vim
index f140b58b..bc6431ba 100644
--- a/sources_non_forked/ale/ale_linters/rust/rustc.vim
+++ b/sources_non_forked/ale/ale_linters/rust/rustc.vim
@@ -1,7 +1,7 @@
" Author: Daniel Schemala
" Description: rustc for rust files
-call ale#Set('rust_rustc_options', '-Z no-codegen')
+call ale#Set('rust_rustc_options', '--emit=mir -o /dev/null')
function! ale_linters#rust#rustc#RustcCommand(buffer) abort
" Try to guess the library search path. If the project is managed by cargo,
diff --git a/sources_non_forked/ale/ale_linters/scala/cspell.vim b/sources_non_forked/ale/ale_linters/scala/cspell.vim
new file mode 100644
index 00000000..fa09d420
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/scala/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for Scala files.
+
+call ale#handlers#cspell#DefineLinter('scala')
diff --git a/sources_non_forked/ale/ale_linters/sh/cspell.vim b/sources_non_forked/ale/ale_linters/sh/cspell.vim
new file mode 100644
index 00000000..e3c5a6f0
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/sh/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for shell scripts.
+
+call ale#handlers#cspell#DefineLinter('sh')
diff --git a/sources_non_forked/ale/ale_linters/swift/cspell.vim b/sources_non_forked/ale/ale_linters/swift/cspell.vim
new file mode 100644
index 00000000..25451e9d
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/swift/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for Swift files.
+
+call ale#handlers#cspell#DefineLinter('swift')
diff --git a/sources_non_forked/ale/ale_linters/terraform/checkov.vim b/sources_non_forked/ale/ale_linters/terraform/checkov.vim
new file mode 100644
index 00000000..568b46e1
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/terraform/checkov.vim
@@ -0,0 +1,41 @@
+" Author: Thyme-87
+" Description: use checkov for providing warnings via ale
+
+call ale#Set('terraform_checkov_executable', 'checkov')
+call ale#Set('terraform_checkov_options', '')
+
+function! ale_linters#terraform#checkov#GetExecutable(buffer) abort
+ return ale#Var(a:buffer, 'terraform_checkov_executable')
+endfunction
+
+function! ale_linters#terraform#checkov#GetCommand(buffer) abort
+ return '%e ' . '-f %t -o json --quiet ' . ale#Var(a:buffer, 'terraform_checkov_options')
+endfunction
+
+function! ale_linters#terraform#checkov#Handle(buffer, lines) abort
+ let l:output = []
+
+ let l:results = get(get(ale#util#FuzzyJSONDecode(a:lines, {}), 'results', []), 'failed_checks', [])
+
+ for l:violation in l:results
+ call add(l:output, {
+ \ 'filename': l:violation['file_path'],
+ \ 'lnum': l:violation['file_line_range'][0],
+ \ 'end_lnum': l:violation['file_line_range'][1],
+ \ 'text': l:violation['check_name'] . ' [' . l:violation['check_id'] . ']',
+ \ 'detail': l:violation['check_id'] . ': ' . l:violation['check_name'] . "\n" .
+ \ 'For more information, see: '. l:violation['guideline'],
+ \ 'type': 'W',
+ \ })
+ endfor
+
+ return l:output
+endfunction
+
+call ale#linter#Define('terraform', {
+\ 'name': 'checkov',
+\ 'output_stream': 'stdout',
+\ 'executable': function('ale_linters#terraform#checkov#GetExecutable'),
+\ 'command': function('ale_linters#terraform#checkov#GetCommand'),
+\ 'callback': 'ale_linters#terraform#checkov#Handle',
+\})
diff --git a/sources_non_forked/ale/ale_linters/terraform/terraform.vim b/sources_non_forked/ale/ale_linters/terraform/terraform.vim
index cf134460..1beb8501 100644
--- a/sources_non_forked/ale/ale_linters/terraform/terraform.vim
+++ b/sources_non_forked/ale/ale_linters/terraform/terraform.vim
@@ -21,7 +21,13 @@ function! ale_linters#terraform#terraform#GetType(severity) abort
endfunction
function! ale_linters#terraform#terraform#GetDetail(error) abort
- return get(a:error, 'detail', get(a:error, 'summary', ''))
+ let l:detail = get(a:error, 'detail', '')
+
+ if strlen(l:detail) > 0
+ return l:detail
+ else
+ return get(a:error, 'summary', '')
+ endif
endfunction
function! ale_linters#terraform#terraform#Handle(buffer, lines) abort
diff --git a/sources_non_forked/ale/ale_linters/tex/cspell.vim b/sources_non_forked/ale/ale_linters/tex/cspell.vim
new file mode 100644
index 00000000..4cf2b08e
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/tex/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for TeX files.
+
+call ale#handlers#cspell#DefineLinter('tex')
diff --git a/sources_non_forked/ale/ale_linters/tex/texlab.vim b/sources_non_forked/ale/ale_linters/tex/texlab.vim
index 0794bf51..8e96b80b 100644
--- a/sources_non_forked/ale/ale_linters/tex/texlab.vim
+++ b/sources_non_forked/ale/ale_linters/tex/texlab.vim
@@ -4,6 +4,7 @@
call ale#Set('tex_texlab_executable', 'texlab')
call ale#Set('tex_texlab_options', '')
+call ale#Set('tex_texlab_config', {})
function! ale_linters#tex#texlab#GetProjectRoot(buffer) abort
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
@@ -21,4 +22,5 @@ call ale#linter#Define('tex', {
\ 'executable': {b -> ale#Var(b, 'tex_texlab_executable')},
\ 'command': function('ale_linters#tex#texlab#GetCommand'),
\ 'project_root': function('ale_linters#tex#texlab#GetProjectRoot'),
+\ 'lsp_config': {b -> ale#Var(b, 'tex_texlab_config')},
\})
diff --git a/sources_non_forked/ale/ale_linters/texinfo/cspell.vim b/sources_non_forked/ale/ale_linters/texinfo/cspell.vim
new file mode 100644
index 00000000..d691b3a7
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/texinfo/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for TeXInfo files.
+
+call ale#handlers#cspell#DefineLinter('texinfo')
diff --git a/sources_non_forked/ale/ale_linters/text/cspell.vim b/sources_non_forked/ale/ale_linters/text/cspell.vim
new file mode 100644
index 00000000..813ef3b8
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/text/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for general text files.
+
+call ale#handlers#cspell#DefineLinter('text')
diff --git a/sources_non_forked/ale/ale_linters/typescript/cspell.vim b/sources_non_forked/ale/ale_linters/typescript/cspell.vim
new file mode 100644
index 00000000..6061b75c
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/typescript/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for TypeScript files.
+
+call ale#handlers#cspell#DefineLinter('typescript')
diff --git a/sources_non_forked/ale/ale_linters/vue/cspell.vim b/sources_non_forked/ale/ale_linters/vue/cspell.vim
new file mode 100644
index 00000000..2d8bfdc3
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/vue/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for Vue files.
+
+call ale#handlers#cspell#DefineLinter('vue')
diff --git a/sources_non_forked/ale/ale_linters/vue/volar.vim b/sources_non_forked/ale/ale_linters/vue/volar.vim
new file mode 100644
index 00000000..360b1aa5
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/vue/volar.vim
@@ -0,0 +1,80 @@
+" Author: Arnold Chand
+" Description: Volar Language Server integration for ALE adopted from
+" nvim-lspconfig and volar/packages/shared/src/types.ts
+
+call ale#Set('vue_volar_executable', 'volar-server')
+call ale#Set('vue_volar_use_global', get(g:, 'ale_use_global_executables', 0))
+call ale#Set('vue_volar_init_options', {
+\ 'documentFeatures': {
+\ 'documentColor': v:false,
+\ 'documentFormatting': {
+\ 'defaultPrintWidth': 100,
+\ },
+\ 'documentSymbol': v:true,
+\ 'foldingRange': v:true,
+\ 'linkedEditingRange': v:true,
+\ 'selectionRange': v:true,
+\ },
+\ 'languageFeatures': {
+\ 'callHierarchy': v:true,
+\ 'codeAction': v:true,
+\ 'codeLens': v:true,
+\ 'completion': {
+\ 'defaultAttrNameCase': 'kebabCase',
+\ 'defaultTagNameCase': 'both',
+\ 'getDocumentNameCaseRequest': v:false,
+\ 'getDocumentSelectionRequest': v:false,
+\ },
+\ 'definition': v:true,
+\ 'diagnostics': v:true,
+\ 'documentHighlight': v:true,
+\ 'documentLink': v:true,
+\ 'hover': v:true,
+\ 'references': v:true,
+\ 'rename': v:true,
+\ 'renameFileRefactoring': v:true,
+\ 'schemaRequestService': v:true,
+\ 'semanticTokens': v:false,
+\ 'signatureHelp': v:true,
+\ 'typeDefinition': v:true,
+\ 'workspaceSymbol': v:false,
+\ },
+\ 'typescript': {
+\ 'serverPath': '',
+\ 'localizedPath': v:null,
+\ },
+\})
+
+function! ale_linters#vue#volar#GetProjectRoot(buffer) abort
+ let l:project_roots = ['package.json', 'vite.config.js', '.git', bufname(a:buffer)]
+
+ for l:project_root in l:project_roots
+ let l:nearest_filepath = ale#path#FindNearestFile(a:buffer, l:project_root)
+
+ if !empty(l:nearest_filepath)
+ return fnamemodify(l:nearest_filepath, ':h')
+ endif
+ endfor
+
+ return ''
+endfunction
+
+function! ale_linters#vue#volar#GetInitializationOptions(buffer) abort
+ let l:tsserver_path = ale#path#FindNearestExecutable(a:buffer, [
+ \ 'node_modules/typescript/lib/tsserverlibrary.js'
+ \ ])
+ let l:init_options = ale#Var(a:buffer, 'vue_volar_init_options')
+ let l:init_options.typescript.serverPath = l:tsserver_path
+
+ return l:init_options
+endfunction
+
+call ale#linter#Define('vue', {
+\ 'name': 'volar',
+\ 'language': 'vue',
+\ 'lsp': 'stdio',
+\ 'executable': {b -> ale#path#FindExecutable(b, 'vue_volar', ['node_modules/.bin/volar-server'])},
+\ 'command': '%e --stdio',
+\ 'project_root': function('ale_linters#vue#volar#GetProjectRoot'),
+\ 'initialization_options': function('ale_linters#vue#volar#GetInitializationOptions'),
+\})
diff --git a/sources_non_forked/ale/ale_linters/wgsl/naga.vim b/sources_non_forked/ale/ale_linters/wgsl/naga.vim
new file mode 100644
index 00000000..2816751b
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/wgsl/naga.vim
@@ -0,0 +1,12 @@
+" Author: rhysd
+" Description: naga-cli linter for WGSL syntax.
+
+call ale#Set('wgsl_naga_executable', 'naga')
+
+call ale#linter#Define('wgsl', {
+\ 'name': 'naga',
+\ 'executable': {b -> ale#Var(b, 'wgsl_naga_executable')},
+\ 'output_stream': 'stderr',
+\ 'command': {b -> '%e --stdin-file-path %s'},
+\ 'callback': 'ale#handlers#naga#Handle',
+\})
diff --git a/sources_non_forked/ale/ale_linters/xhtml/cspell.vim b/sources_non_forked/ale/ale_linters/xhtml/cspell.vim
new file mode 100644
index 00000000..c465b41b
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/xhtml/cspell.vim
@@ -0,0 +1,5 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: cspell support for XHTML files.
+
+call ale#handlers#cspell#DefineLinter('xhtml')
diff --git a/sources_non_forked/ale/ale_linters/yaml/actionlint.vim b/sources_non_forked/ale/ale_linters/yaml/actionlint.vim
new file mode 100644
index 00000000..e51cf5f0
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/yaml/actionlint.vim
@@ -0,0 +1,10 @@
+" Author: bretello
+
+call ale#Set('yaml_actionlint_executable', 'actionlint')
+
+call ale#linter#Define('yaml', {
+\ 'name': 'actionlint',
+\ 'executable': {b -> ale#Var(b, 'yaml_actionlint_executable')},
+\ 'command': function('ale#handlers#actionlint#GetCommand'),
+\ 'callback': 'ale#handlers#actionlint#Handle',
+\})
diff --git a/sources_non_forked/ale/ale_linters/yaml/ls.vim b/sources_non_forked/ale/ale_linters/yaml/ls.vim
new file mode 100644
index 00000000..8e3f6d00
--- /dev/null
+++ b/sources_non_forked/ale/ale_linters/yaml/ls.vim
@@ -0,0 +1,34 @@
+" Author: Jeffrey Lau - https://github.com/zoonfafer
+" Description: YAML Language Server https://github.com/redhat-developer/yaml-language-server
+
+call ale#Set('yaml_ls_executable', 'yaml-language-server')
+call ale#Set('yaml_ls_use_global', get(g:, 'ale_use_global_executables', 0))
+call ale#Set('yaml_ls_config', {})
+
+function! ale_linters#yaml#ls#GetExecutable(buffer) abort
+ return ale#path#FindExecutable(a:buffer, 'yaml_ls', [
+ \ 'node_modules/.bin/yaml-language-server',
+ \])
+endfunction
+
+function! ale_linters#yaml#ls#GetCommand(buffer) abort
+ let l:executable = ale_linters#yaml#ls#GetExecutable(a:buffer)
+
+ return ale#Escape(l:executable) . ' --stdio'
+endfunction
+
+" Just use the current file
+function! ale_linters#yaml#ls#FindProjectRoot(buffer) abort
+ let l:project_file = expand('#' . a:buffer . ':p')
+
+ return fnamemodify(l:project_file, ':h')
+endfunction
+
+call ale#linter#Define('yaml', {
+\ 'name': 'yaml-language-server',
+\ 'lsp': 'stdio',
+\ 'executable': function('ale_linters#yaml#ls#GetExecutable'),
+\ 'command': function('ale_linters#yaml#ls#GetCommand'),
+\ 'project_root': function('ale_linters#yaml#ls#FindProjectRoot'),
+\ 'lsp_config': {b -> ale#Var(b, 'yaml_ls_config')},
+\})
diff --git a/sources_non_forked/ale/autoload/ale.vim b/sources_non_forked/ale/autoload/ale.vim
index 97483b45..029472ad 100644
--- a/sources_non_forked/ale/autoload/ale.vim
+++ b/sources_non_forked/ale/autoload/ale.vim
@@ -157,7 +157,7 @@ function! ale#Queue(delay, ...) abort
endif
endfunction
-let s:current_ale_version = [3, 1, 0]
+let s:current_ale_version = [3, 2, 0]
" A function used to check for ALE features in files outside of the project.
function! ale#Has(feature) abort
diff --git a/sources_non_forked/ale/autoload/ale/code_action.vim b/sources_non_forked/ale/autoload/ale/code_action.vim
index 917190be..60106a24 100644
--- a/sources_non_forked/ale/autoload/ale/code_action.vim
+++ b/sources_non_forked/ale/autoload/ale/code_action.vim
@@ -16,13 +16,12 @@ endfunction
function! ale#code_action#HandleCodeAction(code_action, options) abort
let l:current_buffer = bufnr('')
let l:changes = a:code_action.changes
- let l:should_save = get(a:options, 'should_save')
for l:file_code_edit in l:changes
call ale#code_action#ApplyChanges(
\ l:file_code_edit.fileName,
\ l:file_code_edit.textChanges,
- \ l:should_save,
+ \ a:options,
\)
endfor
endfunction
@@ -63,29 +62,29 @@ function! s:ChangeCmp(left, right) abort
return 0
endfunction
-function! ale#code_action#ApplyChanges(filename, changes, should_save) abort
- let l:current_buffer = bufnr('')
+function! ale#code_action#ApplyChanges(filename, changes, options) abort
+ let l:should_save = get(a:options, 'should_save')
+ let l:conn_id = get(a:options, 'conn_id')
+
+ let l:orig_buffer = bufnr('')
+
" The buffer is used to determine the fileformat, if available.
let l:buffer = bufnr(a:filename)
- let l:is_current_buffer = l:buffer > 0 && l:buffer == l:current_buffer
- if l:buffer > 0
- let l:lines = getbufline(l:buffer, 1, '$')
-
- " Add empty line if there's trailing newline, like readfile() does.
- if getbufvar(l:buffer, '&eol')
- let l:lines += ['']
- endif
- else
- let l:lines = readfile(a:filename, 'b')
+ if l:buffer != l:orig_buffer
+ call ale#util#Execute('silent edit ' . a:filename)
+ let l:buffer = bufnr('')
endif
- if l:is_current_buffer
- let l:pos = getpos('.')[1:2]
- else
- let l:pos = [1, 1]
+ let l:lines = getbufline(l:buffer, 1, '$')
+
+ " Add empty line if there's trailing newline, like readfile() does.
+ if getbufvar(l:buffer, '&eol')
+ let l:lines += ['']
endif
+ let l:pos = getpos('.')[1:2]
+
" Changes have to be sorted so we apply them from bottom-to-top
for l:code_edit in reverse(sort(copy(a:changes), function('s:ChangeCmp')))
let l:line = l:code_edit.start.line
@@ -155,46 +154,25 @@ function! ale#code_action#ApplyChanges(filename, changes, should_save) abort
endif
endfor
- if l:buffer > 0
- " Make sure ale#util#{Writefile,SetBufferContents} add trailing
- " newline if and only if it should be added.
- if l:lines[-1] is# '' && getbufvar(l:buffer, '&eol')
- call remove(l:lines, -1)
- else
- call setbufvar(l:buffer, '&eol', 0)
- endif
- elseif exists('+fixeol') && &fixeol && l:lines[-1] is# ''
- " Not in buffer, ale#util#Writefile can't check &eol and always adds
- " newline if &fixeol: remove to prevent double trailing newline.
+ " Make sure to add a trailing newline if and only if it should be added.
+ if l:lines[-1] is# '' && getbufvar(l:buffer, '&eol')
call remove(l:lines, -1)
- endif
-
- if a:should_save || l:buffer < 0
- call ale#util#Writefile(l:buffer, l:lines, a:filename)
else
- call ale#util#SetBufferContents(l:buffer, l:lines)
+ call setbufvar(l:buffer, '&eol', 0)
endif
- if l:is_current_buffer
- if a:should_save
- call ale#util#Execute(':e!')
- endif
+ call ale#util#SetBufferContents(l:buffer, l:lines)
- call setpos('.', [0, l:pos[0], l:pos[1], 0])
+ call ale#lsp#NotifyForChanges(l:conn_id, l:buffer)
+
+ if l:should_save
+ call ale#util#Execute('silent w!')
endif
- if a:should_save && l:buffer > 0 && !l:is_current_buffer
- " Set up a one-time use event that will delete itself to reload the
- " buffer next time it's entered to view the changes made to it.
- execute 'augroup ALECodeActionReloadGroup' . l:buffer
- autocmd!
+ call setpos('.', [0, l:pos[0], l:pos[1], 0])
- execute printf(
- \ 'autocmd BufEnter '
- \ . ' call ale#code_action#ReloadBuffer()',
- \ l:buffer
- \)
- augroup END
+ if l:orig_buffer != l:buffer && bufexists(l:orig_buffer)
+ call ale#util#Execute('silent buf ' . string(l:orig_buffer))
endif
endfunction
@@ -300,7 +278,7 @@ function! ale#code_action#BuildChangesList(changes_map) abort
endfor
call add(l:changes, {
- \ 'fileName': ale#path#FromURI(l:file_name),
+ \ 'fileName': ale#util#ToResource(l:file_name),
\ 'textChanges': l:text_changes,
\})
endfor
diff --git a/sources_non_forked/ale/autoload/ale/codefix.vim b/sources_non_forked/ale/autoload/ale/codefix.vim
index 853ee4e8..34ce3e15 100644
--- a/sources_non_forked/ale/autoload/ale/codefix.vim
+++ b/sources_non_forked/ale/autoload/ale/codefix.vim
@@ -391,8 +391,8 @@ function! s:OnReady(
\ 'character': l:nearest_error.col - 1,
\ },
\ 'end': {
- \ 'line': l:nearest_error.end_lnum - 1,
- \ 'character': l:nearest_error.end_col,
+ \ 'line': get(l:nearest_error, 'end_lnum', 1) - 1,
+ \ 'character': get(l:nearest_error, 'end_col', 0)
\ },
\ },
\ },
@@ -457,7 +457,7 @@ function! s:ExecuteGetCodeFix(linter, range, MenuCallback) abort
let [l:end_line, l:end_column] = getpos("'>")[1:2]
endif
- let l:column = min([l:column, len(getline(l:line))])
+ let l:column = max([min([l:column, len(getline(l:line))]), 1])
let l:end_column = min([l:end_column, len(getline(l:end_line))])
let l:Callback = function(
diff --git a/sources_non_forked/ale/autoload/ale/completion.vim b/sources_non_forked/ale/autoload/ale/completion.vim
index e139feaa..bb664e03 100644
--- a/sources_non_forked/ale/autoload/ale/completion.vim
+++ b/sources_non_forked/ale/autoload/ale/completion.vim
@@ -16,7 +16,7 @@ onoremap (ale_show_completion_menu)
let g:ale_completion_delay = get(g:, 'ale_completion_delay', 100)
let g:ale_completion_excluded_words = get(g:, 'ale_completion_excluded_words', [])
let g:ale_completion_max_suggestions = get(g:, 'ale_completion_max_suggestions', 50)
-let g:ale_completion_autoimport = get(g:, 'ale_completion_autoimport', 0)
+let g:ale_completion_autoimport = get(g:, 'ale_completion_autoimport', 1)
let g:ale_completion_tsserver_remove_warnings = get(g:, 'ale_completion_tsserver_remove_warnings', 0)
let s:timer_id = -1
@@ -581,7 +581,7 @@ function! ale#completion#ParseLSPCompletions(response) abort
continue
endif
- if get(l:item, 'insertTextFormat') is s:LSP_INSERT_TEXT_FORMAT_PLAIN
+ if get(l:item, 'insertTextFormat', s:LSP_INSERT_TEXT_FORMAT_PLAIN) is s:LSP_INSERT_TEXT_FORMAT_PLAIN
\&& type(get(l:item, 'textEdit')) is v:t_dict
let l:text = l:item.textEdit.newText
elseif type(get(l:item, 'insertText')) is v:t_string
@@ -776,7 +776,8 @@ function! s:OnReady(linter, lsp_details) abort
if a:linter.lsp is# 'tsserver'
if get(g:, 'ale_completion_tsserver_autoimport') is 1
- execute 'echom `g:ale_completion_tsserver_autoimport` is deprecated. Use `g:ale_completion_autoimport` instead.'''
+ " no-custom-checks
+ echom '`g:ale_completion_tsserver_autoimport` is deprecated. Use `g:ale_completion_autoimport` instead.'
endif
let l:message = ale#lsp#tsserver_message#Completions(
@@ -911,7 +912,8 @@ function! ale#completion#Import() abort
endif
let [l:line, l:column] = getpos('.')[1:2]
- let l:column = searchpos('\V' . escape(l:word, '/\'), 'bn', l:line)[1]
+ let l:column = searchpos('\V' . escape(l:word, '/\'), 'bnc', l:line)[1]
+ let l:column = l:column + len(l:word) - 1
if l:column isnot 0
let l:started = ale#completion#GetCompletions('ale-import', {
diff --git a/sources_non_forked/ale/autoload/ale/cursor.vim b/sources_non_forked/ale/autoload/ale/cursor.vim
index e8478e93..c83bbcb6 100644
--- a/sources_non_forked/ale/autoload/ale/cursor.vim
+++ b/sources_non_forked/ale/autoload/ale/cursor.vim
@@ -10,12 +10,21 @@ let g:ale_echo_msg_format = get(g:, 'ale_echo_msg_format', '%code: %%s')
let s:cursor_timer = -1
+" A wrapper for echon so we can test messages we echo in Vader tests.
+function! ale#cursor#Echom(message) abort
+ " no-custom-checks
+ exec "norm! :echom a:message\n"
+endfunction
+
function! ale#cursor#TruncatedEcho(original_message) abort
let l:message = a:original_message
" Change tabs to spaces.
let l:message = substitute(l:message, "\t", ' ', 'g')
" Remove any newlines in the message.
let l:message = substitute(l:message, "\n", '', 'g')
+ " Convert indentation groups into single spaces for better legibility when
+ " put on a single line
+ let l:message = substitute(l:message, ' \+', ' ', 'g')
" We need to remember the setting for shortmess and reset it again.
let l:shortmess_options = &l:shortmess
@@ -27,7 +36,7 @@ function! ale#cursor#TruncatedEcho(original_message) abort
silent! setlocal shortmess+=T
try
- exec "norm! :echomsg l:message\n"
+ call ale#cursor#Echom(l:message)
catch /^Vim\%((\a\+)\)\=:E523/
" Fallback into manual truncate (#1987)
let l:winwidth = winwidth(0)
@@ -87,7 +96,9 @@ function! ale#cursor#EchoCursorWarning(...) abort
elseif get(l:info, 'echoed')
" We'll only clear the echoed message when moving off errors once,
" so we don't continually clear the echo line.
- execute 'echo'
+ "
+ " no-custom-checks
+ echo
let l:info.echoed = 0
endif
endif
@@ -150,7 +161,8 @@ function! s:ShowCursorDetailForItem(loc, options) abort
" Clear the echo message if we manually displayed details.
if !l:stay_here
- execute 'echo'
+ " no-custom-checks
+ echo
endif
endif
endfunction
diff --git a/sources_non_forked/ale/autoload/ale/debugging.vim b/sources_non_forked/ale/autoload/ale/debugging.vim
index efd52776..31f3078c 100644
--- a/sources_non_forked/ale/autoload/ale/debugging.vim
+++ b/sources_non_forked/ale/autoload/ale/debugging.vim
@@ -62,7 +62,8 @@ let s:global_variable_list = [
\]
function! s:Echo(message) abort
- execute 'echo a:message'
+ " no-custom-checks
+ echo a:message
endfunction
function! s:GetLinterVariables(filetype, exclude_linter_names) abort
diff --git a/sources_non_forked/ale/autoload/ale/definition.vim b/sources_non_forked/ale/autoload/ale/definition.vim
index 9574017b..fd6cd2e1 100644
--- a/sources_non_forked/ale/autoload/ale/definition.vim
+++ b/sources_non_forked/ale/autoload/ale/definition.vim
@@ -68,18 +68,27 @@ function! ale#definition#HandleLSPResponse(conn_id, response) abort
for l:item in l:result
if has_key(l:item, 'targetUri')
" LocationLink items use targetUri
- let l:filename = ale#path#FromURI(l:item.targetUri)
+ let l:uri = l:item.targetUri
let l:line = l:item.targetRange.start.line + 1
let l:column = l:item.targetRange.start.character + 1
else
" LocationLink items use uri
- let l:filename = ale#path#FromURI(l:item.uri)
+ let l:uri = l:item.uri
let l:line = l:item.range.start.line + 1
let l:column = l:item.range.start.character + 1
endif
call ale#definition#UpdateTagStack()
- call ale#util#Open(l:filename, l:line, l:column, l:options)
+
+ let l:uri_handler = ale#uri#GetURIHandler(l:uri)
+
+ if l:uri_handler is# v:null
+ let l:filename = ale#path#FromFileURI(l:uri)
+ call ale#util#Open(l:filename, l:line, l:column, l:options)
+ else
+ call l:uri_handler.OpenURILink(l:uri, l:line, l:column, l:options, a:conn_id)
+ endif
+
break
endfor
endif
@@ -112,6 +121,12 @@ function! s:OnReady(line, column, options, capability, linter, lsp_details) abor
\ a:line,
\ a:column
\)
+ elseif a:capability is# 'implementation'
+ let l:message = ale#lsp#tsserver_message#Implementation(
+ \ l:buffer,
+ \ a:line,
+ \ a:column
+ \)
endif
else
" Send a message saying the buffer has changed first, or the
@@ -125,6 +140,8 @@ function! s:OnReady(line, column, options, capability, linter, lsp_details) abor
let l:message = ale#lsp#message#Definition(l:buffer, a:line, a:column)
elseif a:capability is# 'typeDefinition'
let l:message = ale#lsp#message#TypeDefinition(l:buffer, a:line, a:column)
+ elseif a:capability is# 'implementation'
+ let l:message = ale#lsp#message#Implementation(l:buffer, a:line, a:column)
else
" XXX: log here?
return
@@ -166,6 +183,14 @@ function! ale#definition#GoToType(options) abort
endfor
endfunction
+function! ale#definition#GoToImpl(options) abort
+ for l:linter in ale#linter#Get(&filetype)
+ if !empty(l:linter.lsp)
+ call s:GoToLSPDefinition(l:linter, a:options, 'implementation')
+ endif
+ endfor
+endfunction
+
function! ale#definition#GoToCommandHandler(command, ...) abort
let l:options = {}
@@ -191,6 +216,8 @@ function! ale#definition#GoToCommandHandler(command, ...) abort
if a:command is# 'type'
call ale#definition#GoToType(l:options)
+ elseif a:command is# 'implementation'
+ call ale#definition#GoToImpl(l:options)
else
call ale#definition#GoTo(l:options)
endif
diff --git a/sources_non_forked/ale/autoload/ale/engine.vim b/sources_non_forked/ale/autoload/ale/engine.vim
index 5b9b1fca..00789a2d 100644
--- a/sources_non_forked/ale/autoload/ale/engine.vim
+++ b/sources_non_forked/ale/autoload/ale/engine.vim
@@ -347,6 +347,12 @@ function! ale#engine#FixLocList(buffer, linter_name, from_other_source, loclist)
if has_key(l:old_item, 'end_lnum')
let l:item.end_lnum = str2nr(l:old_item.end_lnum)
+
+ " When the error ends after the end of the file, put it at the
+ " end. This is only done for the current buffer.
+ if l:item.bufnr == a:buffer && l:item.end_lnum > l:last_line_number
+ let l:item.end_lnum = l:last_line_number
+ endif
endif
if has_key(l:old_item, 'sub_type')
diff --git a/sources_non_forked/ale/autoload/ale/events.vim b/sources_non_forked/ale/autoload/ale/events.vim
index 3568c117..b8350c79 100644
--- a/sources_non_forked/ale/autoload/ale/events.vim
+++ b/sources_non_forked/ale/autoload/ale/events.vim
@@ -156,4 +156,10 @@ function! ale#events#Init() abort
endif
endif
augroup END
+
+ augroup AleURISchemes
+ autocmd!
+
+ autocmd BufNewFile,BufReadPre jdt://** call ale#uri#jdt#ReadJDTLink(expand(''))
+ augroup END
endfunction
diff --git a/sources_non_forked/ale/autoload/ale/filerename.vim b/sources_non_forked/ale/autoload/ale/filerename.vim
new file mode 100644
index 00000000..ec20d279
--- /dev/null
+++ b/sources_non_forked/ale/autoload/ale/filerename.vim
@@ -0,0 +1,133 @@
+" Author: Dalius Dobravolskas
+" Description: Rename file support for tsserver
+
+let s:filerename_map = {}
+
+" Used to get the rename map in tests.
+function! ale#filerename#GetMap() abort
+ return deepcopy(s:filerename_map)
+endfunction
+
+" Used to set the rename map in tests.
+function! ale#filerename#SetMap(map) abort
+ let s:filerename_map = a:map
+endfunction
+
+function! ale#filerename#ClearLSPData() abort
+ let s:filerename_map = {}
+endfunction
+
+function! s:message(message) abort
+ call ale#util#Execute('echom ' . string(a:message))
+endfunction
+
+function! ale#filerename#HandleTSServerResponse(conn_id, response) abort
+ if get(a:response, 'command', '') isnot# 'getEditsForFileRename'
+ return
+ endif
+
+ if !has_key(s:filerename_map, a:response.request_seq)
+ return
+ endif
+
+ let l:options = remove(s:filerename_map, a:response.request_seq)
+
+ let l:old_name = l:options.old_name
+ let l:new_name = l:options.new_name
+
+ if get(a:response, 'success', v:false) is v:false
+ let l:message = get(a:response, 'message', 'unknown')
+ call s:message('Error renaming file "' . l:old_name . '" to "' . l:new_name
+ \ . '". Reason: ' . l:message)
+
+ return
+ endif
+
+ let l:changes = a:response.body
+
+ if empty(l:changes)
+ call s:message('No changes while renaming "' . l:old_name . '" to "' . l:new_name . '"')
+ else
+ call ale#code_action#HandleCodeAction(
+ \ {
+ \ 'description': 'filerename',
+ \ 'changes': l:changes,
+ \ },
+ \ {
+ \ 'should_save': 1,
+ \ },
+ \)
+ endif
+
+ silent! noautocmd execute 'saveas ' . l:new_name
+ call delete(l:old_name)
+endfunction
+
+function! s:OnReady(options, linter, lsp_details) abort
+ let l:id = a:lsp_details.connection_id
+
+ if !ale#lsp#HasCapability(l:id, 'filerename')
+ return
+ endif
+
+ let l:buffer = a:lsp_details.buffer
+
+ let l:Callback = function('ale#filerename#HandleTSServerResponse')
+
+ call ale#lsp#RegisterCallback(l:id, l:Callback)
+
+ let l:message = ale#lsp#tsserver_message#GetEditsForFileRename(
+ \ a:options.old_name,
+ \ a:options.new_name,
+ \)
+
+ let l:request_id = ale#lsp#Send(l:id, l:message)
+
+ let s:filerename_map[l:request_id] = a:options
+endfunction
+
+function! s:ExecuteFileRename(linter, options) abort
+ let l:buffer = bufnr('')
+
+ let l:Callback = function('s:OnReady', [a:options])
+ call ale#lsp_linter#StartLSP(l:buffer, a:linter, l:Callback)
+endfunction
+
+function! ale#filerename#Execute() abort
+ let l:lsp_linters = []
+
+ for l:linter in ale#linter#Get(&filetype)
+ if l:linter.lsp is# 'tsserver'
+ call add(l:lsp_linters, l:linter)
+ endif
+ endfor
+
+ if empty(l:lsp_linters)
+ call s:message('No active tsserver LSPs')
+
+ return
+ endif
+
+ let l:buffer = bufnr('')
+ let l:old_name = expand('#' . l:buffer . ':p')
+ let l:new_name = ale#util#Input('New file name: ', l:old_name, 'file')
+
+ if l:old_name is# l:new_name
+ call s:message('New file name matches old file name')
+
+ return
+ endif
+
+ if empty(l:new_name)
+ call s:message('New name cannot be empty!')
+
+ return
+ endif
+
+ for l:lsp_linter in l:lsp_linters
+ call s:ExecuteFileRename(l:lsp_linter, {
+ \ 'old_name': l:old_name,
+ \ 'new_name': l:new_name,
+ \})
+ endfor
+endfunction
diff --git a/sources_non_forked/ale/autoload/ale/fix.vim b/sources_non_forked/ale/autoload/ale/fix.vim
index 8ebba9fe..d9820847 100644
--- a/sources_non_forked/ale/autoload/ale/fix.vim
+++ b/sources_non_forked/ale/autoload/ale/fix.vim
@@ -77,7 +77,8 @@ function! ale#fix#ApplyFixes(buffer, output) abort
call remove(g:ale_fix_buffer_data, a:buffer)
if !l:data.ignore_file_changed_errors
- execute 'echoerr ''The file was changed before fixing finished'''
+ " no-custom-checks
+ echoerr 'The file was changed before fixing finished'
endif
return
@@ -358,7 +359,8 @@ function! ale#fix#Fix(buffer, fixing_flag, ...) abort
\ 'There is no fixer named `%s`. Check :ALEFixSuggest',
\ l:function_name,
\)
- execute 'echom l:echo_message'
+ " no-custom-checks
+ echom l:echo_message
endif
return 0
@@ -366,7 +368,8 @@ function! ale#fix#Fix(buffer, fixing_flag, ...) abort
if empty(l:callback_list)
if a:fixing_flag is# ''
- execute 'echom ''No fixers have been defined. Try :ALEFixSuggest'''
+ " no-custom-checks
+ echom 'No fixers have been defined. Try :ALEFixSuggest'
endif
return 0
diff --git a/sources_non_forked/ale/autoload/ale/fix/registry.vim b/sources_non_forked/ale/autoload/ale/fix/registry.vim
index c6764daf..2e772419 100644
--- a/sources_non_forked/ale/autoload/ale/fix/registry.vim
+++ b/sources_non_forked/ale/autoload/ale/fix/registry.vim
@@ -37,6 +37,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['python'],
\ 'description': 'Fix PEP8 issues with black.',
\ },
+\ 'buf-format': {
+\ 'function': 'ale#fixers#buf_format#Fix',
+\ 'suggested_filetypes': ['proto'],
+\ 'description': 'Fix .proto files with buf format.',
+\ },
\ 'buildifier': {
\ 'function': 'ale#fixers#buildifier#Fix',
\ 'suggested_filetypes': ['bzl'],
@@ -191,6 +196,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['ruby'],
\ 'description': 'Fix ruby files with standardrb --fix',
\ },
+\ 'statix': {
+\ 'function': 'ale#fixers#statix#Fix',
+\ 'suggested_filetypes': ['nix'],
+\ 'description': 'Fix common Nix antipatterns with statix fix',
+\ },
\ 'stylelint': {
\ 'function': 'ale#fixers#stylelint#Fix',
\ 'suggested_filetypes': ['css', 'sass', 'scss', 'sugarss', 'stylus'],
@@ -246,6 +256,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['go'],
\ 'description': 'Fix Go files with go fmt.',
\ },
+\ 'gofumpt': {
+\ 'function': 'ale#fixers#gofumpt#Fix',
+\ 'suggested_filetypes': ['go'],
+\ 'description': 'Fix Go files with gofumpt, a stricter go fmt.',
+\ },
\ 'goimports': {
\ 'function': 'ale#fixers#goimports#Fix',
\ 'suggested_filetypes': ['go'],
@@ -421,6 +436,16 @@ let s:default_registry = {
\ 'suggested_filetypes': ['hcl', 'terraform'],
\ 'description': 'Fix tf and hcl files with terraform fmt.',
\ },
+\ 'packer': {
+\ 'function': 'ale#fixers#packer#Fix',
+\ 'suggested_filetypes': ['hcl', 'packer'],
+\ 'description': 'Fix Packer HCL files with packer fmt.',
+\ },
+\ 'crystal': {
+\ 'function': 'ale#fixers#crystal#Fix',
+\ 'suggested_filetypes': ['cr'],
+\ 'description': 'Fix cr (crystal).',
+\ },
\ 'ktlint': {
\ 'function': 'ale#fixers#ktlint#Fix',
\ 'suggested_filetypes': ['kt', 'kotlin'],
@@ -481,6 +506,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['lua'],
\ 'description': 'Fix Lua files with luafmt.',
\ },
+\ 'dprint': {
+\ 'function': 'ale#fixers#dprint#Fix',
+\ 'suggested_filetypes': ['javascript', 'typescript', 'json', 'markdown'],
+\ 'description': 'Pluggable and configurable code formatting platform',
+\ },
\ 'stylua': {
\ 'function': 'ale#fixers#stylua#Fix',
\ 'suggested_filetypes': ['lua'],
@@ -501,10 +531,20 @@ let s:default_registry = {
\ 'suggested_filetypes': ['pascal'],
\ 'description': 'Fix Pascal files with ptop.',
\ },
+\ 'opafmt': {
+\ 'function': 'ale#fixers#opafmt#Fix',
+\ 'suggested_filetypes': ['rego'],
+\ 'description': 'Fix rego files with opa fmt.',
+\ },
\ 'vfmt': {
\ 'function': 'ale#fixers#vfmt#Fix',
\ 'suggested_filetypes': ['v'],
\ 'description': 'A formatter for V source code.',
+\ },
+\ 'zigfmt': {
+\ 'function': 'ale#fixers#zigfmt#Fix',
+\ 'suggested_filetypes': ['zig'],
+\ 'description': 'Official formatter for Zig',
\ }
\}
diff --git a/sources_non_forked/ale/autoload/ale/fixers/buf_format.vim b/sources_non_forked/ale/autoload/ale/fixers/buf_format.vim
new file mode 100644
index 00000000..c2c156b7
--- /dev/null
+++ b/sources_non_forked/ale/autoload/ale/fixers/buf_format.vim
@@ -0,0 +1,12 @@
+" Author: Alex McKinney
+" Description: Run buf format.
+
+call ale#Set('proto_buf_format_executable', 'buf')
+
+function! ale#fixers#buf_format#Fix(buffer) abort
+ let l:executable = ale#Var(a:buffer, 'proto_buf_format_executable')
+
+ return {
+ \ 'command': ale#Escape(l:executable) . ' format %t',
+ \}
+endfunction
diff --git a/sources_non_forked/ale/autoload/ale/fixers/crystal.vim b/sources_non_forked/ale/autoload/ale/fixers/crystal.vim
new file mode 100644
index 00000000..4ba702ba
--- /dev/null
+++ b/sources_non_forked/ale/autoload/ale/fixers/crystal.vim
@@ -0,0 +1,14 @@
+call ale#Set('crystal_format_executable', 'crystal')
+call ale#Set('crystal_format_options', '')
+
+function! ale#fixers#crystal#Fix(buffer) abort
+ let l:executable = ale#Var(a:buffer, 'crystal_format_executable')
+ let l:options = ale#Var(a:buffer, 'crystal_format_options')
+
+ return {
+ \ 'command': ale#Escape(l:executable)
+ \ . ' tool format'
+ \ . ale#Pad(l:options)
+ \ . ' -'
+ \}
+endfunction
diff --git a/sources_non_forked/ale/autoload/ale/fixers/dprint.vim b/sources_non_forked/ale/autoload/ale/fixers/dprint.vim
new file mode 100644
index 00000000..99e590df
--- /dev/null
+++ b/sources_non_forked/ale/autoload/ale/fixers/dprint.vim
@@ -0,0 +1,29 @@
+call ale#Set('dprint_executable', 'dprint')
+call ale#Set('dprint_executable_override', 0)
+call ale#Set('dprint_use_global', get(g:, 'ale_use_global_executables', 0))
+call ale#Set('dprint_options', '')
+call ale#Set('dprint_config', 'dprint.json')
+
+function! ale#fixers#dprint#Fix(buffer) abort
+ let l:executable = ale#path#FindExecutable(a:buffer, 'dprint', ['dprint'])
+ let l:executable_override = ale#Var(a:buffer, 'dprint_executable_override')
+
+ if !executable(l:executable) && !l:executable_override
+ return 0
+ endif
+
+ let l:options = ale#Var(a:buffer, 'dprint_options')
+ let l:config = ale#path#FindNearestFile(a:buffer, ale#Var(a:buffer, 'dprint_config'))
+
+ if !empty(l:config)
+ let l:options = l:options . ' -c ' . ale#Escape(l:config)
+ endif
+
+ let l:options = l:options . ' --stdin %s'
+
+ return {
+ \ 'command': ale#Escape(l:executable)
+ \ . ' fmt '
+ \ . l:options
+ \}
+endfunction
diff --git a/sources_non_forked/ale/autoload/ale/fixers/gofumpt.vim b/sources_non_forked/ale/autoload/ale/fixers/gofumpt.vim
new file mode 100644
index 00000000..99753209
--- /dev/null
+++ b/sources_non_forked/ale/autoload/ale/fixers/gofumpt.vim
@@ -0,0 +1,17 @@
+" Author: David Houston
+" Description: A stricter gofmt implementation.
+
+call ale#Set('go_gofumpt_executable', 'gofumpt')
+call ale#Set('go_gofumpt_options', '')
+
+function! ale#fixers#gofumpt#Fix(buffer) abort
+ let l:executable = ale#Var(a:buffer, 'go_gofumpt_executable')
+ let l:options = ale#Var(a:buffer, 'go_gofumpt_options')
+
+ return {
+ \ 'command': ale#Escape(l:executable)
+ \ . ale#Pad(l:options)
+ \ . ' -w -- %t',
+ \ 'read_temporary_file': 1,
+ \}
+endfunction
diff --git a/sources_non_forked/ale/autoload/ale/fixers/opafmt.vim b/sources_non_forked/ale/autoload/ale/fixers/opafmt.vim
new file mode 100644
index 00000000..a0999b70
--- /dev/null
+++ b/sources_non_forked/ale/autoload/ale/fixers/opafmt.vim
@@ -0,0 +1,15 @@
+" Description: Fixer for rego files
+
+call ale#Set('opa_fmt_executable', 'opa')
+call ale#Set('opa_fmt_options', '')
+
+function! ale#fixers#opafmt#Fix(buffer) abort
+ let l:executable = ale#Var(a:buffer, 'opa_fmt_executable')
+ let l:options = ale#Var(a:buffer, 'opa_fmt_options')
+
+ return {
+ \ 'command': ale#Escape(l:executable)
+ \ . ' fmt'
+ \ . (empty(l:options) ? '' : ' ' . l:options)
+ \}
+endfunction
diff --git a/sources_non_forked/ale/autoload/ale/fixers/packer.vim b/sources_non_forked/ale/autoload/ale/fixers/packer.vim
new file mode 100644
index 00000000..8770550d
--- /dev/null
+++ b/sources_non_forked/ale/autoload/ale/fixers/packer.vim
@@ -0,0 +1,17 @@
+" Author: Zhuoyun Wei
+" Description: Fixer for Packer HCL files
+
+call ale#Set('packer_fmt_executable', 'packer')
+call ale#Set('packer_fmt_options', '')
+
+function! ale#fixers#packer#Fix(buffer) abort
+ let l:executable = ale#Var(a:buffer, 'packer_fmt_executable')
+ let l:options = ale#Var(a:buffer, 'packer_fmt_options')
+
+ return {
+ \ 'command': ale#Escape(l:executable)
+ \ . ' fmt'
+ \ . (empty(l:options) ? '' : ' ' . l:options)
+ \ . ' -'
+ \}
+endfunction
diff --git a/sources_non_forked/ale/autoload/ale/fixers/statix.vim b/sources_non_forked/ale/autoload/ale/fixers/statix.vim
new file mode 100644
index 00000000..5991c925
--- /dev/null
+++ b/sources_non_forked/ale/autoload/ale/fixers/statix.vim
@@ -0,0 +1,17 @@
+" Author: David Houston
+" Description: Provide statix fix as a fixer for simple Nix antipatterns.
+
+call ale#Set('nix_statix_fix_executable', 'statix')
+call ale#Set('nix_statix_fix_options', '')
+
+function! ale#fixers#statix#Fix(buffer) abort
+ let l:executable = ale#Var(a:buffer, 'nix_statix_fix_executable')
+ let l:options = ale#Var(a:buffer, 'nix_statix_fix_options')
+
+ return {
+ \ 'command': ale#Escape(l:executable)
+ \ . ale#Pad('fix')
+ \ . ale#Pad('--stdin')
+ \ . ale#Pad(l:options),
+ \}
+endfunction
diff --git a/sources_non_forked/ale/autoload/ale/fixers/uncrustify.vim b/sources_non_forked/ale/autoload/ale/fixers/uncrustify.vim
index ffec18ef..0e8271ec 100644
--- a/sources_non_forked/ale/autoload/ale/fixers/uncrustify.vim
+++ b/sources_non_forked/ale/autoload/ale/fixers/uncrustify.vim
@@ -4,13 +4,30 @@
call ale#Set('c_uncrustify_executable', 'uncrustify')
call ale#Set('c_uncrustify_options', '')
+let s:languages = {
+\ 'c': 'C',
+\ 'cpp': 'CPP',
+\ 'cs': 'CS',
+\ 'objc': 'OC',
+\ 'objcpp': 'OC+',
+\ 'd': 'D',
+\ 'java': 'JAVA',
+\ 'vala': 'VALA',
+\ 'p': 'PAWN',
+\}
+
+function! ale#fixers#uncrustify#Language(buffer) abort
+ return get(s:languages, &filetype, 'C')
+endfunction
+
function! ale#fixers#uncrustify#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'c_uncrustify_executable')
let l:options = ale#Var(a:buffer, 'c_uncrustify_options')
return {
\ 'command': ale#Escape(l:executable)
- \ . ' --no-backup'
- \ . (empty(l:options) ? '' : ' ' . l:options)
+ \ . ' --no-backup '
+ \ . '-l' . ale#Pad(ale#fixers#uncrustify#Language(a:buffer))
+ \ . ale#Pad(l:options)
\}
endfunction
diff --git a/sources_non_forked/ale/autoload/ale/fixers/zigfmt.vim b/sources_non_forked/ale/autoload/ale/fixers/zigfmt.vim
new file mode 100644
index 00000000..b22e5b83
--- /dev/null
+++ b/sources_non_forked/ale/autoload/ale/fixers/zigfmt.vim
@@ -0,0 +1,14 @@
+scriptencoding utf-8
+" Author: Arash Mousavi
+" Description: Official formatter for Zig.
+
+call ale#Set('zig_zigfmt_executable', 'zig')
+
+function! ale#fixers#zigfmt#Fix(buffer) abort
+ let l:executable = ale#Var(a:buffer, 'zig_zigfmt_executable')
+
+ return {
+ \ 'command': ale#Escape(l:executable) . ' fmt %t',
+ \ 'read_temporary_file': 1,
+ \}
+endfunction
diff --git a/sources_non_forked/ale/autoload/ale/floating_preview.vim b/sources_non_forked/ale/autoload/ale/floating_preview.vim
index f0bc8f80..e953c363 100644
--- a/sources_non_forked/ale/autoload/ale/floating_preview.vim
+++ b/sources_non_forked/ale/autoload/ale/floating_preview.vim
@@ -7,7 +7,8 @@
function! ale#floating_preview#Show(lines, ...) abort
if !exists('*nvim_open_win') && !has('popupwin')
- execute 'echom ''Floating windows not supported in this vim instance.'''
+ " no-custom-checks
+ echom 'Floating windows not supported in this vim instance.'
return
endif
diff --git a/sources_non_forked/ale/autoload/ale/handlers/actionlint.vim b/sources_non_forked/ale/autoload/ale/handlers/actionlint.vim
new file mode 100644
index 00000000..9a6f1909
--- /dev/null
+++ b/sources_non_forked/ale/autoload/ale/handlers/actionlint.vim
@@ -0,0 +1,24 @@
+function! ale#handlers#actionlint#GetCommand(buffer) abort
+ return '%e --no-color --oneline %t'
+endfunction
+
+function! ale#handlers#actionlint#Handle(buffer, lines) abort
+ " Matches patterns line the following:
+ ".github/workflows/main.yml:19:0: could not parse as YAML: yaml: line 19: mapping values are not allowed in this context [yaml-syntax]
+ let l:pattern = '\v^.*:(\d+):(\d+): (.+) \[(.+)\]$'
+ 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,
+ \ 'text': l:match[3],
+ \ 'code': l:match[4],
+ \ 'type': 'E',
+ \}
+
+ call add(l:output, l:item)
+ endfor
+
+ return l:output
+endfunction
diff --git a/sources_non_forked/ale/autoload/ale/handlers/alex.vim b/sources_non_forked/ale/autoload/ale/handlers/alex.vim
index 6ef4867f..1a92bd14 100644
--- a/sources_non_forked/ale/autoload/ale/handlers/alex.vim
+++ b/sources_non_forked/ale/autoload/ale/handlers/alex.vim
@@ -11,8 +11,9 @@ endfunction
function! ale#handlers#alex#CreateCommandCallback(flags) abort
return {b -> ale#node#Executable(b, ale#handlers#alex#GetExecutable(b))
- \ . ' %s '
- \ . a:flags}
+ \ . ' --stdin '
+ \ . a:flags
+ \}
endfunction
function! ale#handlers#alex#Handle(buffer, lines) abort
@@ -38,6 +39,7 @@ endfunction
" Define a linter for a specific filetype. Accept flags to adapt to the filetype.
" no flags treat input as markdown
" --html treat input as HTML
+" --mdx treat input as MDX
" --text treat input as plaintext
function! ale#handlers#alex#DefineLinter(filetype, flags) abort
call ale#Set('alex_executable', 'alex')
@@ -49,6 +51,5 @@ function! ale#handlers#alex#DefineLinter(filetype, flags) abort
\ 'command': ale#handlers#alex#CreateCommandCallback(a:flags),
\ 'output_stream': 'stderr',
\ 'callback': 'ale#handlers#alex#Handle',
- \ 'lint_file': 1,
\})
endfunction
diff --git a/sources_non_forked/ale/autoload/ale/handlers/cppcheck.vim b/sources_non_forked/ale/autoload/ale/handlers/cppcheck.vim
index a07d0aed..150bb007 100644
--- a/sources_non_forked/ale/autoload/ale/handlers/cppcheck.vim
+++ b/sources_non_forked/ale/autoload/ale/handlers/cppcheck.vim
@@ -19,6 +19,18 @@ function! ale#handlers#cppcheck#GetBufferPathIncludeOptions(buffer) abort
endfunction
function! ale#handlers#cppcheck#GetCompileCommandsOptions(buffer) abort
+ " The compile_commands.json doesn't apply to headers and cppheck will
+ " bail out if it cannot find a file matching the filter, below. Skip out
+ " now, for headers. Also, suppress FPs; cppcheck is not meant to
+ " process lone header files.
+ let b:buffer_name = bufname(a:buffer)
+ let b:file_extension = fnamemodify(b:buffer_name, ':e')
+
+ if b:file_extension is# 'h' || b:file_extension is# 'hpp'
+ return ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
+ \ . ' --suppress=unusedStructMember'
+ endif
+
" If the current buffer is modified, using compile_commands.json does no
" good, so include the file's directory instead. It's not quite as good as
" using --project, but is at least equivalent to running cppcheck on this
@@ -35,8 +47,10 @@ function! ale#handlers#cppcheck#GetCompileCommandsOptions(buffer) abort
" then use the file to set up import paths, etc.
let [l:dir, l:json_path] = ale#c#FindCompileCommands(a:buffer)
+ " By default, cppcheck processes every config in compile_commands.json.
+ " Use --file-filter to limit to just the buffer file.
return !empty(l:json_path)
- \ ? '--project=' . ale#Escape(l:json_path[len(l:dir) + 1: ])
+ \ ? '--project=' . ale#Escape(l:json_path[len(l:dir) + 1: ]) . ' --file-filter=' . ale#Escape(bufname(a:buffer))
\ : ''
endfunction
@@ -50,7 +64,12 @@ function! ale#handlers#cppcheck#HandleCppCheckFormat(buffer, lines) abort
"test.cpp:974:{column}: error:{inconclusive:inconclusive} Array 'n[3]' accessed at index 3, which is out of bounds. [arrayIndexOutOfBounds]\
" n[3]=3;
" ^
- let l:pattern = '\v(\f+):(\d+):(\d+|\{column\}): (\w+):(\{inconclusive:inconclusive\})? ?(.*) \[(\w+)\]\'
+ "
+ "" OR if using the misra addon:
+ "test.c:1:16: style: misra violation (use --rule-texts= to get proper output) [misra-c2012-2.7]\'
+ "void test( int parm ) {}
+ " ^
+ let l:pattern = '\v(\f+):(\d+):(\d+|\{column\}): (\w+):(\{inconclusive:inconclusive\})? ?(.*) \[(%(\w[-.]?)+)\]\'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
diff --git a/sources_non_forked/ale/autoload/ale/handlers/cspell.vim b/sources_non_forked/ale/autoload/ale/handlers/cspell.vim
new file mode 100644
index 00000000..2cd02d5c
--- /dev/null
+++ b/sources_non_forked/ale/autoload/ale/handlers/cspell.vim
@@ -0,0 +1,54 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: Define a handler function for cspell's output
+
+function! ale#handlers#cspell#GetExecutable(buffer) abort
+ return ale#path#FindExecutable(a:buffer,
+ \ 'cspell', [
+ \ 'node_modules/.bin/cspell',
+ \ 'node_modules/cspell/bin.js',
+ \ ]
+ \)
+endfunction
+
+function! ale#handlers#cspell#GetCommand(buffer) abort
+ let l:executable = ale#handlers#cspell#GetExecutable(a:buffer)
+ let l:options = ale#Var(a:buffer, 'cspell_options')
+
+ return ale#node#Executable(a:buffer, l:executable)
+ \ . ' lint --no-color --no-progress --no-summary'
+ \ . ale#Pad(l:options)
+ \ . ' -- stdin'
+endfunction
+
+function! ale#handlers#cspell#Handle(buffer, lines) abort
+ " Look for lines like the following:
+ "
+ " /home/user/repos/ale/README.md:723:48 - Unknown word (stylelint)
+ let l:pattern = '\v^.*:(\d+):(\d+) - (.*)$'
+ let l:output = []
+
+ for l:match in ale#util#GetMatches(a:lines, l:pattern)
+ call add(l:output, {
+ \ 'lnum': l:match[1] + 0,
+ \ 'col': l:match[2] + 0,
+ \ 'text': l:match[3],
+ \ 'type': 'W',
+ \})
+ endfor
+
+ return l:output
+endfunction
+
+function! ale#handlers#cspell#DefineLinter(filetype) abort
+ call ale#Set('cspell_executable', 'cspell')
+ call ale#Set('cspell_options', '')
+ call ale#Set('cspell_use_global', get(g:, 'ale_use_global_executables', 0))
+
+ call ale#linter#Define(a:filetype, {
+ \ 'name': 'cspell',
+ \ 'executable': function('ale#handlers#cspell#GetExecutable'),
+ \ 'command': function('ale#handlers#cspell#GetCommand'),
+ \ 'callback': 'ale#handlers#cspell#Handle',
+ \})
+endfunction
diff --git a/sources_non_forked/ale/autoload/ale/handlers/haskell.vim b/sources_non_forked/ale/autoload/ale/handlers/haskell.vim
index 3613b1bb..70a3a7ea 100644
--- a/sources_non_forked/ale/autoload/ale/handlers/haskell.vim
+++ b/sources_non_forked/ale/autoload/ale/handlers/haskell.vim
@@ -19,6 +19,16 @@ let s:temp_regex_prefix =
\ . substitute(s:temp_dir, '\\', '\\\\', 'g')
\ . '\.\{-}'
+function! s:PanicOutput(lines) abort
+ return [{
+ \ 'lnum': 1,
+ \ 'col': 1,
+ \ 'text': 'ghc panic!',
+ \ 'type': 'E',
+ \ 'detail' : join(a:lines, "\n"),
+ \}]
+endfunction
+
function! ale#handlers#haskell#HandleGHCFormat(buffer, lines) abort
" Look for lines like the following.
"
@@ -34,6 +44,14 @@ function! ale#handlers#haskell#HandleGHCFormat(buffer, lines) abort
let l:corrected_lines = []
+ " If ghc panic error, put the whole message in details and exit.
+ let l:panic_position = match(a:lines,'ghc: panic!')
+ let l:panic_end = match(a:lines,'Please report this as a GHC bug:')
+
+ if l:panic_position >= 0
+ return s:PanicOutput(a:lines[l:panic_position : l:panic_end])
+ endif
+
" Group the lines into smaller lists.
for l:line in a:lines
if len(matchlist(l:line, l:pattern)) > 0
diff --git a/sources_non_forked/ale/autoload/ale/handlers/naga.vim b/sources_non_forked/ale/autoload/ale/handlers/naga.vim
new file mode 100644
index 00000000..6480aba6
--- /dev/null
+++ b/sources_non_forked/ale/autoload/ale/handlers/naga.vim
@@ -0,0 +1,30 @@
+" Author: rhysd
+" Description: Handle errors for naga-cli.
+
+function! ale#handlers#naga#Handle(buffer, lines) abort
+ let l:errors = []
+ let l:current_error = v:null
+
+ for l:line in a:lines
+ if l:line =~# '^error: '
+ let l:text = l:line[7:]
+ let l:current_error = { 'text': l:text, 'type': 'E' }
+ continue
+ endif
+
+ if l:current_error isnot v:null
+ let l:matches = matchlist(l:line, '\v:(\d+):(\d+)$')
+
+ if !empty(l:matches)
+ let l:current_error.lnum = str2nr(l:matches[1])
+ let l:current_error.col = str2nr(l:matches[2])
+ call add(l:errors, l:current_error)
+ let l:current_error = v:null
+ continue
+ endif
+ endif
+ endfor
+
+ return l:errors
+endfunction
+
diff --git a/sources_non_forked/ale/autoload/ale/handlers/sml.vim b/sources_non_forked/ale/autoload/ale/handlers/sml.vim
index f5365dd6..403b25fa 100644
--- a/sources_non_forked/ale/autoload/ale/handlers/sml.vim
+++ b/sources_non_forked/ale/autoload/ale/handlers/sml.vim
@@ -63,26 +63,35 @@ function! ale#handlers#sml#Handle(buffer, lines) abort
let l:match2 = matchlist(l:line, l:pattern2)
if len(l:match2) != 0
- call add(l:out, {
- \ 'filename': l:match2[1],
+ if l:match2[1] =~# 'stdIn$'
+ let l:loc = {'bufnr': a:buffer}
+ else
+ let l:loc = {'filename': l:match2[1]}
+ endif
+
+ call add(l:out, extend(l:loc, {
\ 'lnum': l:match2[2] + 0,
\ 'col' : l:match2[3] - 1,
\ 'text': l:match2[4],
\ 'type': l:match2[4] =~# '^Warning' ? 'W' : 'E',
- \})
-
+ \}))
continue
endif
let l:match = matchlist(l:line, l:pattern)
if len(l:match) != 0
- call add(l:out, {
- \ 'filename': l:match[1],
+ if l:match[1] =~# 'stdIn$'
+ let l:loc = {'bufnr': a:buffer}
+ else
+ let l:loc = {'filename': l:match[1]}
+ endif
+
+ call add(l:out, extend(l:loc, {
\ 'lnum': l:match[2] + 0,
\ 'text': l:match[3] . ': ' . l:match[4],
\ 'type': l:match[3] is# 'error' ? 'E' : 'W',
- \})
+ \}))
continue
endif
endfor
diff --git a/sources_non_forked/ale/autoload/ale/handlers/statix.vim b/sources_non_forked/ale/autoload/ale/handlers/statix.vim
new file mode 100644
index 00000000..eeef4107
--- /dev/null
+++ b/sources_non_forked/ale/autoload/ale/handlers/statix.vim
@@ -0,0 +1,24 @@
+scriptencoding utf-8
+" Author: David Houston
+" Description: This file defines a handler function for statix's errorformat
+" output.
+
+function! ale#handlers#statix#Handle(buffer, lines) abort
+ " Look for lines like the following.
+ "
+ " flake.nix>46:13:W:3:This assignment is better written with `inherit`
+ let l:pattern = '\v^.*\>(\d+):(\d+):([A-Z]):(\d+):(.*)$'
+ let l:output = []
+
+ for l:match in ale#util#GetMatches(a:lines, l:pattern)
+ call add(l:output, {
+ \ 'lnum': l:match[1] + 0,
+ \ 'col': l:match[2] + 0,
+ \ 'type': l:match[3],
+ \ 'code': l:match[4],
+ \ 'text': l:match[5],
+ \})
+ endfor
+
+ return l:output
+endfunction
diff --git a/sources_non_forked/ale/autoload/ale/highlight.vim b/sources_non_forked/ale/autoload/ale/highlight.vim
index 473ad354..c284f5ca 100644
--- a/sources_non_forked/ale/autoload/ale/highlight.vim
+++ b/sources_non_forked/ale/autoload/ale/highlight.vim
@@ -22,6 +22,26 @@ if !hlexists('ALEInfo')
highlight link ALEInfo ALEWarning
endif
+if !hlexists('ALEVirtualTextError')
+ highlight link ALEVirtualTextError ALEError
+endif
+
+if !hlexists('ALEVirtualTextStyleError')
+ highlight link ALEVirtualTextStyleError ALEVirtualTextError
+endif
+
+if !hlexists('ALEVirtualTextWarning')
+ highlight link ALEVirtualTextWarning ALEWarning
+endif
+
+if !hlexists('ALEVirtualTextStyleWarning')
+ highlight link ALEVirtualTextStyleWarning ALEVirtualTextWarning
+endif
+
+if !hlexists('ALEVirtualTextInfo')
+ highlight link ALEVirtualTextInfo ALEVirtualTextWarning
+endif
+
" The maximum number of items for the second argument of matchaddpos()
let s:MAX_POS_VALUES = 8
let s:MAX_COL_SIZE = 1073741824 " pow(2, 30)
diff --git a/sources_non_forked/ale/autoload/ale/hover.vim b/sources_non_forked/ale/autoload/ale/hover.vim
index 4513c6ad..5b14df8c 100644
--- a/sources_non_forked/ale/autoload/ale/hover.vim
+++ b/sources_non_forked/ale/autoload/ale/hover.vim
@@ -46,7 +46,7 @@ function! ale#hover#HandleTSServerResponse(conn_id, response) abort
call balloon_show(a:response.body.displayString)
elseif get(l:options, 'truncated_echo', 0)
if !empty(a:response.body.displayString)
- call ale#cursor#TruncatedEcho(split(a:response.body.displayString, "\n")[0])
+ call ale#cursor#TruncatedEcho(a:response.body.displayString)
endif
elseif g:ale_hover_to_floating_preview || g:ale_floating_preview
call ale#floating_preview#Show(split(a:response.body.displayString, "\n"), {
@@ -231,7 +231,11 @@ function! ale#hover#HandleLSPResponse(conn_id, response) abort
\&& (l:set_balloons is 1 || l:set_balloons is# 'hover')
call balloon_show(join(l:lines, "\n"))
elseif get(l:options, 'truncated_echo', 0)
- call ale#cursor#TruncatedEcho(l:lines[0])
+ if type(l:lines[0]) is# v:t_list
+ call ale#cursor#TruncatedEcho(join(l:lines[0], '\n'))
+ else
+ call ale#cursor#TruncatedEcho(l:lines[0])
+ endif
elseif g:ale_hover_to_floating_preview || g:ale_floating_preview
call ale#floating_preview#Show(l:lines, {
\ 'filetype': 'ale-preview.message',
diff --git a/sources_non_forked/ale/autoload/ale/job.vim b/sources_non_forked/ale/autoload/ale/job.vim
index 14b3e484..b4a7a2e8 100644
--- a/sources_non_forked/ale/autoload/ale/job.vim
+++ b/sources_non_forked/ale/autoload/ale/job.vim
@@ -187,10 +187,16 @@ function! ale#job#PrepareCommand(buffer, command) abort
\ : a:command
" If a custom shell is specified, use that.
- if exists('g:ale_shell')
- let l:shell_arguments = get(g:, 'ale_shell_arguments', &shellcmdflag)
+ if exists('b:ale_shell')
+ let l:ale_shell = b:ale_shell
+ elseif exists('g:ale_shell')
+ let l:ale_shell = g:ale_shell
+ endif
- return split(g:ale_shell) + split(l:shell_arguments) + [l:command]
+ if exists('l:ale_shell')
+ let l:shell_arguments = get(b:, 'ale_shell_arguments', get(g:, 'ale_shell_arguments', &shellcmdflag))
+
+ return split(l:ale_shell) + split(l:shell_arguments) + [l:command]
endif
if has('win32')
diff --git a/sources_non_forked/ale/autoload/ale/linter.vim b/sources_non_forked/ale/autoload/ale/linter.vim
index cbc79064..99faa357 100644
--- a/sources_non_forked/ale/autoload/ale/linter.vim
+++ b/sources_non_forked/ale/autoload/ale/linter.vim
@@ -19,6 +19,7 @@ let s:default_ale_linter_aliases = {
\ 'rmd': 'r',
\ 'systemverilog': 'verilog',
\ 'typescriptreact': ['typescript', 'tsx'],
+\ 'vader': ['vim', 'vader'],
\ 'verilog_systemverilog': ['verilog_systemverilog', 'verilog'],
\ 'vimwiki': 'markdown',
\ 'vue': ['vue', 'javascript'],
@@ -45,15 +46,20 @@ let s:default_ale_linters = {
\ 'hack': ['hack'],
\ 'help': [],
\ 'inko': ['inko'],
+\ 'json': ['jsonlint', 'spectral', 'vscodejson'],
+\ 'json5': [],
+\ 'jsonc': [],
\ 'perl': ['perlcritic'],
\ 'perl6': [],
\ 'python': ['flake8', 'mypy', 'pylint', 'pyright'],
\ 'rust': ['cargo', 'rls'],
\ 'spec': [],
\ 'text': [],
+\ 'vader': ['vimls'],
\ 'vue': ['eslint', 'vls'],
\ 'zsh': ['shell'],
\ 'v': ['v'],
+\ 'yaml': ['spectral', 'yaml-language-server', 'yamllint'],
\}
" Testing/debugging helper to unload all linters.
diff --git a/sources_non_forked/ale/autoload/ale/list.vim b/sources_non_forked/ale/autoload/ale/list.vim
index 089aa2c0..f10d0910 100644
--- a/sources_non_forked/ale/autoload/ale/list.vim
+++ b/sources_non_forked/ale/autoload/ale/list.vim
@@ -36,12 +36,22 @@ function! ale#list#IsQuickfixOpen() abort
endfunction
" Check if we should open the list, based on the save event being fired, and
-" that setting being on, or the setting just being set to `1`.
-function! s:ShouldOpen(buffer) abort
+" that setting being on, or that the error count is at least as high as the
+" setting when set to an integer value.
+function! s:ShouldOpen(buffer, loclist_len) abort
let l:val = ale#Var(a:buffer, 'open_list')
let l:saved = getbufvar(a:buffer, 'ale_save_event_fired', 0)
- return l:val is 1 || (l:val is# 'on_save' && l:saved)
+ return l:val > 0 ? a:loclist_len >= l:val : l:val is# 'on_save' && l:saved
+endfunction
+
+" Check if we should close the list, based on the save event being fired, and
+" that setting being on, or the setting just being set to an integer value.
+function! s:ShouldClose(buffer) abort
+ let l:val = ale#Var(a:buffer, 'open_list')
+ let l:saved = getbufvar(a:buffer, 'ale_save_event_fired', 0)
+
+ return !((l:val >= 1) || (l:val is# 'on_save' && l:saved))
endfunction
function! s:Deduplicate(list) abort
@@ -122,9 +132,9 @@ function! s:SetListsImpl(timer_id, buffer, loclist) abort
" Open a window to show the problems if we need to.
"
- " We'll check if the current buffer's List is not empty here, so the
- " window will only be opened if the current buffer has problems.
- if s:ShouldOpen(a:buffer) && !empty(a:loclist)
+ " ShouldOpen() checks if the current buffer has enough problems to be
+ " opened.
+ if s:ShouldOpen(a:buffer, len(a:loclist))
let l:winnr = winnr()
let l:mode = mode()
@@ -212,8 +222,25 @@ function! ale#list#SetLists(buffer, loclist) abort
endif
endfunction
+function! ale#list#ForcePopulateErrorList(populate_quickfix) abort
+ let l:quickfix_bak = g:ale_set_quickfix
+ let g:ale_set_quickfix = a:populate_quickfix
+ let l:loclist_bak = g:ale_set_loclist
+ let g:ale_set_loclist = !a:populate_quickfix
+ let l:open_list_bak = g:ale_open_list
+ let g:ale_open_list = 1
+
+ let l:buffer = bufnr('')
+ let l:loclist = get(g:ale_buffer_info, l:buffer, {'loclist': []}).loclist
+ call s:SetListsImpl(-1, l:buffer, l:loclist)
+
+ let g:ale_open_list = l:open_list_bak
+ let g:ale_set_loclist = l:loclist_bak
+ let g:ale_set_quickfix = l:quickfix_bak
+endfunction
+
function! s:CloseWindowIfNeeded(buffer) abort
- if ale#Var(a:buffer, 'keep_list_window_open') || !s:ShouldOpen(a:buffer)
+ if ale#Var(a:buffer, 'keep_list_window_open') || s:ShouldClose(a:buffer)
return
endif
diff --git a/sources_non_forked/ale/autoload/ale/lsp.vim b/sources_non_forked/ale/autoload/ale/lsp.vim
index 75d81525..daaed6fa 100644
--- a/sources_non_forked/ale/autoload/ale/lsp.vim
+++ b/sources_non_forked/ale/autoload/ale/lsp.vim
@@ -38,11 +38,13 @@ function! ale#lsp#Register(executable_or_address, project, init_options) abort
\ 'capabilities': {
\ 'hover': 0,
\ 'rename': 0,
+ \ 'filerename': 0,
\ 'references': 0,
\ 'completion': 0,
\ 'completion_trigger_characters': [],
\ 'definition': 0,
\ 'typeDefinition': 0,
+ \ 'implementation': 0,
\ 'symbol_search': 0,
\ 'code_actions': 0,
\ 'did_save': 0,
@@ -258,6 +260,14 @@ function! s:UpdateCapabilities(conn, capabilities) abort
let a:conn.capabilities.typeDefinition = 1
endif
+ if get(a:capabilities, 'implementationProvider') is v:true
+ let a:conn.capabilities.implementation = 1
+ endif
+
+ if type(get(a:capabilities, 'implementationProvider')) is v:t_dict
+ let a:conn.capabilities.implementation = 1
+ endif
+
if get(a:capabilities, 'workspaceSymbolProvider') is v:true
let a:conn.capabilities.symbol_search = 1
endif
@@ -378,8 +388,10 @@ function! ale#lsp#MarkConnectionAsTsserver(conn_id) abort
let l:conn.capabilities.completion_trigger_characters = ['.']
let l:conn.capabilities.definition = 1
let l:conn.capabilities.typeDefinition = 1
+ let l:conn.capabilities.implementation = 1
let l:conn.capabilities.symbol_search = 1
let l:conn.capabilities.rename = 1
+ let l:conn.capabilities.filerename = 1
let l:conn.capabilities.code_actions = 1
endfunction
@@ -436,11 +448,20 @@ function! s:SendInitMessage(conn) abort
\ 'typeDefinition': {
\ 'dynamicRegistration': v:false,
\ },
+ \ 'implementation': {
+ \ 'dynamicRegistration': v:false,
+ \ 'linkSupport': v:false,
+ \ },
\ 'publishDiagnostics': {
\ 'relatedInformation': v:true,
\ },
\ 'codeAction': {
\ 'dynamicRegistration': v:false,
+ \ 'codeActionLiteralSupport': {
+ \ 'codeActionKind': {
+ \ 'valueSet': []
+ \ }
+ \ }
\ },
\ 'rename': {
\ 'dynamicRegistration': v:false,
@@ -465,6 +486,7 @@ function! ale#lsp#StartProgram(conn_id, executable, command) abort
let l:options = {
\ 'mode': 'raw',
\ 'out_cb': {_, message -> ale#lsp#HandleMessage(a:conn_id, message)},
+ \ 'exit_cb': { -> ale#lsp#Stop(a:conn_id) },
\}
if has('win32')
diff --git a/sources_non_forked/ale/autoload/ale/lsp/message.vim b/sources_non_forked/ale/autoload/ale/lsp/message.vim
index b40c4407..c2238dec 100644
--- a/sources_non_forked/ale/autoload/ale/lsp/message.vim
+++ b/sources_non_forked/ale/autoload/ale/lsp/message.vim
@@ -35,7 +35,7 @@ function! ale#lsp#message#Initialize(root_path, options, capabilities) abort
\ 'rootPath': a:root_path,
\ 'capabilities': a:capabilities,
\ 'initializationOptions': a:options,
- \ 'rootUri': ale#path#ToURI(a:root_path),
+ \ 'rootUri': ale#util#ToURI(a:root_path),
\}]
endfunction
@@ -56,7 +56,7 @@ function! ale#lsp#message#DidOpen(buffer, language_id) abort
return [1, 'textDocument/didOpen', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
+ \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ 'languageId': a:language_id,
\ 'version': ale#lsp#message#GetNextVersionID(),
\ 'text': join(l:lines, "\n") . "\n",
@@ -70,21 +70,21 @@ function! ale#lsp#message#DidChange(buffer) abort
" For changes, we simply send the full text of the document to the server.
return [1, 'textDocument/didChange', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
+ \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ 'version': ale#lsp#message#GetNextVersionID(),
\ },
\ 'contentChanges': [{'text': join(l:lines, "\n") . "\n"}]
\}]
endfunction
-function! ale#lsp#message#DidSave(buffer, includeText) abort
+function! ale#lsp#message#DidSave(buffer, include_text) abort
let l:response = [1, 'textDocument/didSave', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
+ \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ },
\}]
- if a:includeText
+ if a:include_text
let l:response[2].textDocument.version = ale#lsp#message#GetNextVersionID()
let l:response[2].text = ale#util#GetBufferContents(a:buffer)
endif
@@ -95,7 +95,7 @@ endfunction
function! ale#lsp#message#DidClose(buffer) abort
return [1, 'textDocument/didClose', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
+ \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ },
\}]
endfunction
@@ -106,7 +106,7 @@ let s:COMPLETION_TRIGGER_CHARACTER = 2
function! ale#lsp#message#Completion(buffer, line, column, trigger_character) abort
let l:message = [0, 'textDocument/completion', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
+ \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ },
\ 'position': {'line': a:line - 1, 'character': a:column - 1},
\}]
@@ -124,7 +124,7 @@ endfunction
function! ale#lsp#message#Definition(buffer, line, column) abort
return [0, 'textDocument/definition', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
+ \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ },
\ 'position': {'line': a:line - 1, 'character': a:column - 1},
\}]
@@ -133,7 +133,16 @@ endfunction
function! ale#lsp#message#TypeDefinition(buffer, line, column) abort
return [0, 'textDocument/typeDefinition', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
+ \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
+ \ },
+ \ 'position': {'line': a:line - 1, 'character': a:column - 1},
+ \}]
+endfunction
+
+function! ale#lsp#message#Implementation(buffer, line, column) abort
+ return [0, 'textDocument/implementation', {
+ \ 'textDocument': {
+ \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ },
\ 'position': {'line': a:line - 1, 'character': a:column - 1},
\}]
@@ -142,7 +151,7 @@ endfunction
function! ale#lsp#message#References(buffer, line, column) abort
return [0, 'textDocument/references', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
+ \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ },
\ 'position': {'line': a:line - 1, 'character': a:column - 1},
\ 'context': {'includeDeclaration': v:false},
@@ -158,7 +167,7 @@ endfunction
function! ale#lsp#message#Hover(buffer, line, column) abort
return [0, 'textDocument/hover', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
+ \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ },
\ 'position': {'line': a:line - 1, 'character': a:column - 1},
\}]
@@ -173,7 +182,7 @@ endfunction
function! ale#lsp#message#Rename(buffer, line, column, new_name) abort
return [0, 'textDocument/rename', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
+ \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ },
\ 'position': {'line': a:line - 1, 'character': a:column - 1},
\ 'newName': a:new_name,
@@ -183,7 +192,7 @@ endfunction
function! ale#lsp#message#CodeAction(buffer, line, column, end_line, end_column, diagnostics) abort
return [0, 'textDocument/codeAction', {
\ 'textDocument': {
- \ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
+ \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ },
\ 'range': {
\ 'start': {'line': a:line - 1, 'character': a:column - 1},
diff --git a/sources_non_forked/ale/autoload/ale/lsp/response.vim b/sources_non_forked/ale/autoload/ale/lsp/response.vim
index a4f80980..498ec508 100644
--- a/sources_non_forked/ale/autoload/ale/lsp/response.vim
+++ b/sources_non_forked/ale/autoload/ale/lsp/response.vim
@@ -59,7 +59,7 @@ function! ale#lsp#response#ReadDiagnostics(response) abort
\ && l:diagnostic.relatedInformation isnot v:null
let l:related = deepcopy(l:diagnostic.relatedInformation)
call map(l:related, {key, val ->
- \ ale#path#FromURI(val.location.uri) .
+ \ ale#util#ToResource(val.location.uri) .
\ ':' . (val.location.range.start.line + 1) .
\ ':' . (val.location.range.start.character + 1) .
\ ":\n\t" . val.message
diff --git a/sources_non_forked/ale/autoload/ale/lsp/tsserver_message.vim b/sources_non_forked/ale/autoload/ale/lsp/tsserver_message.vim
index 00213a75..02e57899 100644
--- a/sources_non_forked/ale/autoload/ale/lsp/tsserver_message.vim
+++ b/sources_non_forked/ale/autoload/ale/lsp/tsserver_message.vim
@@ -72,6 +72,14 @@ function! ale#lsp#tsserver_message#TypeDefinition(buffer, line, column) abort
\}]
endfunction
+function! ale#lsp#tsserver_message#Implementation(buffer, line, column) abort
+ return [0, 'ts@implementation', {
+ \ 'line': a:line,
+ \ 'offset': a:column,
+ \ 'file': expand('#' . a:buffer . ':p'),
+ \}]
+endfunction
+
function! ale#lsp#tsserver_message#References(buffer, line, column) abort
return [0, 'ts@references', {
\ 'line': a:line,
@@ -101,6 +109,14 @@ function! ale#lsp#tsserver_message#Rename(
\}]
endfunction
+function! ale#lsp#tsserver_message#GetEditsForFileRename(
+\ oldFilePath, newFilePath) abort
+ return [0, 'ts@getEditsForFileRename', {
+ \ 'oldFilePath': a:oldFilePath,
+ \ 'newFilePath': a:newFilePath,
+ \}]
+endfunction
+
function! ale#lsp#tsserver_message#OrganizeImports(buffer) abort
return [0, 'ts@organizeImports', {
\ 'scope': {
diff --git a/sources_non_forked/ale/autoload/ale/lsp_linter.vim b/sources_non_forked/ale/autoload/ale/lsp_linter.vim
index 230b3141..39e3e322 100644
--- a/sources_non_forked/ale/autoload/ale/lsp_linter.vim
+++ b/sources_non_forked/ale/autoload/ale/lsp_linter.vim
@@ -11,6 +11,22 @@ endif
" A Dictionary to track one-shot handlers for custom LSP requests
let s:custom_handlers_map = get(s:, 'custom_handlers_map', {})
+" Clear LSP linter data for the linting engine.
+function! ale#lsp_linter#ClearLSPData() abort
+ let s:lsp_linter_map = {}
+ let s:custom_handlers_map = {}
+endfunction
+
+" Only for internal use.
+function! ale#lsp_linter#GetLSPLinterMap() abort
+ return s:lsp_linter_map
+endfunction
+
+" Just for tests.
+function! ale#lsp_linter#SetLSPLinterMap(replacement_map) abort
+ let s:lsp_linter_map = a:replacement_map
+endfunction
+
" Check if diagnostics for a particular linter should be ignored.
function! s:ShouldIgnore(buffer, linter_name) abort
" Ignore all diagnostics if LSP integration is disabled.
@@ -33,7 +49,7 @@ endfunction
function! s:HandleLSPDiagnostics(conn_id, response) abort
let l:linter_name = s:lsp_linter_map[a:conn_id]
- let l:filename = ale#path#FromURI(a:response.params.uri)
+ let l:filename = ale#util#ToResource(a:response.params.uri)
let l:escaped_name = escape(
\ fnameescape(l:filename),
\ has('win32') ? '^' : '^,}]'
@@ -466,8 +482,8 @@ function! s:CheckWithLSP(linter, details) abort
" If this was a file save event, also notify the server of that.
if a:linter.lsp isnot# 'tsserver'
\&& getbufvar(l:buffer, 'ale_save_event_fired', 0)
- \&& ale#lsp#HasCapability(l:buffer, 'did_save')
- let l:include_text = ale#lsp#HasCapability(l:buffer, 'includeText')
+ \&& ale#lsp#HasCapability(l:id, 'did_save')
+ let l:include_text = ale#lsp#HasCapability(l:id, 'includeText')
let l:save_message = ale#lsp#message#DidSave(l:buffer, l:include_text)
let l:notified = ale#lsp#Send(l:id, l:save_message) != 0
endif
@@ -477,17 +493,6 @@ function! ale#lsp_linter#CheckWithLSP(buffer, linter) abort
return ale#lsp_linter#StartLSP(a:buffer, a:linter, function('s:CheckWithLSP'))
endfunction
-" Clear LSP linter data for the linting engine.
-function! ale#lsp_linter#ClearLSPData() abort
- let s:lsp_linter_map = {}
- let s:custom_handlers_map = {}
-endfunction
-
-" Just for tests.
-function! ale#lsp_linter#SetLSPLinterMap(replacement_map) abort
- let s:lsp_linter_map = a:replacement_map
-endfunction
-
function! s:HandleLSPResponseToCustomRequests(conn_id, response) abort
if has_key(a:response, 'id')
\&& has_key(s:custom_handlers_map, a:response.id)
diff --git a/sources_non_forked/ale/autoload/ale/organize_imports.vim b/sources_non_forked/ale/autoload/ale/organize_imports.vim
index e2b1c0d2..a6e77863 100644
--- a/sources_non_forked/ale/autoload/ale/organize_imports.vim
+++ b/sources_non_forked/ale/autoload/ale/organize_imports.vim
@@ -1,6 +1,6 @@
" Author: Jerko Steiner
" Description: Organize imports support for tsserver
-"
+
function! ale#organize_imports#HandleTSServerResponse(conn_id, response) abort
if get(a:response, 'command', '') isnot# 'organizeImports'
return
@@ -17,7 +17,10 @@ function! ale#organize_imports#HandleTSServerResponse(conn_id, response) abort
\ 'description': 'Organize Imports',
\ 'changes': l:file_code_edits,
\ },
- \ {}
+ \ {
+ \ 'conn_id': a:conn_id,
+ \ 'should_save': !&hidden,
+ \ },
\)
endfunction
diff --git a/sources_non_forked/ale/autoload/ale/path.vim b/sources_non_forked/ale/autoload/ale/path.vim
index c7bfd47e..cc5c6658 100644
--- a/sources_non_forked/ale/autoload/ale/path.vim
+++ b/sources_non_forked/ale/autoload/ale/path.vim
@@ -218,7 +218,7 @@ endfunction
" Convert a filesystem path to a file:// URI
" relatives paths will not be prefixed with the protocol.
" For Windows paths, the `:` in C:\ etc. will not be percent-encoded.
-function! ale#path#ToURI(path) abort
+function! ale#path#ToFileURI(path) abort
let l:has_drive_letter = a:path[1:2] is# ':\'
return substitute(
@@ -231,7 +231,7 @@ function! ale#path#ToURI(path) abort
\)
endfunction
-function! ale#path#FromURI(uri) abort
+function! ale#path#FromFileURI(uri) abort
if a:uri[:6] is? 'file://'
let l:encoded_path = a:uri[7:]
elseif a:uri[:4] is? 'file:'
diff --git a/sources_non_forked/ale/autoload/ale/python.vim b/sources_non_forked/ale/autoload/ale/python.vim
index 81cb06e0..4dc01798 100644
--- a/sources_non_forked/ale/autoload/ale/python.vim
+++ b/sources_non_forked/ale/autoload/ale/python.vim
@@ -26,6 +26,7 @@ function! ale#python#FindProjectRootIni(buffer) abort
\|| filereadable(l:path . '/tox.ini')
\|| filereadable(l:path . '/.pyre_configuration.local')
\|| filereadable(l:path . '/mypy.ini')
+ \|| filereadable(l:path . '/.mypy.ini')
\|| filereadable(l:path . '/pycodestyle.cfg')
\|| filereadable(l:path . '/.flake8')
\|| filereadable(l:path . '/.flake8rc')
diff --git a/sources_non_forked/ale/autoload/ale/references.vim b/sources_non_forked/ale/autoload/ale/references.vim
index 38ff0d3d..c32663fe 100644
--- a/sources_non_forked/ale/autoload/ale/references.vim
+++ b/sources_non_forked/ale/autoload/ale/references.vim
@@ -16,6 +16,23 @@ function! ale#references#ClearLSPData() abort
let s:references_map = {}
endfunction
+function! ale#references#FormatTSResponseItem(response_item, options) abort
+ if get(a:options, 'open_in') is# 'quickfix'
+ return {
+ \ 'filename': a:response_item.file,
+ \ 'lnum': a:response_item.start.line,
+ \ 'col': a:response_item.start.offset,
+ \}
+ else
+ return {
+ \ 'filename': a:response_item.file,
+ \ 'line': a:response_item.start.line,
+ \ 'column': a:response_item.start.offset,
+ \ 'match': substitute(a:response_item.lineText, '^\s*\(.\{-}\)\s*$', '\1', ''),
+ \}
+ endif
+endfunction
+
function! ale#references#HandleTSServerResponse(conn_id, response) abort
if get(a:response, 'command', '') is# 'references'
\&& has_key(s:references_map, a:response.request_seq)
@@ -25,23 +42,43 @@ function! ale#references#HandleTSServerResponse(conn_id, response) abort
let l:item_list = []
for l:response_item in a:response.body.refs
- call add(l:item_list, {
- \ 'filename': l:response_item.file,
- \ 'line': l:response_item.start.line,
- \ 'column': l:response_item.start.offset,
- \ 'match': substitute(l:response_item.lineText, '^\s*\(.\{-}\)\s*$', '\1', ''),
- \})
+ call add(
+ \ l:item_list,
+ \ ale#references#FormatTSResponseItem(l:response_item, l:options)
+ \)
endfor
if empty(l:item_list)
call ale#util#Execute('echom ''No references found.''')
else
- call ale#preview#ShowSelection(l:item_list, l:options)
+ if get(l:options, 'open_in') is# 'quickfix'
+ call setqflist([], 'r')
+ call setqflist(l:item_list, 'a')
+ call ale#util#Execute('cc 1')
+ else
+ call ale#preview#ShowSelection(l:item_list, l:options)
+ endif
endif
endif
endif
endfunction
+function! ale#references#FormatLSPResponseItem(response_item, options) abort
+ if get(a:options, 'open_in') is# 'quickfix'
+ return {
+ \ 'filename': ale#util#ToResource(a:response_item.uri),
+ \ 'lnum': a:response_item.range.start.line + 1,
+ \ 'col': a:response_item.range.start.character + 1,
+ \}
+ else
+ return {
+ \ 'filename': ale#util#ToResource(a:response_item.uri),
+ \ 'line': a:response_item.range.start.line + 1,
+ \ 'column': a:response_item.range.start.character + 1,
+ \}
+ endif
+endfunction
+
function! ale#references#HandleLSPResponse(conn_id, response) abort
if has_key(a:response, 'id')
\&& has_key(s:references_map, a:response.id)
@@ -53,18 +90,22 @@ function! ale#references#HandleLSPResponse(conn_id, response) abort
if type(l:result) is v:t_list
for l:response_item in l:result
- call add(l:item_list, {
- \ 'filename': ale#path#FromURI(l:response_item.uri),
- \ 'line': l:response_item.range.start.line + 1,
- \ 'column': l:response_item.range.start.character + 1,
- \})
+ call add(l:item_list,
+ \ ale#references#FormatLSPResponseItem(l:response_item, l:options)
+ \)
endfor
endif
if empty(l:item_list)
call ale#util#Execute('echom ''No references found.''')
else
- call ale#preview#ShowSelection(l:item_list, l:options)
+ if get(l:options, 'open_in') is# 'quickfix'
+ call setqflist([], 'r')
+ call setqflist(l:item_list, 'a')
+ call ale#util#Execute('cc 1')
+ else
+ call ale#preview#ShowSelection(l:item_list, l:options)
+ endif
endif
endif
endfunction
@@ -119,6 +160,8 @@ function! ale#references#Find(...) abort
let l:options.open_in = 'split'
elseif l:option is? '-vsplit'
let l:options.open_in = 'vsplit'
+ elseif l:option is? '-quickfix'
+ let l:options.open_in = 'quickfix'
endif
endfor
endif
diff --git a/sources_non_forked/ale/autoload/ale/rename.vim b/sources_non_forked/ale/autoload/ale/rename.vim
index 9030618e..a722cc94 100644
--- a/sources_non_forked/ale/autoload/ale/rename.vim
+++ b/sources_non_forked/ale/autoload/ale/rename.vim
@@ -84,7 +84,8 @@ function! ale#rename#HandleTSServerResponse(conn_id, response) abort
\ 'changes': l:changes,
\ },
\ {
- \ 'should_save': 1,
+ \ 'conn_id': a:conn_id,
+ \ 'should_save': !&hidden,
\ },
\)
endfunction
@@ -116,7 +117,8 @@ function! ale#rename#HandleLSPResponse(conn_id, response) abort
\ 'changes': l:changes,
\ },
\ {
- \ 'should_save': 1,
+ \ 'conn_id': a:conn_id,
+ \ 'should_save': !&hidden,
\ },
\)
endif
diff --git a/sources_non_forked/ale/autoload/ale/symbol.vim b/sources_non_forked/ale/autoload/ale/symbol.vim
index ae4151ab..6c65f1b2 100644
--- a/sources_non_forked/ale/autoload/ale/symbol.vim
+++ b/sources_non_forked/ale/autoload/ale/symbol.vim
@@ -41,7 +41,7 @@ function! ale#symbol#HandleLSPResponse(conn_id, response) abort
let l:location = l:response_item.location
call add(l:item_list, {
- \ 'filename': ale#path#FromURI(l:location.uri),
+ \ 'filename': ale#util#ToResource(l:location.uri),
\ 'line': l:location.range.start.line + 1,
\ 'column': l:location.range.start.character + 1,
\ 'match': l:response_item.name,
diff --git a/sources_non_forked/ale/autoload/ale/test.vim b/sources_non_forked/ale/autoload/ale/test.vim
index 4d75d515..e03ecb65 100644
--- a/sources_non_forked/ale/autoload/ale/test.vim
+++ b/sources_non_forked/ale/autoload/ale/test.vim
@@ -62,25 +62,34 @@ function! ale#test#SetFilename(path) abort
silent! noautocmd execute 'file ' . fnameescape(l:full_path)
endfunction
-function! s:RemoveModule(results) abort
+function! RemoveNewerKeys(results) abort
for l:item in a:results
if has_key(l:item, 'module')
call remove(l:item, 'module')
endif
+
+ if has_key(l:item, 'end_col')
+ call remove(l:item, 'end_col')
+ endif
+
+ if has_key(l:item, 'end_lnum')
+ call remove(l:item, 'end_lnum')
+ endif
endfor
endfunction
-" Return loclist data without the module string, only in newer Vim versions.
-function! ale#test#GetLoclistWithoutModule() abort
+" Return loclist data with only the keys supported by the lowest Vim versions.
+function! ale#test#GetLoclistWithoutNewerKeys() abort
let l:results = getloclist(0)
- call s:RemoveModule(l:results)
+ call RemoveNewerKeys(l:results)
return l:results
endfunction
-function! ale#test#GetQflistWithoutModule() abort
+" Return quickfix data with only the keys supported by the lowest Vim versions.
+function! ale#test#GetQflistWithoutNewerKeys() abort
let l:results = getqflist()
- call s:RemoveModule(l:results)
+ call RemoveNewerKeys(l:results)
return l:results
endfunction
diff --git a/sources_non_forked/ale/autoload/ale/toggle.vim b/sources_non_forked/ale/autoload/ale/toggle.vim
index 1311e527..122d6cc4 100644
--- a/sources_non_forked/ale/autoload/ale/toggle.vim
+++ b/sources_non_forked/ale/autoload/ale/toggle.vim
@@ -64,7 +64,8 @@ function! ale#toggle#ToggleBuffer(buffer) abort
" Disabling ALE globally removes autocmd events, so we cannot enable
" linting locally when linting is disabled globally
if l:enabled && !g:ale_enabled
- execute 'echom ''ALE cannot be enabled locally when disabled globally'''
+ " no-custom-checks
+ echom 'ALE cannot be enabled locally when disabled globally'
return
endif
diff --git a/sources_non_forked/ale/autoload/ale/uri.vim b/sources_non_forked/ale/autoload/ale/uri.vim
index e71c6340..d696f03d 100644
--- a/sources_non_forked/ale/autoload/ale/uri.vim
+++ b/sources_non_forked/ale/autoload/ale/uri.vim
@@ -25,3 +25,19 @@ function! ale#uri#Decode(value) abort
\ 'g'
\)
endfunction
+
+let s:uri_handlers = {
+\ 'jdt': {
+\ 'OpenURILink': function('ale#uri#jdt#OpenJDTLink'),
+\ }
+\}
+
+function! ale#uri#GetURIHandler(uri) abort
+ for l:scheme in keys(s:uri_handlers)
+ if a:uri =~# '^'.l:scheme.'://'
+ return s:uri_handlers[scheme]
+ endif
+ endfor
+
+ return v:null
+endfunction
diff --git a/sources_non_forked/ale/autoload/ale/uri/jdt.vim b/sources_non_forked/ale/autoload/ale/uri/jdt.vim
new file mode 100644
index 00000000..46cea268
--- /dev/null
+++ b/sources_non_forked/ale/autoload/ale/uri/jdt.vim
@@ -0,0 +1,110 @@
+" Author: yoshi1123
+" Description: Functions for working with jdt:// URIs.
+
+function! s:OpenJDTLink(root, uri, line, column, options, result) abort
+ if has_key(a:result, 'error')
+ " no-custom-checks
+ echoerr a:result.error.message
+
+ return
+ endif
+
+ let l:contents = a:result['result']
+
+ if type(l:contents) is# type(v:null)
+ " no-custom-checks
+ echoerr 'File content not found'
+ endif
+
+ " disable autocmd when opening buffer
+ autocmd! AleURISchemes
+ call ale#util#Open(a:uri, a:line, a:column, a:options)
+ autocmd AleURISchemes BufNewFile,BufReadPre jdt://** call ale#uri#jdt#ReadJDTLink(expand(''))
+
+ if !empty(getbufvar(bufnr(''), 'ale_lsp_root', ''))
+ return
+ endif
+
+ let b:ale_lsp_root = a:root
+ set filetype=java
+
+ call setline(1, split(l:contents, '\n'))
+ call cursor(a:line, a:column)
+ normal! zz
+
+ setlocal buftype=nofile nomodified nomodifiable readonly
+endfunction
+
+" Load new buffer with jdt:// contents and jump to line and column.
+function! ale#uri#jdt#OpenJDTLink(encoded_uri, line, column, options, conn_id) abort
+ let l:found_eclipselsp = v:false
+
+ for l:linter in ale#linter#Get('java')
+ if l:linter.name is# 'eclipselsp'
+ let l:found_eclipselsp = v:true
+ endif
+ endfor
+
+ if !l:found_eclipselsp
+ throw 'eclipselsp not running'
+ endif
+
+ let l:root = a:conn_id[stridx(a:conn_id, ':')+1:]
+ let l:uri = a:encoded_uri
+ call ale#lsp_linter#SendRequest(
+ \ bufnr(''),
+ \ 'eclipselsp',
+ \ [0, 'java/classFileContents', {'uri': ale#util#ToURI(l:uri)}],
+ \ function('s:OpenJDTLink', [l:root, l:uri, a:line, a:column, a:options])
+ \)
+endfunction
+
+function! s:ReadClassFileContents(uri, result) abort
+ if has_key(a:result, 'error')
+ " no-custom-checks
+ echoerr a:result.error.message
+
+ return
+ endif
+
+ let l:contents = a:result['result']
+
+ if type(l:contents) is# type(v:null)
+ " no-custom-checks
+ echoerr 'File content not found'
+ endif
+
+ call setline(1, split(l:contents, '\n'))
+
+ setlocal buftype=nofile nomodified nomodifiable readonly
+endfunction
+
+" Read jdt:// contents, as part of current project, into current buffer.
+function! ale#uri#jdt#ReadJDTLink(encoded_uri) abort
+ if !empty(getbufvar(bufnr(''), 'ale_lsp_root', ''))
+ return
+ endif
+
+ let l:linter_map = ale#lsp_linter#GetLSPLinterMap()
+
+ for l:conn_id in keys(l:linter_map)
+ if l:linter_map[l:conn_id] is# 'eclipselsp'
+ let l:root = l:conn_id[stridx(l:conn_id, ':')+1:]
+ endif
+ endfor
+
+ if l:root is# v:null
+ throw 'eclipselsp not running'
+ endif
+
+ let l:uri = a:encoded_uri
+ let b:ale_lsp_root = l:root
+ set filetype=java
+
+ call ale#lsp_linter#SendRequest(
+ \ bufnr(''),
+ \ 'eclipselsp',
+ \ [0, 'java/classFileContents', {'uri': ale#util#ToURI(l:uri)}],
+ \ function('s:ReadClassFileContents', [l:uri])
+ \)
+endfunction
diff --git a/sources_non_forked/ale/autoload/ale/util.vim b/sources_non_forked/ale/autoload/ale/util.vim
index ec9383ac..c884076a 100644
--- a/sources_non_forked/ale/autoload/ale/util.vim
+++ b/sources_non_forked/ale/autoload/ale/util.vim
@@ -25,7 +25,8 @@ function! ale#util#ShowMessage(string, ...) abort
" We have to assume the user is using a monospace font.
if has('nvim') || (a:string !~? "\n" && len(a:string) < &columns)
- execute 'echo a:string'
+ " no-custom-checks
+ echo a:string
else
call ale#preview#Show(split(a:string, "\n"), extend(
\ {
@@ -491,8 +492,12 @@ function! ale#util#FindItemAtCursor(buffer) abort
return [l:info, l:loc]
endfunction
-function! ale#util#Input(message, value) abort
- return input(a:message, a:value)
+function! ale#util#Input(message, value, ...) abort
+ if a:0 > 0
+ return input(a:message, a:value, a:1)
+ else
+ return input(a:message, a:value)
+ endif
endfunction
function! ale#util#HasBuflineApi() abort
@@ -539,3 +544,31 @@ endfunction
function! ale#util#GetBufferContents(buffer) abort
return join(getbufline(a:buffer, 1, '$'), '\n') . '\n'
endfunction
+
+function! ale#util#ToURI(resource) abort
+ let l:uri_handler = ale#uri#GetURIHandler(a:resource)
+
+ if l:uri_handler is# v:null
+ " resource is a filesystem path
+ let l:uri = ale#path#ToFileURI(a:resource)
+ else
+ " resource is a URI
+ let l:uri = a:resource
+ endif
+
+ return l:uri
+endfunction
+
+function! ale#util#ToResource(uri) abort
+ let l:uri_handler = ale#uri#GetURIHandler(a:uri)
+
+ if l:uri_handler is# v:null
+ " resource is a filesystem path
+ let l:resource = ale#path#FromFileURI(a:uri)
+ else
+ " resource is a URI
+ let l:resource = a:uri
+ endif
+
+ return l:resource
+endfunction
diff --git a/sources_non_forked/ale/autoload/ale/virtualtext.vim b/sources_non_forked/ale/autoload/ale/virtualtext.vim
index 598bc1bf..345deb70 100644
--- a/sources_non_forked/ale/autoload/ale/virtualtext.vim
+++ b/sources_non_forked/ale/autoload/ale/virtualtext.vim
@@ -18,26 +18,6 @@ elseif has('textprop') && has('popupwin')
let s:has_virt_text = 1
endif
-if !hlexists('ALEVirtualTextError')
- highlight link ALEVirtualTextError ALEError
-endif
-
-if !hlexists('ALEVirtualTextStyleError')
- highlight link ALEVirtualTextStyleError ALEVirtualTextError
-endif
-
-if !hlexists('ALEVirtualTextWarning')
- highlight link ALEVirtualTextWarning ALEWarning
-endif
-
-if !hlexists('ALEVirtualTextStyleWarning')
- highlight link ALEVirtualTextStyleWarning ALEVirtualTextWarning
-endif
-
-if !hlexists('ALEVirtualTextInfo')
- highlight link ALEVirtualTextInfo ALEVirtualTextWarning
-endif
-
function! ale#virtualtext#Clear() abort
if !s:has_virt_text
return
diff --git a/sources_non_forked/ale/doc/ale-ada.txt b/sources_non_forked/ale/doc/ale-ada.txt
index 0fc55a9c..80321dbb 100644
--- a/sources_non_forked/ale/doc/ale-ada.txt
+++ b/sources_non_forked/ale/doc/ale-ada.txt
@@ -2,6 +2,11 @@
ALE Ada Integration *ale-ada-options*
+===============================================================================
+cspell *ale-ada-cspell*
+
+See |ale-cspell-options|
+
===============================================================================
gcc *ale-ada-gcc*
diff --git a/sources_non_forked/ale/doc/ale-asciidoc.txt b/sources_non_forked/ale/doc/ale-asciidoc.txt
index 86629fd4..dd8b12ff 100644
--- a/sources_non_forked/ale/doc/ale-asciidoc.txt
+++ b/sources_non_forked/ale/doc/ale-asciidoc.txt
@@ -2,6 +2,12 @@
ALE AsciiDoc Integration *ale-asciidoc-options*
+===============================================================================
+cspell *ale-asciidoc-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
write-good *ale-asciidoc-write-good*
diff --git a/sources_non_forked/ale/doc/ale-avra.txt b/sources_non_forked/ale/doc/ale-avra.txt
new file mode 100644
index 00000000..a61913ad
--- /dev/null
+++ b/sources_non_forked/ale/doc/ale-avra.txt
@@ -0,0 +1,26 @@
+===============================================================================
+ALE AVRA Integration *ale-avra-options*
+
+
+===============================================================================
+avra *ale-avra-avra*
+
+g:ale_avra_avra_executable *g:ale_avra_avra_executable*
+ *b:ale_avra_avra_executable*
+
+ Type: |String|
+ Default `'avra'`
+
+ This variable can be changed to use different executable for AVRA.
+
+
+g:ale_avra_avra_options *g:ale_avra_avra_options*
+ *b:ale_avra_avra_options*
+ Type: |String|
+ Default: `''`
+
+ This variable can be set to pass additional options to AVRA.
+
+
+===============================================================================
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-bitbake.txt b/sources_non_forked/ale/doc/ale-bitbake.txt
new file mode 100644
index 00000000..4c480fd4
--- /dev/null
+++ b/sources_non_forked/ale/doc/ale-bitbake.txt
@@ -0,0 +1,31 @@
+===============================================================================
+ALE BitBake Integration *ale-bitbake-options*
+
+
+===============================================================================
+oelint-adv *ale-bitbake-oelint_adv*
+
+g:ale_bitbake_oelint_adv_executable *g:ale_bitbake_oelint_adv_executable*
+
+ Type: |String|
+ Default: `'oelint-adv'`
+
+ This variable can be changed to use a different executable for oelint-adv.
+
+g:ale_bitbake_oelint_adv_options *g:ale_bitbake_oelint_adv_options*
+
+ Type: |String|
+ Default: `''`
+
+ This variable can be set to pass additional options to oelint-adv.
+
+ g:ale_bitbake_oelint_adv_config *g:ale_bitbake_oelint_adv_config*
+
+ Type: |String|
+ Default: `'.oelint.cfg'`
+
+ This variable can be set to use a different config file.
+
+
+===============================================================================
+vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-c.txt b/sources_non_forked/ale/doc/ale-c.txt
index 3b9fbc44..bd8c4937 100644
--- a/sources_non_forked/ale/doc/ale-c.txt
+++ b/sources_non_forked/ale/doc/ale-c.txt
@@ -352,6 +352,12 @@ g:ale_cpp_cquery_cache_directory *g:ale_c_cquery_cache_directory*
cache.
+===============================================================================
+cspell *ale-c-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
flawfinder *ale-c-flawfinder*
diff --git a/sources_non_forked/ale/doc/ale-cmake.txt b/sources_non_forked/ale/doc/ale-cmake.txt
index 602637b1..e44c328e 100644
--- a/sources_non_forked/ale/doc/ale-cmake.txt
+++ b/sources_non_forked/ale/doc/ale-cmake.txt
@@ -21,6 +21,25 @@ g:ale_cmake_cmakelint_options *g:ale_cmake_cmakelint_options*
This variable can be set to pass additional options to cmakelint.
+===============================================================================
+cmake-lint *ale-cmake-cmake-lint*
+
+g:ale_cmake_cmake_lint_executable *g:ale_cmake_cmake_lint_executable*
+ *b:ale_cmake_cmake_lint_executable*
+ Type: |String|
+ Default: `'cmake-lint'`
+
+ This variable can be set to change the path the cmake-lint.
+
+
+g:ale_cmake_cmake_lint_options *g:ale_cmake_cmake_lint_options*
+ *b:ale_cmake_cmake_lint_options*
+ Type: |String|
+ Default: `''`
+
+ This variable can be set to pass additional options to cmake-lint.
+
+
===============================================================================
cmake-format *ale-cmake-cmakeformat*
diff --git a/sources_non_forked/ale/doc/ale-cpp.txt b/sources_non_forked/ale/doc/ale-cpp.txt
index 17894e6e..1f079205 100644
--- a/sources_non_forked/ale/doc/ale-cpp.txt
+++ b/sources_non_forked/ale/doc/ale-cpp.txt
@@ -287,6 +287,21 @@ g:ale_cpp_cpplint_options *g:ale_cpp_cpplint_options*
This variable can be changed to modify flags given to cpplint.
+g:ale_c_cpplint_executable *g:ale_c_cpplint_executable*
+ *b:ale_c_cpplint_executable*
+ Type: |String|
+ Default: `'cpplint'`
+
+ This variable can be changed to use a different executable for cpplint.
+
+
+g:ale_c_cpplint_options *g:ale_c_cpplint_options*
+ *b:ale_c_cpplint_options*
+ Type: |String|
+ Default: `''`
+
+ This variable can be changed to modify flags given to cpplint.
+
===============================================================================
cquery *ale-cpp-cquery*
@@ -308,6 +323,12 @@ g:ale_cpp_cquery_cache_directory *g:ale_cpp_cquery_cache_directory*
cache.
+===============================================================================
+cspell *ale-cpp-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
flawfinder *ale-cpp-flawfinder*
diff --git a/sources_non_forked/ale/doc/ale-cs.txt b/sources_non_forked/ale/doc/ale-cs.txt
index bef495b9..26e2b023 100644
--- a/sources_non_forked/ale/doc/ale-cs.txt
+++ b/sources_non_forked/ale/doc/ale-cs.txt
@@ -90,6 +90,12 @@ g:ale_cs_csc_assemblies *g:ale_cs_csc_assemblies*
\]
<
+===============================================================================
+cspell *ale-cs-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
dotnet-format *ale-cs-dotnet-format*
diff --git a/sources_non_forked/ale/doc/ale-css.txt b/sources_non_forked/ale/doc/ale-css.txt
index ff74b263..f5c240e8 100644
--- a/sources_non_forked/ale/doc/ale-css.txt
+++ b/sources_non_forked/ale/doc/ale-css.txt
@@ -2,6 +2,12 @@
ALE CSS Integration *ale-css-options*
+===============================================================================
+cspell *ale-css-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
fecs *ale-css-fecs*
@@ -43,5 +49,18 @@ g:ale_css_stylelint_use_global *g:ale_css_stylelint_use_global*
See |ale-integrations-local-executables|
+===============================================================================
+vscodecss *ale-css-vscode*
+
+Website: https://github.com/hrsh7th/vscode-langservers-extracted
+
+Installation
+-------------------------------------------------------------------------------
+
+Install VSCode css language server either globally or locally: >
+
+ npm install -g vscode-langservers-extracted
+<
+
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-dart.txt b/sources_non_forked/ale/doc/ale-dart.txt
index a046808b..4824e82e 100644
--- a/sources_non_forked/ale/doc/ale-dart.txt
+++ b/sources_non_forked/ale/doc/ale-dart.txt
@@ -87,39 +87,6 @@ g:ale_dart_format_options *g:ale_dart_format_options*
This variable can be set to pass additional options to the dart format fixer.
-
-===============================================================================
-dartanalyzer *ale-dart-dartanalyzer*
-
-Installation
--------------------------------------------------------------------------------
-
-Install Dart via whatever means. `dartanalyzer` will be included in the SDK.
-
-You can add the SDK to `$PATH`, as described here:
-https://www.dartlang.org/tools/sdk
-
-If you have installed Dart on Linux, you can also try the following: >
- " Set the executable path for dartanalyzer to the absolute path to it.
- let g:ale_dart_dartanalyzer_executable = '/usr/lib/dart/bin/dartanalyzer'
-<
-... 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
--------------------------------------------------------------------------------
-
-g:ale_dart_dartanalyzer_executable *g:ale_dart_dartanalyzer_executable*
- *b:ale_dart_dartanalyzer_executable*
- Type: |String|
- Default: `'dartanalyzer'`
-
- This variable can be set to change the path to dartanalyzer.
-
-
===============================================================================
dartfmt *ale-dart-dartfmt*
diff --git a/sources_non_forked/ale/doc/ale-development.txt b/sources_non_forked/ale/doc/ale-development.txt
index 3d0dd524..4b4b4c77 100644
--- a/sources_non_forked/ale/doc/ale-development.txt
+++ b/sources_non_forked/ale/doc/ale-development.txt
@@ -14,6 +14,7 @@ CONTENTS *ale-development-contents*
4.1. Writing Linter Tests.............|ale-development-linter-tests|
4.2. Writing Fixer Tests..............|ale-development-fixer-tests|
4.3. Running Tests in a Windows VM....|ale-development-windows-tests|
+ 5. Contributing.........................|ale-development-contributing|
===============================================================================
1. Introduction *ale-development-introduction*
@@ -97,8 +98,8 @@ should also follow some additional rules designed to prevent mistakes. Some of
these are reported with ALE's `custom-linting-rules` script. See
|ale-development-tests|.
-* Don't leave stray `:echo` lines in code. Use `execute 'echo' ...` if you must
- echo something.
+* Don't leave stray `:echo` lines in code. Write `" no-custom-checks` above
+ the line if you must echo something.
* For strings use |is#| instead of |==#|, `is?` instead of `==?`, `isnot#`
instead of `!=#`, and `isnot?` instead of `!=?`. This is because `'x' ==# 0`
returns 1, while `'x' is# 0` returns 0, so you will experience fewer issues
@@ -153,10 +154,10 @@ ALE runs tests with the following versions of Vim in the following
environments.
1. Vim 8.0.0027 on Linux via GitHub Actions.
-2. Vim 8.2.2401 on Linux via GitHub Actions.
+2. Vim 8.2.4693 on Linux via GitHub Actions.
3. NeoVim 0.2.0 on Linux via GitHub Actions.
4. NeoVim 0.4.4 on Linux via GitHub Actions.
-5. NeoVim 0.5.0 on Linux via GitHub Actions.
+5. NeoVim 0.6.1 on Linux via GitHub Actions.
6. Vim 8 (stable builds) on Windows via AppVeyor.
If you are developing ALE code on Linux, Mac OSX, or BSD, you can run ALEs
@@ -444,5 +445,23 @@ You can run a specific test by passing the filename as an argument to the
batch file, for example: `run-tests test/test_c_flag_parsing.vader` . This will
give you results much more quickly.
+===============================================================================
+5. Contributing *ale-development-contributing*
+
+All integration of new code into ALE is done through GitHub pull requests.
+Using that tool streamlines the process and minimizes the time and effort
+required to e.g. ensure test suites are run for every change.
+
+As for any project hosted by GitHub, the choice of platform demands every
+contributor to take care to setup an account and configure it accordingly.
+
+Due to details of our process, a difference to many other GitHub hosted
+projects is that contributors who wish to keep the author fields for their
+commits unaltered need to configure a public email address in their account
+and profile settings. See: https://docs.github.com/en/account-and-profile/
+
+Unless configuring GitHub to expose contact details, commits will be rewritten
+to appear by `USERNAME ` .
+
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-dockerfile.txt b/sources_non_forked/ale/doc/ale-dockerfile.txt
index 284c6a10..b6e87623 100644
--- a/sources_non_forked/ale/doc/ale-dockerfile.txt
+++ b/sources_non_forked/ale/doc/ale-dockerfile.txt
@@ -25,6 +25,12 @@ g:ale_dockerfile_dockerfile_lint_options
the dockerfile lint invocation - like custom rule file definitions.
+===============================================================================
+dprint *ale-dockerfile-dprint*
+
+See |ale-dprint-options| and https://dprint.dev/plugins/dockerfile
+
+
===============================================================================
hadolint *ale-dockerfile-hadolint*
diff --git a/sources_non_forked/ale/doc/ale-elixir.txt b/sources_non_forked/ale/doc/ale-elixir.txt
index a4e5c2c6..693db5aa 100644
--- a/sources_non_forked/ale/doc/ale-elixir.txt
+++ b/sources_non_forked/ale/doc/ale-elixir.txt
@@ -5,7 +5,6 @@ ALE Elixir Integration *ale-elixir-options*
===============================================================================
mix *ale-elixir-mix*
-
The `mix` linter is disabled by default, as it can be too expensive to run.
See `:help g:ale_linters`
@@ -18,6 +17,7 @@ g:ale_elixir_mix_options *g:ale_elixir_mix_options*
This variable can be changed to specify the mix executable.
+
===============================================================================
mix_format *ale-elixir-mix-format*
@@ -30,6 +30,7 @@ g:ale_elixir_mix_format_options *g:ale_elixir_mix_format_options*
This variable can be changed to specify the mix options passed to the
mix_format fixer
+
===============================================================================
dialyxir *ale-elixir-dialyxir*
@@ -45,6 +46,7 @@ configured on your project's `mix.exs`.
See https://github.com/jeremyjh/dialyxir#with-explaining-stuff for more
information.
+
===============================================================================
elixir-ls *ale-elixir-elixir-ls*
@@ -72,6 +74,8 @@ g:ale_elixir_elixir_ls_config *g:ale_elixir_elixir_ls_config*
\ }
<
Consult the ElixirLS documentation for more information about settings.
+
+
===============================================================================
credo *ale-elixir-credo*
@@ -79,18 +83,26 @@ Credo (https://github.com/rrrene/credo)
g:ale_elixir_credo_strict *g:ale_elixir_credo_strict*
- Type: Integer
- Default: 0
+ Type: |Integer|
+ Default: `0`
Tells credo to run in strict mode or suggest mode. Set variable to 1 to
enable --strict mode.
-g:ale_elixir_credo_config_file g:ale_elixir_credo_config_file
- Type: String
- Default: ''
+g:ale_elixir_credo_config_file *g:ale_elixir_credo_config_file*
+
+ Type: |String|
+ Default: `''`
Tells credo to use a custom configuration file.
+
+===============================================================================
+cspell *ale-elixir-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-go.txt b/sources_non_forked/ale/doc/ale-go.txt
index 2f1e4c1c..bce85470 100644
--- a/sources_non_forked/ale/doc/ale-go.txt
+++ b/sources_non_forked/ale/doc/ale-go.txt
@@ -39,7 +39,6 @@ g:ale_go_go111module *g:ale_go_go111module*
golang tools.
-
===============================================================================
bingo *ale-go-bingo*
@@ -57,6 +56,11 @@ g:ale_go_bingo_options *g:ale_go_bingo_options*
Default: `''`
+===============================================================================
+cspell *ale-go-cspell*
+
+See |ale-cspell-options|
+
===============================================================================
gobuild *ale-go-gobuild*
@@ -80,6 +84,24 @@ g:ale_go_gofmt_options *g:ale_go_gofmt_options*
This variable can be set to pass additional options to the gofmt fixer.
+===============================================================================
+gofumpt *ale-go-gofumpt*
+
+g:ale_go_gofumpt_executable *g:ale_go_gofumpt_executable*
+ *b:ale_go_gofumpt_executable*
+ Type: |String|
+ Default: `'gofumpt'`
+
+ Executable to run to use as the gofumpt fixer.
+
+g:ale_go_gofumpt_options *g:ale_go_gofumpt_options*
+ *b:ale_go_gofumpt_options*
+ Type: |String|
+ Default: `''`
+
+ Options to pass to the gofumpt fixer.
+
+
===============================================================================
golangci-lint *ale-go-golangci-lint*
@@ -133,6 +155,7 @@ g:ale_go_langserver_options *g:ale_go_langserver_options*
`-gocodecompletion` option is ignored because it is handled automatically
by the |g:ale_completion_enabled| variable.
+
===============================================================================
golines *ale-go-golines*
@@ -148,9 +171,10 @@ g:ale_go_golines_options *g:ale_go_golines_options*
Type: |String|
Default: ''
- Additional options passed to the golines command. By default golines has
+ Additional options passed to the golines command. By default golines has
--max-length=100 (lines above 100 characters will be wrapped)
+
===============================================================================
golint *ale-go-golint*
@@ -330,7 +354,7 @@ g:ale_go_staticcheck_options *g:ale_go_staticcheck_options*
g:ale_go_staticcheck_lint_package *g:ale_go_staticcheck_lint_package*
*b:ale_go_staticcheck_lint_package*
Type: |Number|
- Default: `0`
+ Default: `1`
When set to `1`, the whole Go package will be checked instead of only the
current file.
diff --git a/sources_non_forked/ale/doc/ale-haskell.txt b/sources_non_forked/ale/doc/ale-haskell.txt
index 09894340..9e65cc62 100644
--- a/sources_non_forked/ale/doc/ale-haskell.txt
+++ b/sources_non_forked/ale/doc/ale-haskell.txt
@@ -13,6 +13,12 @@ g:ale_haskell_brittany_executable *g:ale_haskell_brittany_executable*
This variable can be changed to use a different executable for brittany.
+===============================================================================
+cspell *ale-haskell-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
floskell *ale-haskell-floskell*
@@ -136,6 +142,20 @@ g:ale_haskell_hls_executable *g:ale_haskell_hls_executable*
language server.
+g:ale_haskell_hls_config *g:ale_haskell_hls_config*
+ *b:ale_haskell_hls_config*
+ Type: |Dictionary|
+ Default: `{}`
+
+ Dictionary with configuration settings for HLS. For example, to see more
+ completions:
+>
+ let g:ale_haskell_hls_config = {'haskell': {'maxCompletions': 250}}
+<
+ Refer to HLS documentation for possible settings:
+ https://haskell-language-server.readthedocs.io/en/latest/configuration.html#language-specific-server-options
+
+
===============================================================================
stack-build *ale-haskell-stack-build*
diff --git a/sources_non_forked/ale/doc/ale-hcl.txt b/sources_non_forked/ale/doc/ale-hcl.txt
index 59b0a9da..71e1114e 100644
--- a/sources_non_forked/ale/doc/ale-hcl.txt
+++ b/sources_non_forked/ale/doc/ale-hcl.txt
@@ -2,6 +2,11 @@
ALE HCL Integration *ale-hcl-options*
+===============================================================================
+packer-fmt *ale-hcl-packer-fmt*
+
+See |ale-packer-fmt-fixer| for information about the available options.
+
===============================================================================
terraform-fmt *ale-hcl-terraform-fmt*
diff --git a/sources_non_forked/ale/doc/ale-help.txt b/sources_non_forked/ale/doc/ale-help.txt
new file mode 100644
index 00000000..89872545
--- /dev/null
+++ b/sources_non_forked/ale/doc/ale-help.txt
@@ -0,0 +1,12 @@
+===============================================================================
+ALE Help Integration *ale-help-options*
+
+
+===============================================================================
+cspell *ale-help-cspell*
+
+See |ale-cspell-options|
+
+
+===============================================================================
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-html.txt b/sources_non_forked/ale/doc/ale-html.txt
index 2c048148..d945acdf 100644
--- a/sources_non_forked/ale/doc/ale-html.txt
+++ b/sources_non_forked/ale/doc/ale-html.txt
@@ -28,6 +28,11 @@ g:ale_html_angular_use_global *g:ale_html_angular_use_global*
See |ale-integrations-local-executables|
+===============================================================================
+cspell *ale-html-cspell*
+
+See |ale-cspell-options|
+
===============================================================================
fecs *ale-html-fecs*
@@ -159,6 +164,19 @@ g:ale_html_tidy_use_global *g:html_tidy_use_global*
See |ale-integrations-local-executables|
+===============================================================================
+vscodehtml *ale-html-vscode*
+
+Website: https://github.com/hrsh7th/vscode-langservers-extracted
+
+Installation
+-------------------------------------------------------------------------------
+
+Install VSCode html language server either globally or locally: >
+
+ npm install -g vscode-langservers-extracted
+<
+
===============================================================================
write-good *ale-html-write-good*
diff --git a/sources_non_forked/ale/doc/ale-java.txt b/sources_non_forked/ale/doc/ale-java.txt
index 6bd04ef9..fa38fd3a 100644
--- a/sources_non_forked/ale/doc/ale-java.txt
+++ b/sources_non_forked/ale/doc/ale-java.txt
@@ -41,6 +41,12 @@ g:ale_java_checkstyle_options *g:ale_java_checkstyle_options*
configuration files set with |g:ale_java_checkstyle_config|.
+===============================================================================
+cspell *ale-java-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
javac *ale-java-javac*
@@ -91,7 +97,6 @@ List type:
\ ]
<
-
===============================================================================
google-java-format *ale-java-google-java-format*
@@ -190,6 +195,7 @@ The Java language server will look for the dependencies you specify in
`externalDependencies` array in your Maven and Gradle caches ~/.m2 and
~/.gradle.
+
===============================================================================
eclipselsp *ale-java-eclipselsp*
@@ -218,8 +224,9 @@ g:ale_java_eclipselsp_path *g:ale_java_eclipselsp_path*
Default: `'$HOME/eclipse.jdt.ls'`
Absolute path to the location of the eclipse.jdt.ls repository folder. Or if
- you have VSCode extension installed the absolute path to the VSCode extensions
- folder (e.g. $HOME/.vscode/extensions/redhat.java-0.4x.0 in Linux).
+ you have VSCode extension installed the absolute path to the VSCode
+ extensions folder (e.g. $HOME/.vscode/extensions/redhat.java-0.4x.0 in
+ Linux).
g:ale_java_eclipselsp_executable *g:ale_java_eclipse_executable*
@@ -261,7 +268,8 @@ g:ale_java_eclipselsp_javaagent *g:ale_java_eclipselsp_javaagent*
Default: `''`
A variable to add java agent for annotation processing such as Lombok.
- If you have multiple java agent files, use space to separate them. For example:
+ If you have multiple java agent files, use space to separate them.
+ For example:
>
let g:ale_java_eclipselsp_javaagent='/eclipse/lombok.jar /eclipse/jacoco.jar'
<
diff --git a/sources_non_forked/ale/doc/ale-javascript.txt b/sources_non_forked/ale/doc/ale-javascript.txt
index acd886c9..7d626efe 100644
--- a/sources_non_forked/ale/doc/ale-javascript.txt
+++ b/sources_non_forked/ale/doc/ale-javascript.txt
@@ -23,11 +23,24 @@ To this: >
/path/foo/bar/.eslintrc.js # extends: ["/path/foo/.base-eslintrc.js"]
<
+===============================================================================
+cspell *ale-javascript-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
deno *ale-javascript-deno*
Check the docs over at |ale-typescript-deno|.
+
+===============================================================================
+dprint *ale-javascript-dprint*
+
+See |ale-dprint-options| and https://dprint.dev/plugins/typescript
+
+
===============================================================================
eslint *ale-javascript-eslint*
diff --git a/sources_non_forked/ale/doc/ale-json.txt b/sources_non_forked/ale/doc/ale-json.txt
index ad0a05b1..154aee62 100644
--- a/sources_non_forked/ale/doc/ale-json.txt
+++ b/sources_non_forked/ale/doc/ale-json.txt
@@ -2,6 +2,18 @@
ALE JSON Integration *ale-json-options*
+===============================================================================
+cspell *ale-json-cspell*
+
+See |ale-cspell-options|
+
+
+===============================================================================
+dprint *ale-json-dprint*
+
+See |ale-dprint-options| and https://dprint.dev/plugins/json
+
+
===============================================================================
eslint *ale-json-eslint*
@@ -141,6 +153,18 @@ g:ale_json_spectral_use_global *g:ale_json_spectral_use_global*
See |ale-integrations-local-executables|
+===============================================================================
+vscodejson *ale-json-vscode*
+
+Website: https://github.com/hrsh7th/vscode-langservers-extracted
+
+Installation
+-------------------------------------------------------------------------------
+
+Install VSCode json language server either globally or locally: >
+
+ npm install -g vscode-langservers-extracted
+<
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-latex.txt b/sources_non_forked/ale/doc/ale-latex.txt
index bedbabcd..b3029a5b 100644
--- a/sources_non_forked/ale/doc/ale-latex.txt
+++ b/sources_non_forked/ale/doc/ale-latex.txt
@@ -2,6 +2,9 @@
ALE LaTeX Integration *ale-latex-options*
+===============================================================================
+cspell *ale-latex-cspell*
+
===============================================================================
write-good *ale-latex-write-good*
@@ -9,10 +12,10 @@ See |ale-write-good-options|
===============================================================================
-textlint *ale-latex-textlint*
+textlint *ale-latex-textlint*
See |ale-text-textlint|
===============================================================================
-vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-lua.txt b/sources_non_forked/ale/doc/ale-lua.txt
index ac92b9ac..7ee60d0e 100644
--- a/sources_non_forked/ale/doc/ale-lua.txt
+++ b/sources_non_forked/ale/doc/ale-lua.txt
@@ -1,6 +1,13 @@
===============================================================================
ALE Lua Integration *ale-lua-options*
+
+===============================================================================
+cspell *ale-lua-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
lua-format *ale-lua-lua-format*
@@ -11,6 +18,7 @@ g:ale_lua_lua_format_executable *g:ale_lua_lua_format_executable*
This variable can be changed to change the path to lua-format.
+
g:ale_lua_lua_format_options *g:ale_lua_lua_format_options*
*b:ale_lua_lua_format_options*
Type: |String|
@@ -29,6 +37,7 @@ g:ale_lua_luac_executable *g:ale_lua_luac_executable*
This variable can be changed to change the path to luac.
+
===============================================================================
luacheck *ale-lua-luacheck*
@@ -58,6 +67,7 @@ g:ale_lua_luafmt_executable *g:ale_lua_luafmt_executable*
This variable can be set to use a different executable for luafmt.
+
g:ale_lua_luafmt_options *g:ale_lua_luafmt_options*
*b:ale_lua_luafmt_options*
Type: |String|
@@ -66,6 +76,25 @@ g:ale_lua_luafmt_options *g:ale_lua_luafmt_options*
This variable can be set to pass additional options to the luafmt fixer.
+===============================================================================
+selene *ale-lua-selene*
+
+g:ale_lua_selene_executable *g:ale_lua_selene_executable*
+ *b:ale_lua_selene_executable*
+ Type: |String|
+ Default: `'selene'`
+
+ This variable can be set to use a different executable for selene.
+
+
+g:ale_lua_selene_options *g:ale_lua_selene_options*
+ *b:ale_lua_selene_options*
+ Type: |String|
+ Default: `''`
+
+ This variable can be set to pass additional options to selene.
+
+
===============================================================================
stylua *ale-lua-stylua*
@@ -76,6 +105,7 @@ g:ale_lua_stylua_executable *g:ale_lua_stylua_executable*
This variable can be set to use a different executable for stylua.
+
g:ale_lua_stylua_options *g:ale_lua_stylua_options*
*b:ale_lua_stylua_options*
Type: |String|
diff --git a/sources_non_forked/ale/doc/ale-markdown.txt b/sources_non_forked/ale/doc/ale-markdown.txt
index feb37fc9..6ba78ff0 100644
--- a/sources_non_forked/ale/doc/ale-markdown.txt
+++ b/sources_non_forked/ale/doc/ale-markdown.txt
@@ -2,6 +2,18 @@
ALE Markdown Integration *ale-markdown-options*
+===============================================================================
+cspell *ale-markdown-cspell*
+
+See |ale-cspell-options|
+
+
+===============================================================================
+dprint *ale-markdown-dprint*
+
+See |ale-dprint-options| and https://dprint.dev/plugins/markdown
+
+
===============================================================================
markdownlint *ale-markdown-markdownlint*
@@ -98,4 +110,4 @@ See |ale-write-good-options|
===============================================================================
-vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-nix.txt b/sources_non_forked/ale/doc/ale-nix.txt
index c38b93db..1df7caff 100644
--- a/sources_non_forked/ale/doc/ale-nix.txt
+++ b/sources_non_forked/ale/doc/ale-nix.txt
@@ -7,24 +7,24 @@ nixfmt *ale-nix-nixfmt*
g:ale_nix_nixfmt_executable *g:ale_nix_nixfmt_executable*
*b:ale_nix_nixfmt_executable*
- Type: String
- Default: 'nixfmt'
+ Type: |String|
+ Default: `'nixfmt'`
This variable sets the executable used for nixfmt.
g:ale_nix_nixfmt_options *g:ale_nix_nixfmt_options*
*b:ale_nix_nixfmt_options*
- Type: String
- Default: ''
+ Type: |String|
+ Default: `''`
This variable can be set to pass additional options to the nixfmt fixer.
===============================================================================
-nixpkgs-fmt *ale-nix-nixpkgs-fmt*
+nixpkgs-fmt *ale-nix-nixpkgs-fmt*
-g:ale_nix_nixpkgsfmt_executable *g:ale_nix_nixpkgsfmt_executable*
- *b:ale_nix_nixpkgsfmt_executable*
+g:ale_nix_nixpkgsfmt_executable *g:ale_nix_nixpkgsfmt_executable*
+ *b:ale_nix_nixpkgsfmt_executable*
Type: |String|
Default: `'nixpkgs-fmt'`
@@ -35,7 +35,44 @@ g:ale_nix_nixpkgsfmt_options *g:ale_nix_nixpkgsfmt_options*
Type: |String|
Default: `''`
- This variable can be set to pass additional options to the nixpkgs-fmt fixer.
+ This variable can be set to pass additional options to the nixpkgs-fmt
+ fixer.
+
+
+===============================================================================
+statix *ale-nix-statix*
+
+g:ale_nix_statix_check_executable *g:ale_nix_statix_check_executable*
+ *b:ale_nix_statix_check_executable*
+ Type: |String|
+ Default: `'statix'`
+
+ This variable sets the executable used for statix when running it as a
+ linter.
+
+g:ale_nix_statix_check_options *g:ale_nix_statix_check_options*
+ *b:ale_nix_statix_check_options*
+ Type: |String|
+ Default: `''`
+
+ This variable can be used to pass additional options to statix when running
+ it as a linter.
+
+g:ale_nix_statix_fix_executable *g:ale_nix_fix_check_executable*
+ *b:ale_nix_fix_check_executable*
+ Type: |String|
+ Default: `'statix'`
+
+ This variable sets the executable used for statix when running it as a
+ fixer.
+
+g:ale_nix_statix_fix_options *g:ale_nix_statix_fix_options*
+ *b:ale_nix_statix_fix_options*
+ Type: |String|
+ Default: `''`
+
+ This variable can be used to pass additional options to statix when running
+ it as a fixer.
===============================================================================
diff --git a/sources_non_forked/ale/doc/ale-packer.txt b/sources_non_forked/ale/doc/ale-packer.txt
new file mode 100644
index 00000000..11b7cc22
--- /dev/null
+++ b/sources_non_forked/ale/doc/ale-packer.txt
@@ -0,0 +1,24 @@
+===============================================================================
+ALE Packer Integration *ale-packer-options*
+
+
+===============================================================================
+packer-fmt-fixer *ale-packer-fmt-fixer*
+
+g:ale_packer_fmt_executable *g:ale_packer_fmt_executable*
+ *b:ale_packer_fmt_executable*
+
+ Type: |String|
+ Default: `'packer'`
+
+ This variable can be changed to use a different executable for packer.
+
+
+g:ale_packer_fmt_options *g:ale_packer_fmt_options*
+ *b:ale_packer_fmt_options*
+ Type: |String|
+ Default: `''`
+
+
+===============================================================================
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-php.txt b/sources_non_forked/ale/doc/ale-php.txt
index 4ee016fb..e4da97d3 100644
--- a/sources_non_forked/ale/doc/ale-php.txt
+++ b/sources_non_forked/ale/doc/ale-php.txt
@@ -1,6 +1,13 @@
===============================================================================
ALE PHP Integration *ale-php-options*
+
+===============================================================================
+cspell *ale-php-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
langserver *ale-php-langserver*
@@ -41,6 +48,7 @@ g:ale_php_phan_minimum_severity *g:ale_php_phan_minimum_severity*
This variable defines the minimum severity level.
+
g:ale_php_phan_executable *g:ale_php_phan_executable*
*b:ale_php_phan_executable*
Type: |String|
@@ -48,6 +56,7 @@ g:ale_php_phan_executable *g:ale_php_phan_executable*
This variable sets executable used for phan or phan_client.
+
g:ale_php_phan_use_client *g:ale_php_phan_use_client*
*b:ale_php_phan_use_client*
Type: |Number|
@@ -56,6 +65,7 @@ g:ale_php_phan_use_client *g:ale_php_phan_use_client*
This variable can be set to 1 to use the phan_client with phan daemon mode
instead of the phan standalone.
+
===============================================================================
phpcbf *ale-php-phpcbf*
@@ -129,6 +139,7 @@ g:ale_php_phpcs_options *g:ale_php_phpcs_options*
This variable can be set to pass additional options to php-cs
+
===============================================================================
phpmd *ale-php-phpmd*
@@ -187,6 +198,15 @@ g:ale_php_phpstan_autoload *g:ale_php_phpstan_autoload*
This variable sets path to phpstan autoload file.
+g:ale_php_phpstan_memory_limit *g:ale_php_phpstan_memory-limit*
+ *b:ale_php_phpstan_memory-limit*
+ Type: |String|
+ Default: `''`
+
+ This variable sets the memory limit for phpstan analysis. This is a string
+ in the same format as `php.ini` accepts, e.g. `128M`, `1G`.
+
+
===============================================================================
psalm *ale-php-psalm*
diff --git a/sources_non_forked/ale/doc/ale-powershell.txt b/sources_non_forked/ale/doc/ale-powershell.txt
index 485c9bd0..46bc6cfb 100644
--- a/sources_non_forked/ale/doc/ale-powershell.txt
+++ b/sources_non_forked/ale/doc/ale-powershell.txt
@@ -2,11 +2,17 @@
ALE PowerShell Integration *ale-powershell-options*
+===============================================================================
+cspell *ale-powershell-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
powershell *ale-powershell-powershell*
-g:ale_powershell_powershell_executable *g:ale_powershell_powershell_executable*
- *b:ale_powershell_powershell_executable*
+g:ale_powershell_powershell_executable *g:ale_powershell_powershell_executable*
+ *b:ale_powershell_powershell_executable*
Type: String
Default: `'pwsh'`
@@ -33,7 +39,7 @@ g:ale_powershell_psscriptanalyzer_executable
Default: `'pwsh'`
This variable sets executable used for powershell.
-
+
For example, on Windows you could set powershell to be Windows Powershell:
>
let g:ale_powershell_psscriptanalyzer_executable = 'powershell.exe'
@@ -49,7 +55,7 @@ g:ale_powershell_psscriptanalyzer_module
for psscriptanalyzer invocation.
-g:ale_powershell_psscriptanalyzer_exclusions
+g:ale_powershell_psscriptanalyzer_exclusions
*g:ale_powershell_psscriptanalyzer_exclusions*
*b:ale_powershell_psscriptanalyzer_exclusions*
Type: |String|
@@ -65,6 +71,5 @@ g:ale_powershell_psscriptanalyzer_exclusions
\ 'PSAvoidUsingWriteHost,PSAvoidGlobalVars'
<
-
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-proto.txt b/sources_non_forked/ale/doc/ale-proto.txt
index 8ab56a14..a1bf1303 100644
--- a/sources_non_forked/ale/doc/ale-proto.txt
+++ b/sources_non_forked/ale/doc/ale-proto.txt
@@ -8,13 +8,51 @@ Integration Information
To enable `.proto` file linting, update |g:ale_linters| as appropriate:
>
" Enable linter for .proto files
- let g:ale_linters = {'proto': ['protoc-gen-lint', 'protolint']}
+ let g:ale_linters = {'proto': ['buf-lint', 'protoc-gen-lint', 'protolint']}
To enable `.proto` file fixing, update |g:ale_fixers| as appropriate:
>
" Enable linter for .proto files
- let b:ale_fixers = {'proto': ['protolint']}
+ let b:ale_fixers = {'proto': ['buf-format', 'protolint']}
<
+===============================================================================
+buf-format *ale-proto-buf-format*
+
+ The formatter uses `buf`, a fully-featured Protobuf compiler that doesn't depend
+ on `protoc`. Make sure the `buf` binary is available in the system path, or
+ set ale_proto_buf_format_executable.
+
+g:ale_proto_buf_format_executable *g:ale_proto_buf_format_executable*
+
+ Type: |String|
+ Default: 'buf'
+
+ This variable can be changed to modify the executable used for buf.
+
+===============================================================================
+buf-lint *ale-proto-buf-lint*
+
+ The linter uses `buf`, a fully-featured Protobuf compiler that doesn't depend
+ on `protoc`. Make sure the `buf` binary is available in the system path, or
+ set ale_proto_buf_lint_executable.
+
+g:ale_proto_buf_lint_executable *g:ale_proto_buf_lint_executable*
+
+ Type: |String|
+ Default: 'buf'
+
+ This variable can be changed to modify the executable used for buf.
+
+g:ale_proto_buf_lint_config *g:ale_proto_buf_lint_config*
+
+ Type: |String|
+ Default: `''`
+
+ A path to a buf configuration file.
+
+ The path to the configuration file can be an absolute path or a relative
+ path. ALE will search for the relative path in parent directories.
+
===============================================================================
protoc-gen-lint *ale-proto-protoc-gen-lint*
diff --git a/sources_non_forked/ale/doc/ale-python.txt b/sources_non_forked/ale/doc/ale-python.txt
index 10cc2897..8c380e25 100644
--- a/sources_non_forked/ale/doc/ale-python.txt
+++ b/sources_non_forked/ale/doc/ale-python.txt
@@ -10,6 +10,7 @@ g:ale_python_auto_pipenv *g:ale_python_auto_pipenv*
Detect whether the file is inside a pipenv, and set the executable to `pipenv`
if true. This is overridden by a manually-set executable.
+
g:ale_python_auto_poetry *g:ale_python_auto_poetry*
*b:ale_python_auto_poetry*
Type: |Number|
@@ -18,6 +19,7 @@ g:ale_python_auto_poetry *g:ale_python_auto_poetry*
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
+
===============================================================================
ALE Python Project Root Behavior *ale-python-root*
@@ -37,6 +39,7 @@ ALE will look for configuration files with the following filenames. >
tox.ini
.pyre_configuration.local
mypy.ini
+ .mypy.ini
pycodestyle.cfg
.flake8
.flake8rc
@@ -229,6 +232,7 @@ g:ale_python_black_auto_pipenv *g:ale_python_black_auto_pipenv*
Detect whether the file is inside a pipenv, and set the executable to `pipenv`
if true. This is overridden by a manually-set executable.
+
g:ale_python_black_auto_poetry *g:ale_python_black_auto_poetry*
*b:ale_python_black_auto_poetry*
Type: |Number|
@@ -237,6 +241,7 @@ g:ale_python_black_auto_poetry *g:ale_python_black_auto_poetry*
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
+
g:ale_python_black_change_directory *g:ale_python_black_change_directory*
*b:ale_python_black_change_directory*
Type: |Number|
@@ -248,13 +253,19 @@ g:ale_python_black_change_directory *g:ale_python_black_change_directory*
to control the directory Python is executed from yourself.
+===============================================================================
+cspell *ale-python-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
flake8 *ale-python-flake8*
g:ale_python_flake8_change_directory *g:ale_python_flake8_change_directory*
*b:ale_python_flake8_change_directory*
Type: |String|
- Default: `project`
+ Default: `'project'`
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
@@ -320,6 +331,7 @@ g:ale_python_flake8_auto_poetry *g:ale_python_flake8_auto_poetry*
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
+
===============================================================================
flakehell *ale-python-flakehell*
@@ -384,6 +396,7 @@ g:ale_python_flakehell_auto_poetry *g:ale_python_flakehell_auto_poetry*
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
+
===============================================================================
isort *ale-python-isort*
@@ -504,7 +517,6 @@ g:ale_python_mypy_use_global *g:ale_python_mypy_use_global*
See |ale-integrations-local-executables|
-
===============================================================================
prospector *ale-python-prospector*
@@ -569,7 +581,6 @@ g:ale_python_prospector_auto_poetry *g:ale_python_prospector_auto_poetry*
===============================================================================
pycodestyle *ale-python-pycodestyle*
-
g:ale_python_pycodestyle_executable *g:ale_python_pycodestyle_executable*
*b:ale_python_pycodestyle_executable*
Type: |String|
@@ -619,7 +630,6 @@ g:ale_python_pycodestyle_auto_poetry *g:ale_python_pycodestyle_auto_poetry*
===============================================================================
pydocstyle *ale-python-pydocstyle*
-
g:ale_python_pydocstyle_executable *g:ale_python_pydocstyle_executable*
*b:ale_python_pydocstyle_executable*
Type: |String|
@@ -669,7 +679,6 @@ g:ale_python_pydocstyle_auto_poetry *g:ale_python_pydocstyle_auto_poetry*
===============================================================================
pyflakes *ale-python-pyflakes*
-
g:ale_python_pyflakes_executable *g:ale_python_pyflakes_executable*
*b:ale_python_pyflakes_executable*
Type: |String|
@@ -925,6 +934,7 @@ g:ale_python_pylsp_options *g:ale_python_pylsp_options
An example stragety for installing `pylsp`:
`python3 -m pip install --user pylsp`
+
===============================================================================
pyre *ale-python-pyre*
@@ -1057,6 +1067,58 @@ g:ale_python_reorder_python_imports_use_global
See |ale-integrations-local-executables|
+===============================================================================
+unimport *ale-python-unimport*
+
+`unimport` will be run from a detected project root, per |ale-python-root|.
+
+
+g:ale_python_unimport_auto_pipenv *g:ale_python_unimport_auto_pipenv*
+ *b:ale_python_unimport_auto_pipenv*
+ Type: |Number|
+ Default: `0`
+
+ Detect whether the file is inside a pipenv, and set the executable to `pipenv`
+ if true. This is overridden by a manually-set executable.
+
+
+g:ale_python_unimport_auto_poetry *g:ale_python_unimport_auto_poetry*
+ *b:ale_python_unimport_auto_poetry*
+ Type: |Number|
+ Default: `0`
+
+ Detect whether the file is inside a poetry, and set the executable to `poetry`
+ if true. This is overridden by a manually-set executable.
+
+
+g:ale_python_unimport_executable *g:ale_python_unimport_executable*
+ *b:ale_python_unimport_executable*
+ Type: |String|
+ Default: `'unimport'`
+
+ See |ale-integrations-local-executables|
+
+ Set this to `'pipenv'` to invoke `'pipenv` `run` `unimport'`.
+ Set this to `'poetry'` to invoke `'poetry` `run` `unimport'`.
+
+
+g:ale_python_unimport_options *g:ale_python_unimport_options*
+ *b:ale_python_unimport_options*
+ Type: |String|
+ Default: `''`
+
+ This variable can be changed to add command-line arguments to the unimport
+ invocation.
+
+
+g:ale_python_unimport_use_global *g:ale_python_unimport_use_global*
+ *b:ale_python_unimport_use_global*
+ Type: |Number|
+ Default: `get(g:, 'ale_use_global_executables', 0)`
+
+ See |ale-integrations-local-executables|
+
+
===============================================================================
vulture *ale-python-vulture*
diff --git a/sources_non_forked/ale/doc/ale-rego.txt b/sources_non_forked/ale/doc/ale-rego.txt
new file mode 100644
index 00000000..9a39dbf0
--- /dev/null
+++ b/sources_non_forked/ale/doc/ale-rego.txt
@@ -0,0 +1,50 @@
+===============================================================================
+ALE Rego Integration *ale-rego-options*
+
+
+===============================================================================
+cspell *ale-rego-cspell*
+
+See |ale-cspell-options|
+
+
+===============================================================================
+opacheck *ale-rego-opa-check*
+
+g:ale_rego_opacheck_executable *g:rego_opacheck_executable*
+ *b:rego_opacheck_executable*
+
+ Type: |String|
+ Default: `'opa'`
+
+ This variable can be changed to use a different executable for opa.
+
+
+g:rego_opacheck_options *g:rego_opacheck_options*
+ *b:rego_opacheck_options*
+ Type: |String|
+ Default: `''`
+
+ This variable can be changed to pass custom CLI flags to opa check.
+
+
+===============================================================================
+opafmt *ale-rego-opa-fmt-fixer*
+
+g:ale_opa_fmt_executable *g:ale_opa_fmt_executable*
+ *b:ale_opa_fmt_executable*
+
+ Type: |String|
+ Default: `'opa'`
+
+ This variable can be changed to use a different executable for opa.
+
+
+g:ale_opa_fmt_options *g:ale_opa_fmt_options*
+ *b:ale_opa_fmt_options*
+ Type: |String|
+ Default: `''`
+
+
+===============================================================================
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-restructuredtext.txt b/sources_non_forked/ale/doc/ale-restructuredtext.txt
index e308b072..7af62133 100644
--- a/sources_non_forked/ale/doc/ale-restructuredtext.txt
+++ b/sources_non_forked/ale/doc/ale-restructuredtext.txt
@@ -2,6 +2,12 @@
ALE reStructuredText Integration *ale-restructuredtext-options*
+===============================================================================
+cspell *ale-restructuredtext-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
textlint *ale-restructuredtext-textlint*
@@ -16,6 +22,7 @@ See: https://github.com/jimo1001/docutils-ast-writer
See |ale-text-textlint|
+
===============================================================================
write-good *ale-restructuredtext-write-good*
@@ -23,4 +30,4 @@ See |ale-write-good-options|
===============================================================================
-vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-ruby.txt b/sources_non_forked/ale/doc/ale-ruby.txt
index 69c643a9..4bc25b1a 100644
--- a/sources_non_forked/ale/doc/ale-ruby.txt
+++ b/sources_non_forked/ale/doc/ale-ruby.txt
@@ -21,6 +21,13 @@ g:ale_ruby_brakeman_options *g:ale_ruby_brakeman_options*
The contents of this variable will be passed through to brakeman.
+
+===============================================================================
+cspell *ale-ruby-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
debride *ale-ruby-debride*
@@ -212,7 +219,5 @@ g:ale_ruby_standardrb_options *g:ale_ruby_standardrb_options*
This variable can be changed to modify flags given to standardrb.
-===============================================================================
-
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-rust.txt b/sources_non_forked/ale/doc/ale-rust.txt
index 3aa63673..c8ec9b13 100644
--- a/sources_non_forked/ale/doc/ale-rust.txt
+++ b/sources_non_forked/ale/doc/ale-rust.txt
@@ -26,8 +26,10 @@ Integration Information
4. analyzer -- If you have rust-analyzer installed, you might prefer using
this linter over cargo and rls. rust-analyzer also implements the
Language Server Protocol for incremental compilation of Rust code, and is
- the next iteration of rls. rust-analyzer, like rls, requires Rust files
- to be contained in Cargo projects.
+ the next iteration of rls. rust-analyzer either requires Rust files to be
+ contained in Cargo projects or requires the project to be described in
+ the rust-project.json format:
+ https://rust-analyzer.github.io/manual.html#non-cargo-based-projects
5. rustfmt -- If you have `rustfmt` installed, you can use it as a fixer to
consistently reformat your Rust code.
@@ -38,7 +40,7 @@ Integration Information
let g:ale_linters = {'rust': ['rustc', 'rls']}
<
- Also note that rustc 1.12. or later is needed.
+ Also note that rustc 1.18. or later is needed.
===============================================================================
@@ -145,8 +147,7 @@ g:ale_rust_cargo_avoid_whole_workspace *g:ale_rust_cargo_avoid_whole_workspace*
in the crate's directory. Otherwise, behave as usual.
-g:ale_rust_cargo_use_clippy
- *g:ale_rust_cargo_use_clippy*
+g:ale_rust_cargo_use_clippy *g:ale_rust_cargo_use_clippy*
*b:ale_rust_cargo_use_clippy*
Type: |Number|
Default: `0`
@@ -163,8 +164,7 @@ g:ale_rust_cargo_use_clippy
let g:ale_rust_cargo_use_clippy = executable('cargo-clippy')
<
-g:ale_rust_cargo_clippy_options
- *g:ale_rust_cargo_clippy_options*
+g:ale_rust_cargo_clippy_options *g:ale_rust_cargo_clippy_options*
*b:ale_rust_cargo_clippy_options*
Type: |String|
@@ -175,8 +175,7 @@ g:ale_rust_cargo_clippy_options
only `cargo clippy` supports (e.g. `--deny`).
-g:ale_rust_cargo_target_dir
- *g:ale_rust_cargo_target_dir*
+g:ale_rust_cargo_target_dir *g:ale_rust_cargo_target_dir*
*b:ale_rust_cargo_target_dir*
Type: |String|
@@ -187,6 +186,12 @@ g:ale_rust_cargo_target_dir
running `cargo` commands manually while ALE is performing its checks.
+===============================================================================
+cspell *ale-rust-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
rls *ale-rust-rls*
@@ -234,13 +239,13 @@ rustc *ale-rust-rustc*
g:ale_rust_rustc_options *g:ale_rust_rustc_options*
*b:ale_rust_rustc_options*
Type: |String|
- Default: `'-Z no-codegen'`
+ Default: `'--emit=mir -o /dev/null'`
The variable can be used to change the options passed to `rustc`.
- `-Z no-codegen` should only work with nightly builds of Rust. Be careful when
- setting the options, as running `rustc` could execute code or generate
- binary files.
+ Users of nightly builds of Rust might want to use `-Z no-codegen` instead.
+ Be careful when setting the options, as running `rustc` could execute code
+ or generate binary files.
g:ale_rust_ignore_error_codes *g:ale_rust_ignore_error_codes*
diff --git a/sources_non_forked/ale/doc/ale-scala.txt b/sources_non_forked/ale/doc/ale-scala.txt
index c9638baf..0b0f1a9a 100644
--- a/sources_non_forked/ale/doc/ale-scala.txt
+++ b/sources_non_forked/ale/doc/ale-scala.txt
@@ -2,6 +2,12 @@
ALE Scala Integration *ale-scala-options*
+===============================================================================
+cspell *ale-scala-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
metals *ale-scala-metals*
diff --git a/sources_non_forked/ale/doc/ale-sh.txt b/sources_non_forked/ale/doc/ale-sh.txt
index c06f737a..9a1928c4 100644
--- a/sources_non_forked/ale/doc/ale-sh.txt
+++ b/sources_non_forked/ale/doc/ale-sh.txt
@@ -25,6 +25,12 @@ g:ale_sh_bashate_options *g:ale_sh_bashate_options*
let g:ale_sh_bashate_options = '-i E003'
<
+===============================================================================
+cspell *ale-sh-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
sh-language-server *ale-sh-language-server*
diff --git a/sources_non_forked/ale/doc/ale-sql.txt b/sources_non_forked/ale/doc/ale-sql.txt
index 398e24d3..80929264 100644
--- a/sources_non_forked/ale/doc/ale-sql.txt
+++ b/sources_non_forked/ale/doc/ale-sql.txt
@@ -2,6 +2,13 @@
ALE SQL Integration *ale-sql-options*
+===============================================================================
+dprint *ale-sql-dprint*
+
+See |ale-dprint-options|
+and https://github.com/dprint/dprint-plugin-sql/releases
+
+
===============================================================================
pgformatter *ale-sql-pgformatter*
diff --git a/sources_non_forked/ale/doc/ale-supported-languages-and-tools.txt b/sources_non_forked/ale/doc/ale-supported-languages-and-tools.txt
index 36ef83ea..218832bc 100644
--- a/sources_non_forked/ale/doc/ale-supported-languages-and-tools.txt
+++ b/sources_non_forked/ale/doc/ale-supported-languages-and-tools.txt
@@ -14,6 +14,7 @@ Notes:
* Ada
* `ada_language_server`
+ * `cspell`
* `gcc`
* `gnatpp`
* Ansible
@@ -24,7 +25,8 @@ Notes:
* `apkbuild-lint`
* `secfixes-check`
* AsciiDoc
- * `alex`!!
+ * `alex`
+ * `cspell`
* `languagetool`!!
* `proselint`
* `redpen`
@@ -33,10 +35,13 @@ Notes:
* `write-good`
* ASM
* `gcc`
+* AVRA
+ * `avra`
* Awk
* `gawk`
* Bash
* `bashate`
+ * `cspell`
* `language-server`
* `shell` (-n flag)
* `shellcheck`
@@ -47,6 +52,8 @@ Notes:
* `buildifier`
* BibTeX
* `bibclean`
+* BitBake
+ * `oelint-adv`
* Bourne Shell
* `shell` (-n flag)
* `shellcheck`
@@ -61,11 +68,13 @@ Notes:
* `cppcheck`
* `cpplint`!!
* `cquery`
+ * `cspell`
* `flawfinder`
* `gcc` (`cc`)
* `uncrustify`
* C#
* `csc`!!
+ * `cspell`
* `dotnet-format`
* `mcs`
* `mcsc`!!
@@ -82,6 +91,7 @@ Notes:
* `cppcheck`
* `cpplint`!!
* `cquery`
+ * `cspell`
* `flawfinder`
* `gcc` (`cc`)
* `uncrustify`
@@ -95,6 +105,7 @@ Notes:
* `cfn-python-lint`
* CMake
* `cmake-format`
+ * `cmake-lint`
* `cmakelint`
* CoffeeScript
* `coffee`
@@ -103,6 +114,8 @@ Notes:
* `ameba`!!
* `crystal`!!
* CSS
+ * `VSCode CSS language server`
+ * `cspell`
* `csslint`
* `fecs`
* `prettier`
@@ -127,7 +140,6 @@ Notes:
* `analysis_server`
* `dart-analyze`!!
* `dart-format`!!
- * `dartanalyzer`!!
* `dartfmt`!!
* `language_server`
* desktop
@@ -138,9 +150,11 @@ Notes:
* `dhall-lint`
* Dockerfile
* `dockerfile_lint`
+ * `dprint`
* `hadolint`
* Elixir
* `credo`
+ * `cspell`
* `dialyxir`
* `dogma`!!
* `elixir-ls`
@@ -178,10 +192,12 @@ Notes:
* `glslls`
* Go
* `bingo`
+ * `cspell`
* `go build`!!
* `go mod`!!
* `go vet`!!
* `gofmt`
+ * `gofumpt`
* `goimports`
* `golangci-lint`!!
* `golangserver`
@@ -208,6 +224,7 @@ Notes:
* Haskell
* `brittany`
* `cabal-ghc`
+ * `cspell`
* `floskell`
* `ghc`
* `ghc-mod`
@@ -222,10 +239,13 @@ Notes:
* `stack-ghc`
* `stylish-haskell`
* HCL
+ * `packer-fmt`
* `terraform-fmt`
* HTML
- * `alex`!!
+ * `VSCode HTML language server`
+ * `alex`
* `angular`
+ * `cspell`
* `fecs`
* `html-beautify`
* `htmlhint`
@@ -244,13 +264,16 @@ Notes:
* Java
* `PMD`
* `checkstyle`!!
+ * `cspell`
* `eclipselsp`
* `google-java-format`
* `javac`
* `javalsp`
* `uncrustify`
* JavaScript
+ * `cspell`
* `deno`
+ * `dprint`
* `eslint`
* `fecs`
* `flow`
@@ -263,6 +286,9 @@ Notes:
* `tsserver`
* `xo`
* JSON
+ * `VSCode JSON language server`
+ * `cspell`
+ * `dprint`
* `eslint`
* `fixjson`
* `jq`
@@ -283,8 +309,9 @@ Notes:
* `ktlint`
* `languageserver`
* LaTeX (tex)
- * `alex`!!
+ * `alex`
* `chktex`
+ * `cspell`
* `lacheck`
* `proselint`
* `redpen`
@@ -299,20 +326,23 @@ Notes:
* LLVM
* `llc`
* Lua
+ * `cspell`
* `lua-format`
* `luac`
* `luacheck`
* `luafmt`
+ * `selene`
* `stylua`
* Mail
- * `alex`!!
+ * `alex`
* `languagetool`!!
* `proselint`
* `vale`
* Make
* `checkmake`
* Markdown
- * `alex`!!
+ * `alex`
+ * `cspell`
* `languagetool`!!
* `markdownlint`!!
* `mdl`
@@ -339,8 +369,9 @@ Notes:
* `nixfmt`
* `nixpkgs-fmt`
* `rnix-lsp`
+ * `statix`
* nroff
- * `alex`!!
+ * `alex`
* `proselint`
* `write-good`
* Objective-C
@@ -362,6 +393,8 @@ Notes:
* `ibm_validator`
* `prettier`
* `yamllint`
+* Packer
+ * `packer-fmt-fixer`
* Pascal
* `ptop`
* Pawn
@@ -373,11 +406,13 @@ Notes:
* Perl6
* `perl6 -c`
* PHP
+ * `cspell`
* `intelephense`
* `langserver`
* `phan`
* `php -l`
* `php-cs-fixer`
+ * `phpactor`
* `phpcbf`
* `phpcs`
* `phpmd`
@@ -385,22 +420,25 @@ Notes:
* `psalm`!!
* `tlint`
* PO
- * `alex`!!
+ * `alex`
* `msgfmt`
* `proselint`
* `write-good`
* Pod
- * `alex`!!
+ * `alex`
* `proselint`
* `write-good`
* Pony
* `ponyc`
* PowerShell
+ * `cspell`
* `powershell`
* `psscriptanalyzer`
* Prolog
* `swipl`
* proto
+ * `buf-format`!!
+ * `buf-lint`!!
* `protoc-gen-lint`!!
* `protolint`!!
* Pug
@@ -419,6 +457,7 @@ Notes:
* `autopep8`
* `bandit`
* `black`
+ * `cspell`
* `flake8`
* `flakehell`
* `isort`
@@ -433,6 +472,7 @@ Notes:
* `pyre`
* `pyright`
* `reorder-python-imports`
+ * `unimport`
* `vulture`!!
* `yapf`
* QML
@@ -452,8 +492,13 @@ Notes:
* `ols`
* `reason-language-server`
* `refmt`
+* Rego
+ * `cspell`
+ * `opacheck`
+ * `opafmt`
* reStructuredText
- * `alex`!!
+ * `alex`
+ * `cspell`
* `proselint`
* `redpen`
* `rstcheck`
@@ -466,6 +511,7 @@ Notes:
* `rpmlint`
* Ruby
* `brakeman`!!
+ * `cspell`
* `debride`
* `prettier`
* `rails_best_practices`!!
@@ -478,6 +524,7 @@ Notes:
* `standardrb`
* Rust
* `cargo`!!
+ * `cspell`
* `rls`
* `rust-analyzer`
* `rustc` (see |ale-integration-rust|)
@@ -488,6 +535,7 @@ Notes:
* `sass-lint`
* `stylelint`
* Scala
+ * `cspell`
* `fsc`
* `metals`
* `sbtserver`
@@ -508,6 +556,7 @@ Notes:
* `solhint`
* `solium`
* SQL
+ * `dprint`
* `pgformatter`
* `sql-lint`
* `sqlfmt`
@@ -522,6 +571,7 @@ Notes:
* `svelteserver`
* Swift
* Apple `swift-format`
+ * `cspell`
* `sourcekit-lsp`
* `swiftformat`
* `swiftlint`
@@ -530,17 +580,20 @@ Notes:
* Tcl
* `nagelfar`!!
* Terraform
+ * `checkov`
* `terraform`
* `terraform-fmt-fixer`
* `terraform-ls`
* `terraform-lsp`
* `tflint`
* Texinfo
- * `alex`!!
+ * `alex`
+ * `cspell`
* `proselint`
* `write-good`
* Text^
- * `alex`!!
+ * `alex`
+ * `cspell`
* `languagetool`!!
* `proselint`
* `redpen`
@@ -550,8 +603,12 @@ Notes:
* Thrift
* `thrift`
* `thriftcheck`
+* TOML
+ * `dprint`
* TypeScript
+ * `cspell`
* `deno`
+ * `dprint`
* `eslint`
* `fecs`
* `prettier`
@@ -580,23 +637,30 @@ Notes:
* `vimls`
* `vint`
* Vim help^
- * `alex`!!
+ * `alex`
* `proselint`
* `write-good`
* Vue
+ * `cspell`
* `prettier`
* `vls`
+ * `volar`
+* WGSL
+ * `naga`
* XHTML
- * `alex`!!
+ * `alex`
+ * `cspell`
* `proselint`
* `write-good`
* XML
* `xmllint`
* YAML
+ * `actionlint`
* `circleci`!!
* `prettier`
* `spectral`
* `swaglint`
+ * `yaml-language-server`
* `yamlfix`
* `yamllint`
* YANG
@@ -604,6 +668,7 @@ Notes:
* Zeek
* `zeek`!!
* Zig
+ * `zigfmt`
* `zls`
===============================================================================
diff --git a/sources_non_forked/ale/doc/ale-swift.txt b/sources_non_forked/ale/doc/ale-swift.txt
index 6d53ca7c..a443eab8 100644
--- a/sources_non_forked/ale/doc/ale-swift.txt
+++ b/sources_non_forked/ale/doc/ale-swift.txt
@@ -19,7 +19,8 @@ Additionally, ALE tries to locate and use the nearest existing `.swift-format`
configuration file.
-g:ale_swift_appleswiftformat_executable *g:ale_swift_appleswiftformat_executable*
+g:ale_swift_appleswiftformat_executable
+ *g:ale_swift_appleswiftformat_executable*
*b:ale_swift_appleswiftformat_executable*
Type: |String|
Default: `'swift-format'`
@@ -28,7 +29,8 @@ g:ale_swift_appleswiftformat_executable *g:ale_swift_appleswiftformat_executable
`swift-format`.
-g:ale_swift_appleswiftformat_use_swiftpm *g:ale_swift_appleswiftformat_use_swiftpm*
+g:ale_swift_appleswiftformat_use_swiftpm
+ *g:ale_swift_appleswiftformat_use_swiftpm*
*b:ale_swift_appleswiftformat_use_swiftpm*
Type: |Number|
Default: `0`
@@ -40,6 +42,12 @@ g:ale_swift_appleswiftformat_use_swiftpm *g:ale_swift_appleswiftformat_use_swift
See |ale-integrations-local-executables|
+===============================================================================
+cspell *ale-swift-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
sourcekitlsp *ale-swift-sourcekitlsp*
@@ -57,4 +65,3 @@ g:ale_sourcekit_lsp_executable *g:ale_sourcekit_lsp_executable*
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
-
diff --git a/sources_non_forked/ale/doc/ale-terraform.txt b/sources_non_forked/ale/doc/ale-terraform.txt
index 175bdf5c..6acf63ac 100644
--- a/sources_non_forked/ale/doc/ale-terraform.txt
+++ b/sources_non_forked/ale/doc/ale-terraform.txt
@@ -2,6 +2,25 @@
ALE Terraform Integration *ale-terraform-options*
+===============================================================================
+checkov *ale-terraform-checkov*
+
+g:ale_terraform_checkov_executable *g:ale_terraform_checkov_executable*
+ *b:ale_terraform_checkov_executable*
+
+ Type: |String|
+ Default: `'checkov'`
+
+ This variable can be changed to use a different executable for checkov.
+
+
+g:ale_terraform_checkov_options *g:ale_terraform_checkov_options*
+ *b:ale_terraform_checkov_options*
+ Type: |String|
+ Default: `''`
+
+ This variable can be changed to set additional options for checkov.
+
===============================================================================
terraform-fmt-fixer *ale-terraform-fmt-fixer*
diff --git a/sources_non_forked/ale/doc/ale-tex.txt b/sources_non_forked/ale/doc/ale-tex.txt
index ceb9fa81..147aacc4 100644
--- a/sources_non_forked/ale/doc/ale-tex.txt
+++ b/sources_non_forked/ale/doc/ale-tex.txt
@@ -21,7 +21,13 @@ g:ale_tex_chktex_options *g:ale_tex_chktex_options*
This variable can be changed to modify flags given to chktex.
-------------------------------------------------------------------------------
+===============================================================================
+cspell *ale-tex-cspell*
+
+See |ale-cspell-options|
+
+
+===============================================================================
lacheck *ale-tex-lacheck*
g:ale_lacheck_executable *g:ale_lacheck_executable*
@@ -32,12 +38,11 @@ g:ale_lacheck_executable *g:ale_lacheck_executable*
This variable can be changed to change the path to lacheck.
-
===============================================================================
-latexindent *ale-tex-latexindent*
+latexindent *ale-tex-latexindent*
-g:ale_tex_latexindent_executable *g:ale_tex_latexindent_executable*
- *b:ale_tex_latexindent_executable*
+g:ale_tex_latexindent_executable *g:ale_tex_latexindent_executable*
+ *b:ale_tex_latexindent_executable*
Type: |String|
Default: `'latexindent'`
@@ -52,26 +57,39 @@ g:ale_tex_latexindent_options *g:ale_tex_latexindent_options*
This variable can be changed to modify flags given to latexindent.
-
===============================================================================
-texlab *ale-tex-texlab*
+texlab *ale-tex-texlab*
-g:ale_tex_texlab_executable *g:ale_tex_texlab_executable*
- *b:ale_tex_texlab_executable*
+g:ale_tex_texlab_executable *g:ale_tex_texlab_executable*
+ *b:ale_tex_texlab_executable*
Type: |String|
Default: `'texlab'`
This variable can be changed to change the path to texlab.
-g:ale_tex_texlab_options *g:ale_tex_texlab_options*
- *b:ale_tex_texlab_options*
+g:ale_tex_texlab_options *g:ale_tex_texlab_options*
+ *b:ale_tex_texlab_options*
Type: |String|
Default: `''`
- This variable can be changed to modify flags given to texlab.
+ This variable can be changed to modify flags given to texlab command.
+g:ale_tex_texlab_config *g:ale_tex_texlab_config*
+ *b:ale_tex_texlab_config*
+ Type: |Dictionary|
+ Default: `{}`
+ Dictionary containing LSP configuration settings used to initialize texlab
+ language server. Refer to texlab documentation for possible settings:
+
+ https://github.com/latex-lsp/texlab/blob/master/docs/options.md
+
+ For example to set build onSave initialization setting:
+
+>
+ let g:ale_tex_texlab_config = {"build":{"onSave":v:true}}
+<
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-texinfo.txt b/sources_non_forked/ale/doc/ale-texinfo.txt
index f8ed342d..53d42b69 100644
--- a/sources_non_forked/ale/doc/ale-texinfo.txt
+++ b/sources_non_forked/ale/doc/ale-texinfo.txt
@@ -2,6 +2,12 @@
ALE Texinfo Integration *ale-texinfo-options*
+===============================================================================
+cspell *ale-texinfo-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
write-good *ale-texinfo-write-good*
@@ -9,4 +15,4 @@ See |ale-write-good-options|
===============================================================================
-vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-text.txt b/sources_non_forked/ale/doc/ale-text.txt
index 913d7e61..4e4d0b2e 100644
--- a/sources_non_forked/ale/doc/ale-text.txt
+++ b/sources_non_forked/ale/doc/ale-text.txt
@@ -2,6 +2,12 @@
ALE Text Integration *ale-text-options*
+==============================================================================
+cspell *ale-text-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
textlint *ale-text-textlint*
@@ -39,4 +45,4 @@ See |ale-write-good-options|
===============================================================================
-vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-toml.txt b/sources_non_forked/ale/doc/ale-toml.txt
new file mode 100644
index 00000000..222a91f4
--- /dev/null
+++ b/sources_non_forked/ale/doc/ale-toml.txt
@@ -0,0 +1,12 @@
+===============================================================================
+ALE TOML Integration *ale-toml-options*
+
+
+===============================================================================
+dprint *ale-toml-dprint*
+
+See |ale-dprint-options| and https://dprint.dev/plugins/toml
+
+
+===============================================================================
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-typescript.txt b/sources_non_forked/ale/doc/ale-typescript.txt
index 8984e183..788a7a5c 100644
--- a/sources_non_forked/ale/doc/ale-typescript.txt
+++ b/sources_non_forked/ale/doc/ale-typescript.txt
@@ -2,6 +2,12 @@
ALE TypeScript Integration *ale-typescript-options*
+===============================================================================
+cspell *ale-typescript-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
deno *ale-typescript-deno*
@@ -27,6 +33,7 @@ g:ale_deno_lsp_project_root *g:ale_deno_lsp_project_root*
3. Use the directory of the current buffer (if the buffer was opened from
a file).
+
g:ale_deno_unstable *g:ale_deno_unstable*
*b:ale_deno_unstable*
Type: |Number|
@@ -34,13 +41,21 @@ g:ale_deno_unstable *g:ale_deno_unstable*
Enable or disable unstable Deno features and APIs.
-g:ale_deno_importMap *g:ale_deno_importMap*
- *b:ale_deno_importMap*
+
+g:ale_deno_importMap *g:ale_deno_importMap*
+ *b:ale_deno_importMap*
Type: |String|
Default: `'import_map.json'`
Specify the import map filename to load url maps in a deno project.
+
+===============================================================================
+dprint *ale-typescript-dprint*
+
+See |ale-dprint-options| and https://dprint.dev/plugins/typescript
+
+
===============================================================================
eslint *ale-typescript-eslint*
diff --git a/sources_non_forked/ale/doc/ale-vue.txt b/sources_non_forked/ale/doc/ale-vue.txt
index a2c2786f..98ac5808 100644
--- a/sources_non_forked/ale/doc/ale-vue.txt
+++ b/sources_non_forked/ale/doc/ale-vue.txt
@@ -2,6 +2,12 @@
ALE Vue Integration *ale-vue-options*
+===============================================================================
+cspell *ale-vue-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
prettier *ale-vue-prettier*
@@ -27,5 +33,36 @@ g:ale_vue_vls_use_global *g:ale_vue_vls_use_global*
See |ale-integrations-local-executables|
+===============================================================================
+volar *ale-vue-volar*
+
+ It is required to have typescript installed in your project as your dev
+ dependency: `npm i -D typescript`
+
+g:ale_vue_volar_executable *g:ale_vue_volar_executable*
+ *b:ale_vue_volar_executable*
+ Type: |String|
+ Default: `'volar-server'`
+
+ See |ale-integrations-local-executables|
+
+
+g:ale_vue_volar_use_global *g:ale_vue_volar_use_global*
+ *b:ale_vue_volar_use_global*
+ Type: |Number|
+ Default: `get(g:, 'ale_use_global_executables', 0)`
+
+ See |ale-integrations-local-executables|
+
+
+g:vue_volar_init_options *g:ale_vue_volar_init_options*
+ *b:ale_vue_volar_init_options*
+ Type: |Dictionary|
+ Default: `{ ... }`
+
+ Default is too long to show here, take a look at it over
+ `ale_linters/vue/volar.vim`
+
+
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-wgsl.txt b/sources_non_forked/ale/doc/ale-wgsl.txt
new file mode 100644
index 00000000..5254f43b
--- /dev/null
+++ b/sources_non_forked/ale/doc/ale-wgsl.txt
@@ -0,0 +1,17 @@
+===============================================================================
+ALE WGSL Integration *ale-wgsl-options*
+
+
+===============================================================================
+naga *ale-wgsl-naga*
+
+g:ale_wgsl_naga_executable *g:ale_wgsl_naga_executable*
+ *b:ale_wgsl_naga_executable*
+ Type: |String|
+ Default: `'naga'`
+
+ The executable that will be run for the `naga` linter.
+
+
+===============================================================================
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-xhtml.txt b/sources_non_forked/ale/doc/ale-xhtml.txt
index 3cc639ef..10ca5b82 100644
--- a/sources_non_forked/ale/doc/ale-xhtml.txt
+++ b/sources_non_forked/ale/doc/ale-xhtml.txt
@@ -2,6 +2,12 @@
ALE XHTML Integration *ale-xhtml-options*
+===============================================================================
+cspell *ale-xhtml-cspell*
+
+See |ale-cspell-options|
+
+
===============================================================================
write-good *ale-xhtml-write-good*
@@ -9,4 +15,4 @@ See |ale-write-good-options|
===============================================================================
-vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/sources_non_forked/ale/doc/ale-yaml.txt b/sources_non_forked/ale/doc/ale-yaml.txt
index 65e0d069..8d44973d 100644
--- a/sources_non_forked/ale/doc/ale-yaml.txt
+++ b/sources_non_forked/ale/doc/ale-yaml.txt
@@ -2,6 +2,37 @@
ALE YAML Integration *ale-yaml-options*
+===============================================================================
+actionlint *ale-yaml-actionlint*
+
+Website: https://github.com/rhysd/actionlint
+
+
+Installation
+-------------------------------------------------------------------------------
+
+See installation guide: https://github.com/rhysd/actionlint#quick-start
+
+This linter is disabled by default and must be enabled by setting `g:ale_linters`.
+To enable it only for Github Action YAML files a configuration like this is
+better:
+
+>
+ au BufRead,BufNewFile */.github/*/*.y{,a}ml
+ \ let b:ale_linters = {'yaml': ['actionlint']}
+<
+
+Options
+-------------------------------------------------------------------------------
+
+g:ale_yaml_actionlint_executable *g:ale_yaml_actionlint_executable*
+ *b:ale_yaml_actionlint_executable*
+ Type: |String|
+ Default: `'actionlint'`
+
+ This variable can be set to change the path to actionlint.
+
+
===============================================================================
circleci *ale-yaml-circleci*
@@ -105,6 +136,59 @@ g:ale_yaml_swaglint_use_global *g:ale_yaml_swaglint_use_global*
See |ale-integrations-local-executables|
+===============================================================================
+yaml-language-server *ale-yaml-language-server*
+
+Website: https://github.com/redhat-developer/yaml-language-server
+
+
+Installation
+-------------------------------------------------------------------------------
+
+Install yaml-language-server either globally or locally: >
+
+ npm install yaml-language-server -g # global
+ npm install yaml-language-server # local
+
+
+Options
+-------------------------------------------------------------------------------
+
+g:ale_yaml_ls_executable *g:ale_yaml_ls_executable*
+ *b:ale_yaml_ls_executable*
+ Type: |String|
+ Default: `'yaml-language-server'`
+
+ This variable can be set to change the path to yaml-language-server.
+
+
+g:ale_yaml_ls_config *g:ale_yaml_ls_config*
+ *b:ale_yaml_ls_config*
+ Type: |Dictionary|
+ Default: `{}`
+
+ Dictionary containing configuration settings that will be passed to the
+ language server. For example, to enable schema store: >
+ {
+ \ 'yaml': {
+ \ 'schemaStore': {
+ \ 'enable': v:true,
+ \ },
+ \ },
+ \ }
+<
+ Consult the yaml-language-server documentation for more information about
+ settings.
+
+
+g:ale_yaml_ls_use_global *g:ale_yaml_ls_use_global*
+ *b:ale_yaml_ls_use_global*
+ Type: |String|
+ Default: `get(g:, 'ale_use_global_executables', 0)`
+
+ See |ale-integrations-local-executables|
+
+
===============================================================================
yamlfix *ale-yaml-yamlfix*
diff --git a/sources_non_forked/ale/doc/ale-zig.txt b/sources_non_forked/ale/doc/ale-zig.txt
index 70a53bbb..cafa12a1 100644
--- a/sources_non_forked/ale/doc/ale-zig.txt
+++ b/sources_non_forked/ale/doc/ale-zig.txt
@@ -7,6 +7,18 @@ Integration Information
Currently, the only supported linter for zig is zls.
+
+===============================================================================
+zigfmt *ale-zig-zigfmt*
+
+g:ale_zig_zigfmt_executable *g:ale_zig_zigfmt_executable*
+ *b:ale_zig_zigfmt_executable*
+ Type: |String|
+ Default: `'zig'`
+
+ The executable that will be run for the `zig fmt` fixer.
+
+
===============================================================================
zls *ale-zig-zls*
diff --git a/sources_non_forked/ale/doc/ale.txt b/sources_non_forked/ale/doc/ale.txt
index 6cc81784..c969cb9e 100644
--- a/sources_non_forked/ale/doc/ale.txt
+++ b/sources_non_forked/ale/doc/ale.txt
@@ -17,17 +17,19 @@ CONTENTS *ale-contents*
5.1 Completion........................|ale-completion|
5.2 Go To Definition..................|ale-go-to-definition|
5.3 Go To Type Definition.............|ale-go-to-type-definition|
- 5.4 Find References...................|ale-find-references|
- 5.5 Hovering..........................|ale-hover|
- 5.6 Symbol Search.....................|ale-symbol-search|
- 5.7 Refactoring: Rename, Actions......|ale-refactor|
+ 5.4 Go To Implementation..............|ale-go-to-type-implementation|
+ 5.5 Find References...................|ale-find-references|
+ 5.6 Hovering..........................|ale-hover|
+ 5.7 Symbol Search.....................|ale-symbol-search|
+ 5.8 Refactoring: Rename, Actions......|ale-refactor|
6. Global Options.......................|ale-options|
6.1 Highlights........................|ale-highlights|
7. Linter/Fixer Options.................|ale-integration-options|
7.1 Options for alex..................|ale-alex-options|
- 7.2 Options for languagetool..........|ale-languagetool-options|
- 7.3 Options for write-good............|ale-write-good-options|
- 7.4 Other Linter/Fixer Options........|ale-other-integration-options|
+ 7.2 Options for cspell................|ale-cspell-options|
+ 7.3 Options for languagetool..........|ale-languagetool-options|
+ 7.4 Options for write-good............|ale-write-good-options|
+ 7.5 Other Linter/Fixer Options........|ale-other-integration-options|
8. Commands/Keybinds....................|ale-commands|
9. API..................................|ale-api|
10. Special Thanks......................|ale-special-thanks|
@@ -286,6 +288,12 @@ number of the buffer that ALE wants to check.
sources should perform their checks on a buffer in the background
asynchronously, so they don't interrupt editing.
+|ale#other_source#ShowResults()| must not be called synchronously before
+ALE's engine executes its code after the |ALEWantResults| event runs. If
+there are immediate results to provide to ALE, a 0 millisecond timer with
+|timer_start()| can be set instead up to call |ale#other_source#ShowResults()|
+after ALE has first executed its engine code for its own sources.
+
A plugin might integrate its own checks with ALE like so: >
augroup SomeGroupName
@@ -363,12 +371,16 @@ are supported for running the commands.
`process_with` An optional callback for post-processing.
- The callback must accept two arguments,
- `(buffer, output)`, which can be used for converting
- the output from a command into lines to replace the
- buffer's contents with.
+ The callback must accept arguments `(bufnr, output)`:
+ the buffer number undergoing fixing and the fixer's
+ output as a |List| of |String|s. It must return a |List|
+ of |String|s that will be the new contents of the
+ buffer.
+
+ This callback is useful to remove excess lines from the
+ command's output or apply additional changes to the
+ output.
- A |List| of |String|s must be returned.
`read_buffer` An optional key for disabling reading the buffer.
@@ -535,8 +547,10 @@ The |ALEComplete| command can be used to show completion suggestions manually,
even when |g:ale_completion_enabled| is set to `0`. For manually requesting
completion information with Deoplete, consult Deoplete's documentation.
-ALE by can support automatic imports from external modules. This behavior can
-be enabled by setting the |g:ale_completion_autoimport| variable to `1`.
+ALE supports automatic imports from external modules. This behavior can be
+disabled by setting the |g:ale_completion_autoimport| variable to `0`.
+Disabling automatic imports can drop some or all completion items from
+some LSP servers (e.g. eclipselsp).
You can manually request imports for symbols at the cursor with the
|ALEImport| command. The word at the cursor must be an exact match for some
@@ -624,14 +638,23 @@ documentation for the command for configuring how the location will be
displayed.
-------------------------------------------------------------------------------
-5.4 Find References *ale-find-references*
+5.4 Go To Implementation *ale-go-to-implementation*
+
+ALE supports jumping to the files and locations where symbols are implemented
+through any enabled LSP linters. The locations ALE will jump to depend on the
+information returned by LSP servers. The |ALEGoToImplementation| command will
+jump to the implementation of symbols under the cursor. See the documentation
+for the command for configuring how the location will be displayed.
+
+-------------------------------------------------------------------------------
+5.5 Find References *ale-find-references*
ALE supports finding references for symbols though any enabled LSP linters
with the |ALEFindReferences| command. See the documentation for the command
for a full list of options.
-------------------------------------------------------------------------------
-5.5 Hovering *ale-hover*
+5.6 Hovering *ale-hover*
ALE supports "hover" information for printing brief information about symbols
at the cursor taken from LSP linters. The following commands are supported:
@@ -673,18 +696,20 @@ Documentation for symbols at the cursor can be retrieved using the
|ALEDocumentation| command. This command is only available for `tsserver`.
-------------------------------------------------------------------------------
-5.6 Symbol Search *ale-symbol-search*
+5.7 Symbol Search *ale-symbol-search*
ALE supports searching for workspace symbols via LSP linters with the
|ALESymbolSearch| command. See the documentation for the command
for a full list of options.
-------------------------------------------------------------------------------
-5.7 Refactoring: Rename, Actions *ale-refactor*
+5.8 Refactoring: Rename, Actions *ale-refactor*
ALE supports renaming symbols in code such as variables or class names with
the |ALERename| command.
+`ALEFileRename` will rename file and fix import paths (tsserver only).
+
|ALECodeAction| will execute actions on the cursor or applied to a visual
range selection, such as automatically fixing errors.
@@ -849,11 +874,13 @@ g:ale_completion_tsserver_remove_warnings
g:ale_completion_autoimport *g:ale_completion_autoimport*
Type: Number
- Default: `0`
+ Default: `1`
- When this option is set to `0`, ALE will not try to automatically import
- completion results from external modules. It can be enabled by setting it
- to `1`.
+ When this option is set to `1`, ALE will try to automatically import
+ completion results from external modules. It can be disabled by setting it
+ to `0`. Some LSP servers include auto imports on every completion item so
+ disabling automatic imports may drop some or all completion items returnend
+ by it (e.g. eclipselsp).
g:ale_completion_excluded_words *g:ale_completion_excluded_words*
@@ -1439,9 +1466,9 @@ g:ale_linter_aliases *g:ale_linter_aliases*
\ 'ps1': 'powershell',
\ 'rmarkdown': 'r',
\ 'rmd': 'r',
- \ 'svelte': ['svelte', 'javascript'],
\ 'systemverilog': 'verilog',
\ 'typescriptreact': ['typescript', 'tsx'],
+ \ 'vader': ['vim', 'vader'],
\ 'verilog_systemverilog': ['verilog_systemverilog', 'verilog'],
\ 'vimwiki': 'markdown',
\ 'vue': ['vue', 'javascript'],
@@ -1585,16 +1612,21 @@ g:ale_linters *g:ale_linters*
\ 'hack': ['hack'],
\ 'help': [],
\ 'inko': ['inko'],
+ \ 'json': ['jsonlint', 'spectral'],
+ \ 'json': ['jsonlint', 'spectral', 'vscodejson'],
+ \ 'json5': [],
+ \ 'jsonc': [],
\ 'perl': ['perlcritic'],
\ 'perl6': [],
\ 'python': ['flake8', 'mypy', 'pylint', 'pyright'],
\ 'rust': ['cargo', 'rls'],
\ 'spec': [],
- \ 'svelte': ['eslint', 'svelteserver'],
\ 'text': [],
+ \ 'vader': ['vimls'],
\ 'vue': ['eslint', 'vls'],
\ 'zsh': ['shell'],
\ 'v': ['v'],
+ \ 'yaml': ['spectral', 'yaml-language-server', 'yamllint'],
\}
<
This option can be used to enable only a particular set of linters for a
@@ -1790,6 +1822,9 @@ g:ale_open_list *g:ale_open_list*
loclist (|lopen|) or for the quickfix list instead if |g:ale_set_quickfix|
is `1`. (|copen|)
+ When set to any higher numberical value, ALE will only open the window when
+ the number of warnings or errors are at least that many.
+
When set to `'on_save'`, ALE will only open the loclist after buffers have
been saved. The list will be opened some time after buffers are saved and
any linter for a buffer returns results.
@@ -1810,8 +1845,8 @@ g:ale_open_list *g:ale_open_list*
autocmd!
autocmd QuitPre * if empty(&buftype) | lclose | endif
augroup END
-<
+<
g:ale_pattern_options *g:ale_pattern_options*
Type: |Dictionary|
@@ -2008,7 +2043,7 @@ g:ale_set_quickfix *g:ale_set_quickfix*
This feature should not be used in combination with tools for searching for
matches and commands like |:cfdo|, as ALE will replace the quickfix list
pretty frequently. If you wish to use such tools, you should populate the
- loclist instead.
+ loclist or use |ALEPopulateQuickfix| instead.
g:ale_set_signs *g:ale_set_signs*
@@ -2071,6 +2106,7 @@ g:ale_sign_priority *g:ale_sign_priority*
g:ale_shell *g:ale_shell*
+ *b:ale_shell*
Type: |String|
Default: not set
@@ -2088,6 +2124,7 @@ g:ale_shell *g:ale_shell*
g:ale_shell_arguments *g:ale_shell_arguments*
+ *b:ale_shell_arguments*
Type: |String|
Default: not set
@@ -2564,7 +2601,80 @@ g:ale_alex_use_global *g:ale_alex_use_global*
-------------------------------------------------------------------------------
-7.2. Options for languagetool *ale-languagetool-options*
+7.2. Options for cspell *ale-cspell-options*
+
+The options for `cspell` are shared between all filetypes, so options can be
+configured only once.
+
+g:ale_cspell_executable *g:ale_cspell_executable*
+ *b:ale_cspell_executable*
+ Type: |String|
+ Default: `'cspell'`
+
+ See |ale-integrations-local-executables|
+
+
+g:ale_cspell_options *g:ale_cspell_options*
+ *b:ale_cspell_options*
+ Type: |String|
+ Default: `''`
+
+ This variable can be set to pass additional options to `cspell`.
+
+
+g:ale_cspell_use_global *g:ale_cspell_use_global*
+ *b:ale_cspell_use_global*
+ Type: |Number|
+ Default: `get(g: 'ale_use_global_executables', 0)`
+
+ See |ale-integrations-local-executables|
+
+
+-------------------------------------------------------------------------------
+7.3. Options for dprint *ale-dprint-options*
+
+`dprint` is a fixer for many file types, including: (java|type)script,
+json(c?), markdown, and more. See https://dprint.dev/plugins for an up-to-date
+list of supported plugins and their configuration options.
+
+g:ale_dprint_executable *g:ale_dprint_executable*
+ *b:ale_dprint_executable*
+ Type: |String|
+ Default: `'dprint'`
+
+ See |ale-integrations-local-executables|
+
+
+g:ale_dprint_config *g:ale_dprint_config*
+ *b:ale_dprint_config*
+ Type: |String|
+ Default: `'dprint.json'`
+
+ This variable can be changed to provide a config file to `dprint`. The
+ default is the nearest `dprint.json` searching upward from the current
+ buffer.
+
+ See https://dprint.dev/config and https://plugins.dprint.dev
+
+
+g:ale_dprint_options *g:ale_dprint_options*
+ *b:ale_dprint_options*
+ Type: |String|
+ Default: `''`
+
+ This variable can be set to pass additional options to `dprint`.
+
+
+g:ale_dprint_use_global *g:ale_dprint_use_global*
+ *b:ale_dprint_use_global*
+ Type: |Number|
+ Default: `get(g: 'ale_use_global_executables', 0)`
+
+ See |ale-integrations-local-executables|
+
+
+-------------------------------------------------------------------------------
+7.4. Options for languagetool *ale-languagetool-options*
g:ale_languagetool_executable *g:ale_languagetool_executable*
*b:ale_languagetool_executable*
@@ -2584,7 +2694,7 @@ g:ale_languagetool_options *g:ale_languagetool_options*
-------------------------------------------------------------------------------
-7.3. Options for write-good *ale-write-good-options*
+7.5. Options for write-good *ale-write-good-options*
The options for `write-good` are shared between all filetypes, so options can
be configured once.
@@ -2614,12 +2724,13 @@ g:ale_writegood_use_global *g:ale_writegood_use_global*
-------------------------------------------------------------------------------
-7.4. Other Linter/Fixer Options *ale-other-integration-options*
+7.6. Other Linter/Fixer Options *ale-other-integration-options*
ALE supports a very wide variety of tools. Other linter or fixer options are
documented in additional help files.
ada.....................................|ale-ada-options|
+ cspell................................|ale-ada-cspell|
gcc...................................|ale-ada-gcc|
gnatpp................................|ale-ada-gnatpp|
ada-language-server...................|ale-ada-language-server|
@@ -2629,10 +2740,13 @@ documented in additional help files.
apkbuild-lint.........................|ale-apkbuild-apkbuild-lint|
secfixes-check........................|ale-apkbuild-secfixes-check|
asciidoc................................|ale-asciidoc-options|
+ cspell................................|ale-asciidoc-cspell|
write-good............................|ale-asciidoc-write-good|
textlint..............................|ale-asciidoc-textlint|
asm.....................................|ale-asm-options|
gcc...................................|ale-asm-gcc|
+ avra....................................|ale-avra-options|
+ avra..................................|ale-avra-avra|
awk.....................................|ale-awk-options|
gawk..................................|ale-awk-gawk|
bats....................................|ale-bats-options|
@@ -2641,6 +2755,8 @@ documented in additional help files.
buildifier............................|ale-bazel-buildifier|
bib.....................................|ale-bib-options|
bibclean..............................|ale-bib-bibclean|
+ bitbake.................................|ale-bitbake-options|
+ oelint-adv............................|ale-bitbake-oelint_adv|
c.......................................|ale-c-options|
astyle................................|ale-c-astyle|
cc....................................|ale-c-cc|
@@ -2650,6 +2766,7 @@ documented in additional help files.
clangtidy.............................|ale-c-clangtidy|
cppcheck..............................|ale-c-cppcheck|
cquery................................|ale-c-cquery|
+ cspell................................|ale-c-cspell|
flawfinder............................|ale-c-flawfinder|
uncrustify............................|ale-c-uncrustify|
chef....................................|ale-chef-options|
@@ -2662,6 +2779,7 @@ documented in additional help files.
cfn-python-lint.......................|ale-cloudformation-cfn-python-lint|
cmake...................................|ale-cmake-options|
cmakelint.............................|ale-cmake-cmakelint|
+ cmake-lint............................|ale-cmake-cmake-lint|
cmake-format..........................|ale-cmake-cmakeformat|
cpp.....................................|ale-cpp-options|
astyle................................|ale-cpp-astyle|
@@ -2675,18 +2793,22 @@ documented in additional help files.
cppcheck..............................|ale-cpp-cppcheck|
cpplint...............................|ale-cpp-cpplint|
cquery................................|ale-cpp-cquery|
+ cspell................................|ale-cpp-cspell|
flawfinder............................|ale-cpp-flawfinder|
uncrustify............................|ale-cpp-uncrustify|
c#......................................|ale-cs-options|
csc...................................|ale-cs-csc|
+ cspell................................|ale-cs-cspell|
dotnet-format.........................|ale-cs-dotnet-format|
mcs...................................|ale-cs-mcs|
mcsc..................................|ale-cs-mcsc|
uncrustify............................|ale-cs-uncrustify|
css.....................................|ale-css-options|
+ cspell................................|ale-css-cspell|
fecs..................................|ale-css-fecs|
prettier..............................|ale-css-prettier|
stylelint.............................|ale-css-stylelint|
+ vscodecss.............................|ale-css-vscode|
cuda....................................|ale-cuda-options|
nvcc..................................|ale-cuda-nvcc|
clangd................................|ale-cuda-clangd|
@@ -2701,7 +2823,6 @@ documented in additional help files.
analysis_server.......................|ale-dart-analysis_server|
dart-analyze..........................|ale-dart-analyze|
dart-format...........................|ale-dart-format|
- dartanalyzer..........................|ale-dart-dartanalyzer|
dartfmt...............................|ale-dart-dartfmt|
desktop.................................|ale-desktop-options|
desktop-file-validate.................|ale-desktop-desktop-file-validate|
@@ -2711,6 +2832,7 @@ documented in additional help files.
dhall-lint............................|ale-dhall-lint|
dockerfile..............................|ale-dockerfile-options|
dockerfile_lint.......................|ale-dockerfile-dockerfile_lint|
+ dprint................................|ale-dockerfile-dprint|
hadolint..............................|ale-dockerfile-hadolint|
elixir..................................|ale-elixir-options|
mix...................................|ale-elixir-mix|
@@ -2718,6 +2840,7 @@ documented in additional help files.
dialyxir..............................|ale-elixir-dialyxir|
elixir-ls.............................|ale-elixir-elixir-ls|
credo.................................|ale-elixir-credo|
+ cspell................................|ale-elixir-cspell|
elm.....................................|ale-elm-options|
elm-format............................|ale-elm-elm-format|
elm-ls................................|ale-elm-elm-ls|
@@ -2746,8 +2869,10 @@ documented in additional help files.
glslls................................|ale-glsl-glslls|
go......................................|ale-go-options|
bingo.................................|ale-go-bingo|
+ cspell................................|ale-go-cspell|
gobuild...............................|ale-go-gobuild|
gofmt.................................|ale-go-gofmt|
+ gofumpt...............................|ale-go-gofumpt|
golangci-lint.........................|ale-go-golangci-lint|
golangserver..........................|ale-go-golangserver|
golines...............................|ale-go-golines|
@@ -2770,6 +2895,7 @@ documented in additional help files.
ember-template-lint...................|ale-handlebars-embertemplatelint|
haskell.................................|ale-haskell-options|
brittany..............................|ale-haskell-brittany|
+ cspell................................|ale-haskell-cspell|
floskell..............................|ale-haskell-floskell|
ghc...................................|ale-haskell-ghc|
ghc-mod...............................|ale-haskell-ghc-mod|
@@ -2785,15 +2911,20 @@ documented in additional help files.
hie...................................|ale-haskell-hie|
ormolu................................|ale-haskell-ormolu|
hcl.....................................|ale-hcl-options|
+ packer-fmt............................|ale-hcl-packer-fmt|
terraform-fmt.........................|ale-hcl-terraform-fmt|
+ help....................................|ale-help-options|
+ cspell................................|ale-help-cspell|
html....................................|ale-html-options|
angular...............................|ale-html-angular|
+ cspell................................|ale-html-cspell|
fecs..................................|ale-html-fecs|
html-beautify.........................|ale-html-beautify|
htmlhint..............................|ale-html-htmlhint|
prettier..............................|ale-html-prettier|
stylelint.............................|ale-html-stylelint|
tidy..................................|ale-html-tidy|
+ vscodehtml............................|ale-html-vscode|
write-good............................|ale-html-write-good|
idris...................................|ale-idris-options|
idris.................................|ale-idris-idris|
@@ -2805,6 +2936,7 @@ documented in additional help files.
ispc..................................|ale-ispc-ispc|
java....................................|ale-java-options|
checkstyle............................|ale-java-checkstyle|
+ cspell................................|ale-java-cspell|
javac.................................|ale-java-javac|
google-java-format....................|ale-java-google-java-format|
pmd...................................|ale-java-pmd|
@@ -2812,7 +2944,9 @@ documented in additional help files.
eclipselsp............................|ale-java-eclipselsp|
uncrustify............................|ale-java-uncrustify|
javascript..............................|ale-javascript-options|
+ cspell................................|ale-javascript-cspell|
deno..................................|ale-javascript-deno|
+ dprint................................|ale-javascript-dprint|
eslint................................|ale-javascript-eslint|
fecs..................................|ale-javascript-fecs|
flow..................................|ale-javascript-flow|
@@ -2825,12 +2959,15 @@ documented in additional help files.
standard..............................|ale-javascript-standard|
xo....................................|ale-javascript-xo|
json....................................|ale-json-options|
+ cspell................................|ale-json-cspell|
+ dprint................................|ale-json-dprint|
eslint................................|ale-json-eslint|
fixjson...............................|ale-json-fixjson|
jsonlint..............................|ale-json-jsonlint|
jq....................................|ale-json-jq|
prettier..............................|ale-json-prettier|
spectral..............................|ale-json-spectral|
+ vscodejson............................|ale-json-vscode|
jsonc...................................|ale-jsonc-options|
eslint................................|ale-jsonc-eslint|
jsonnet.................................|ale-jsonnet-options|
@@ -2845,6 +2982,7 @@ documented in additional help files.
ktlint................................|ale-kotlin-ktlint|
languageserver........................|ale-kotlin-languageserver|
latex...................................|ale-latex-options|
+ cspell................................|ale-latex-cspell|
write-good............................|ale-latex-write-good|
textlint..............................|ale-latex-textlint|
less....................................|ale-less-options|
@@ -2854,12 +2992,16 @@ documented in additional help files.
llvm....................................|ale-llvm-options|
llc...................................|ale-llvm-llc|
lua.....................................|ale-lua-options|
+ cspell................................|ale-lua-cspell|
lua-format............................|ale-lua-lua-format|
luac..................................|ale-lua-luac|
luacheck..............................|ale-lua-luacheck|
luafmt................................|ale-lua-luafmt|
+ selene................................|ale-lua-selene|
stylua................................|ale-lua-stylua|
markdown................................|ale-markdown-options|
+ cspell................................|ale-markdown-cspell|
+ dprint................................|ale-markdown-dprint|
markdownlint..........................|ale-markdown-markdownlint|
mdl...................................|ale-markdown-mdl|
pandoc................................|ale-markdown-pandoc|
@@ -2878,6 +3020,7 @@ documented in additional help files.
nix.....................................|ale-nix-options|
nixfmt................................|ale-nix-nixfmt|
nixpkgs-fmt...........................|ale-nix-nixpkgs-fmt|
+ statix................................|ale-nix-statix|
nroff...................................|ale-nroff-options|
write-good............................|ale-nroff-write-good|
objc....................................|ale-objc-options|
@@ -2899,6 +3042,8 @@ documented in additional help files.
ibm_validator.........................|ale-openapi-ibm-validator|
prettier..............................|ale-openapi-prettier|
yamllint..............................|ale-openapi-yamllint|
+ packer..................................|ale-packer-options|
+ packer-fmt-fixer......................|ale-packer-fmt-fixer|
pascal..................................|ale-pascal-options|
ptop..................................|ale-pascal-ptop|
pawn....................................|ale-pawn-options|
@@ -2910,6 +3055,7 @@ documented in additional help files.
perl6...................................|ale-perl6-options|
perl6.................................|ale-perl6-perl6|
php.....................................|ale-php-options|
+ cspell................................|ale-php-cspell|
langserver............................|ale-php-langserver|
phan..................................|ale-php-phan|
phpcbf................................|ale-php-phpcbf|
@@ -2927,12 +3073,15 @@ documented in additional help files.
write-good............................|ale-pod-write-good|
pony....................................|ale-pony-options|
ponyc.................................|ale-pony-ponyc|
- powershell............................|ale-powershell-options|
- powershell..........................|ale-powershell-powershell|
- psscriptanalyzer....................|ale-powershell-psscriptanalyzer|
+ powershell..............................|ale-powershell-options|
+ cspell................................|ale-powershell-cspell|
+ powershell............................|ale-powershell-powershell|
+ psscriptanalyzer......................|ale-powershell-psscriptanalyzer|
prolog..................................|ale-prolog-options|
swipl.................................|ale-prolog-swipl|
proto...................................|ale-proto-options|
+ buf-format............................|ale-proto-buf-format|
+ buf-lint..............................|ale-proto-buf-lint|
protoc-gen-lint.......................|ale-proto-protoc-gen-lint|
protolint.............................|ale-proto-protolint|
pug.....................................|ale-pug-options|
@@ -2953,6 +3102,7 @@ documented in additional help files.
autopep8..............................|ale-python-autopep8|
bandit................................|ale-python-bandit|
black.................................|ale-python-black|
+ cspell................................|ale-python-cspell|
flake8................................|ale-python-flake8|
flakehell.............................|ale-python-flakehell|
isort.................................|ale-python-isort|
@@ -2967,6 +3117,7 @@ documented in additional help files.
pyre..................................|ale-python-pyre|
pyright...............................|ale-python-pyright|
reorder-python-imports................|ale-python-reorder_python_imports|
+ unimport..............................|ale-python-unimport|
vulture...............................|ale-python-vulture|
yapf..................................|ale-python-yapf|
qml.....................................|ale-qml-options|
@@ -2980,13 +3131,19 @@ documented in additional help files.
ols...................................|ale-reasonml-ols|
reason-language-server................|ale-reasonml-language-server|
refmt.................................|ale-reasonml-refmt|
+ rego....................................|ale-rego-options|
+ cspell................................|ale-rego-cspell|
+ opacheck..............................|ale-rego-opa-check|
+ opafmt................................|ale-rego-opa-fmt-fixer|
restructuredtext........................|ale-restructuredtext-options|
+ cspell................................|ale-restructuredtext-cspell|
textlint..............................|ale-restructuredtext-textlint|
write-good............................|ale-restructuredtext-write-good|
robot...................................|ale-robot-options|
rflint................................|ale-robot-rflint|
ruby....................................|ale-ruby-options|
brakeman..............................|ale-ruby-brakeman|
+ cspell................................|ale-ruby-cspell|
debride...............................|ale-ruby-debride|
prettier..............................|ale-ruby-prettier|
rails_best_practices..................|ale-ruby-rails_best_practices|
@@ -3000,6 +3157,7 @@ documented in additional help files.
rust....................................|ale-rust-options|
analyzer..............................|ale-rust-analyzer|
cargo.................................|ale-rust-cargo|
+ cspell................................|ale-rust-cspell|
rls...................................|ale-rust-rls|
rustc.................................|ale-rust-rustc|
rustfmt...............................|ale-rust-rustfmt|
@@ -3009,6 +3167,7 @@ documented in additional help files.
sasslint..............................|ale-sass-sasslint|
stylelint.............................|ale-sass-stylelint|
scala...................................|ale-scala-options|
+ cspell................................|ale-scala-cspell|
metals................................|ale-scala-metals|
sbtserver.............................|ale-scala-sbtserver|
scalafmt..............................|ale-scala-scalafmt|
@@ -3019,6 +3178,7 @@ documented in additional help files.
stylelint.............................|ale-scss-stylelint|
sh......................................|ale-sh-options|
bashate...............................|ale-sh-bashate|
+ cspell................................|ale-sh-cspell|
sh-language-server....................|ale-sh-language-server|
shell.................................|ale-sh-shell|
shellcheck............................|ale-sh-shellcheck|
@@ -3032,6 +3192,7 @@ documented in additional help files.
spec....................................|ale-spec-options|
rpmlint...............................|ale-spec-rpmlint|
sql.....................................|ale-sql-options|
+ dprint................................|ale-sql-dprint|
pgformatter...........................|ale-sql-pgformatter|
sqlfmt................................|ale-sql-sqlfmt|
sqlformat.............................|ale-sql-sqlformat|
@@ -3044,12 +3205,14 @@ documented in additional help files.
svelteserver..........................|ale-svelte-svelteserver|
swift...................................|ale-swift-options|
apple-swift-format....................|ale-swift-apple-swift-format|
+ cspell................................|ale-swift-cspell|
sourcekitlsp..........................|ale-swift-sourcekitlsp|
systemd.................................|ale-systemd-options|
systemd-analyze.......................|ale-systemd-analyze|
tcl.....................................|ale-tcl-options|
nagelfar..............................|ale-tcl-nagelfar|
terraform...............................|ale-terraform-options|
+ checkov...............................|ale-terraform-checkov|
terraform-fmt-fixer...................|ale-terraform-fmt-fixer|
terraform.............................|ale-terraform-terraform|
terraform-ls..........................|ale-terraform-terraform-ls|
@@ -3057,19 +3220,26 @@ documented in additional help files.
tflint................................|ale-terraform-tflint|
tex.....................................|ale-tex-options|
chktex................................|ale-tex-chktex|
+ cspell................................|ale-tex-cspell|
lacheck...............................|ale-tex-lacheck|
latexindent...........................|ale-tex-latexindent|
texlab................................|ale-tex-texlab|
texinfo.................................|ale-texinfo-options|
+ cspell................................|ale-texinfo-cspell|
write-good............................|ale-texinfo-write-good|
text....................................|ale-text-options|
+ cspell................................|ale-text-cspell|
textlint..............................|ale-text-textlint|
write-good............................|ale-text-write-good|
thrift..................................|ale-thrift-options|
thrift................................|ale-thrift-thrift|
thriftcheck...........................|ale-thrift-thriftcheck|
+ toml....................................|ale-toml-options|
+ dprint................................|ale-toml-dprint|
typescript..............................|ale-typescript-options|
+ cspell................................|ale-typescript-cspell|
deno..................................|ale-typescript-deno|
+ dprint................................|ale-typescript-dprint|
eslint................................|ale-typescript-eslint|
prettier..............................|ale-typescript-prettier|
standard..............................|ale-typescript-standard|
@@ -3099,17 +3269,24 @@ documented in additional help files.
vimls.................................|ale-vim-vimls|
vint..................................|ale-vim-vint|
vue.....................................|ale-vue-options|
+ cspell................................|ale-vue-cspell|
prettier..............................|ale-vue-prettier|
vls...................................|ale-vue-vls|
+ volar.................................|ale-vue-volar|
+ wgsl....................................|ale-wgsl-options|
+ naga..................................|ale-wgsl-naga|
xhtml...................................|ale-xhtml-options|
+ cspell................................|ale-xhtml-cspell|
write-good............................|ale-xhtml-write-good|
xml.....................................|ale-xml-options|
xmllint...............................|ale-xml-xmllint|
yaml....................................|ale-yaml-options|
+ actionlint............................|ale-yaml-actionlint|
circleci..............................|ale-yaml-circleci|
prettier..............................|ale-yaml-prettier|
spectral..............................|ale-yaml-spectral|
swaglint..............................|ale-yaml-swaglint|
+ yaml-language-server..................|ale-yaml-language-server|
yamlfix...............................|ale-yaml-yamlfix|
yamllint..............................|ale-yaml-yamllint|
yang....................................|ale-yang-options|
@@ -3117,6 +3294,7 @@ documented in additional help files.
zeek....................................|ale-zeek-options|
zeek..................................|ale-zeek-zeek|
zig.....................................|ale-zig-options|
+ zigfmt................................|ale-zig-zigfmt|
zls...................................|ale-zig-zls|
@@ -3157,15 +3335,16 @@ ALEFindReferences *ALEFindReferences*
The locations opened in different ways using the following variations.
- `:ALEFindReferences -tab` - Open the location in a new tab.
- `:ALEFindReferences -split` - Open the location in a horizontal split.
- `:ALEFindReferences -vsplit` - Open the location in a vertical split.
+ `:ALEFindReferences -tab` - Open the location in a new tab.
+ `:ALEFindReferences -split` - Open the location in a horizontal split.
+ `:ALEFindReferences -vsplit` - Open the location in a vertical split.
+ `:ALEFindReferences -quickfix` - Put the locations into quickfix list.
The default method used for navigating to a new location can be changed
by modifying |g:ale_default_navigation|.
You can add `-relative` to the command to view results with relatives paths,
- instead of absolute paths.
+ instead of absolute paths. This option has no effect if `-quickfix` is used.
The selection can be opened again with the |ALERepeatSelection| command.
@@ -3256,6 +3435,33 @@ ALEGoToTypeDefinition *ALEGoToTypeDefinition*
`(ale_go_to_type_definition_in_vsplit)` - `:ALEGoToTypeDefinition -vsplit`
+ALEGoToImplementation *ALEGoToImplementation*
+
+ This works similar to |ALEGoToDefinition| but instead jumps to the
+ implementation of symbol under the cursor. ALE will jump to a definition if
+ an LSP server provides a location to jump to. Otherwise, ALE will do nothing.
+
+ The locations opened in different ways using the following variations.
+
+ `:ALEGoToImplementation -tab` - Open the location in a new tab.
+ `:ALEGoToImplementation -split` - Open the location in a horizontal split.
+ `:ALEGoToImplementation -vsplit` - Open the location in a vertical split.
+
+ The default method used for navigating to a new location can be changed
+ by modifying |g:ale_default_navigation|.
+
+ You can jump back to the position you were at before going to the definition
+ of something with jump motions like CTRL-O. See |jump-motions|.
+
+ The following Plug mappings are defined for this command, which correspond
+ to the following commands.
+
+ `(ale_go_to_implementation)` - `:ALEGoToImplementation`
+ `(ale_go_to_implementation_in_tab)` - `:ALEGoToImplementation -tab`
+ `(ale_go_to_implementation_in_split)` - `:ALEGoToImplementation -split`
+ `(ale_go_to_implementation_in_vsplit)` - `:ALEGoToImplementation -vsplit`
+
+
ALEHover *ALEHover*
Print brief information about the symbol under the cursor, taken from any
@@ -3298,6 +3504,13 @@ ALERename *ALERename*
The symbol where the cursor is resting will be the symbol renamed, and a
prompt will open to request a new name.
+ The rename operation will save all modified buffers when `set nohidden` is
+ set, because that disables leaving unsaved buffers in the background. See
+ `:help hidden` for more details.
+
+ALEFileRename *ALEFileRename*
+
+ Rename a file and fix imports using `tsserver`.
ALECodeAction *ALECodeAction*
@@ -3345,6 +3558,20 @@ ALELintStop *ALELintStop*
Any problems from previous linter results will continue to be shown.
+ALEPopulateQuickfix *ALEPopulateQuickfix*
+ALEPopulateLocList *ALEPopulateLocList*
+
+ Manually populate the |quickfix| or |location-list| and show the
+ corresponding list. Useful when you have other uses for both the |quickfix|
+ and |location-list| and don't want them automatically populated. Be sure to
+ disable auto populating: >
+
+ let g:ale_set_quickfix = 0
+ let g:ale_set_loclist = 0
+<
+ With these settings, ALE will still run checking and display it with signs,
+ highlighting, and other output described in |ale-lint-file-linters|.
+
ALEPrevious *ALEPrevious*
ALEPreviousWrap *ALEPreviousWrap*
ALENext *ALENext*
diff --git a/sources_non_forked/ale/plugin/ale.vim b/sources_non_forked/ale/plugin/ale.vim
index d19824b1..8d829ddf 100644
--- a/sources_non_forked/ale/plugin/ale.vim
+++ b/sources_non_forked/ale/plugin/ale.vim
@@ -24,8 +24,10 @@ endif
if !s:has_features
" Only output a warning if editing some special files.
if index(['', 'gitcommit'], &filetype) == -1
- execute 'echoerr ''ALE requires NeoVim >= 0.2.0 or Vim 8 with +timers +job +channel'''
- execute 'echoerr ''Please update your editor appropriately.'''
+ " no-custom-checks
+ echoerr 'ALE requires NeoVim >= 0.2.0 or Vim 8 with +timers +job +channel'
+ " no-custom-checks
+ echoerr 'Please update your editor appropriately.'
endif
" Stop here, as it won't work.
@@ -228,6 +230,10 @@ command! -bar ALELint :call ale#Queue(0, 'lint_file')
" Stop current jobs when linting.
command! -bar ALELintStop :call ale#engine#Stop(bufnr(''))
+" Commands to manually populate the quickfixes.
+command! -bar ALEPopulateQuickfix :call ale#list#ForcePopulateErrorList(1)
+command! -bar ALEPopulateLocList :call ale#list#ForcePopulateErrorList(0)
+
" Define a command to get information about current filetype.
command! -bar ALEInfo :call ale#debugging#Info()
" The same, but copy output to your clipboard.
@@ -246,6 +252,9 @@ command! -bar -nargs=* ALEGoToDefinition :call ale#definition#GoToCommandHandler
" Go to type definition for tsserver and LSP
command! -bar -nargs=* ALEGoToTypeDefinition :call ale#definition#GoToCommandHandler('type', )
+" Go to implementation for tsserver and LSP
+command! -bar -nargs=* ALEGoToImplementation :call ale#definition#GoToCommandHandler('implementation', )
+
" Repeat a previous selection in the preview window
command! -bar ALERepeatSelection :call ale#preview#RepeatSelection()
@@ -270,6 +279,9 @@ command! -bar ALEImport :call ale#completion#Import()
" Rename symbols using tsserver and LSP
command! -bar -bang ALERename :call ale#rename#Execute()
+" Rename file using tsserver
+command! -bar -bang ALEFileRename :call ale#filerename#Execute()
+
" Apply code actions to a range.
command! -bar -range ALECodeAction :call ale#codefix#Execute()
@@ -310,12 +322,16 @@ nnoremap (ale_go_to_type_definition) :ALEGoToTypeDefinition (ale_go_to_type_definition_in_tab) :ALEGoToTypeDefinition -tab
nnoremap (ale_go_to_type_definition_in_split) :ALEGoToTypeDefinition -split
nnoremap (ale_go_to_type_definition_in_vsplit) :ALEGoToTypeDefinitionIn -vsplit
+nnoremap (ale_go_to_implementation_in_tab) :ALEGoToImplementation -tab
+nnoremap (ale_go_to_implementation_in_split) :ALEGoToImplementation -split
+nnoremap (ale_go_to_implementation_in_vsplit) :ALEGoToImplementation -vsplit
nnoremap (ale_find_references) :ALEFindReferences
nnoremap (ale_hover) :ALEHover
nnoremap (ale_documentation) :ALEDocumentation
inoremap (ale_complete) :ALEComplete
nnoremap (ale_import) :ALEImport
nnoremap (ale_rename) :ALERename
+nnoremap (ale_filerename) :ALEFileRename
nnoremap (ale_code_action) :ALECodeAction
nnoremap (ale_repeat_selection) :ALERepeatSelection
diff --git a/sources_non_forked/ale/run-tests b/sources_non_forked/ale/run-tests
new file mode 100755
index 00000000..93e94dec
--- /dev/null
+++ b/sources_non_forked/ale/run-tests
@@ -0,0 +1,270 @@
+#!/usr/bin/env bash
+
+# Author: w0rp
+#
+# This script runs tests for the ALE project. Run `./run-tests --help` for
+# options, or read the output below.
+#
+
+image=denseanalysis/ale
+
+# Create docker image tag based on Dockerfile contents
+if [ -n "$(command -v md5)" ]; then
+ image_tag=$(md5 -q Dockerfile)
+else
+ image_tag=$(md5sum Dockerfile | cut -d' ' -f1)
+fi
+git_version=$(git describe --always --tags)
+
+# Used in all test scripts for running the selected Docker image.
+DOCKER_RUN_IMAGE="$image:$image_tag"
+export DOCKER_RUN_IMAGE
+
+tests='test/*.vader test/*/*.vader test/*/*/*.vader test/*/*/*.vader'
+# These flags are forwarded to the script for running Vader tests.
+verbose_flag=''
+quiet_flag=''
+run_neovim_02_tests=1
+run_neovim_06_tests=1
+run_vim_80_tests=1
+run_vim_82_tests=1
+run_linters=1
+
+while [ $# -ne 0 ]; do
+ case $1 in
+ -v)
+ verbose_flag='-v'
+ shift
+ ;;
+ -q)
+ quiet_flag='-q'
+ shift
+ ;;
+ --build-image)
+ run_vim_80_tests=0
+ run_vim_82_tests=0
+ run_neovim_02_tests=0
+ run_neovim_06_tests=0
+ run_linters=0
+ shift
+ ;;
+ --neovim-only)
+ run_vim_80_tests=0
+ run_vim_82_tests=0
+ run_linters=0
+ shift
+ ;;
+ --neovim-02-only)
+ run_neovim_06_tests=0
+ run_vim_80_tests=0
+ run_vim_82_tests=0
+ run_linters=0
+ shift
+ ;;
+ --neovim-06-only)
+ run_neovim_02_tests=0
+ run_vim_80_tests=0
+ run_vim_82_tests=0
+ run_linters=0
+ shift
+ ;;
+ --vim-only)
+ run_neovim_02_tests=0
+ run_neovim_06_tests=0
+ run_linters=0
+ shift
+ ;;
+ --vim-80-only)
+ run_neovim_02_tests=0
+ run_neovim_06_tests=0
+ run_vim_82_tests=0
+ run_linters=0
+ shift
+ ;;
+ --vim-82-only)
+ run_neovim_02_tests=0
+ run_neovim_06_tests=0
+ run_vim_80_tests=0
+ run_linters=0
+ shift
+ ;;
+ --linters-only)
+ run_vim_80_tests=0
+ run_vim_82_tests=0
+ run_neovim_02_tests=0
+ run_neovim_06_tests=0
+ shift
+ ;;
+ --fast)
+ run_vim_80_tests=0
+ run_vim_82_tests=0
+ run_neovim_02_tests=0
+ run_neovim_06_tests=1
+ shift
+ ;;
+ --help)
+ echo 'Usage: ./run-tests [OPTION]... [FILE]...'
+ echo
+ echo 'Filenames can be given as arguments to run a subset of tests.'
+ echo 'For example: ./run-tests test/test_ale_var.vader'
+ echo
+ echo 'Options:'
+ echo ' -v Enable verbose output'
+ echo ' -q Hide output for successful tests'
+ echo ' --build-image Run docker image build only.'
+ echo ' --neovim-only Run tests only for NeoVim'
+ echo ' --neovim-02-only Run tests only for NeoVim 0.2'
+ echo ' --neovim-06-only Run tests only for NeoVim 0.6'
+ echo ' --vim-only Run tests only for Vim'
+ echo ' --vim-80-only Run tests only for Vim 8.0'
+ echo ' --vim-82-only Run tests only for Vim 8.2'
+ echo ' --linters-only Run only Vint and custom checks'
+ echo ' --fast Run only the fastest Vim and custom checks'
+ echo ' --help Show this help text'
+ echo ' -- Stop parsing options after this'
+ exit 0
+ ;;
+ --)
+ shift
+ break
+ ;;
+ -?*)
+ echo "Invalid argument: $1" 1>&2
+ exit 1
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
+
+# Allow tests to be passed as arguments.
+if [ $# -ne 0 ]; then
+ # This doesn't perfectly handle work splitting, but none of our files
+ # have spaces in the names.
+ tests="$*"
+
+ # Don't run other tools when targeting tests.
+ run_linters=0
+fi
+
+# Delete .swp files in the test directory, which cause Vim 8 to hang.
+find test -name '*.swp' -delete
+
+# Check if docker un image is available locally
+has_image=$(docker images --quiet "${image}:${image_tag}" | wc -l)
+
+if [ "$has_image" -eq 0 ]
+then
+
+ echo "Downloading run image ${image}:${image_tag}"
+ docker pull "${image}:${image_tag}" &> /dev/null
+
+ if [ $? -eq 1 ]
+ then
+ echo "Could not pull image ${image}:${image_tag}"
+ echo "Building run image ${image}:${image_tag}"
+ docker build --build-arg GIT_VERSION="$git_version" -t "${image}:${image_tag}" .
+ docker tag "${image}:${image_tag}" "${image}:latest"
+
+ if [[ -z "${DOCKER_HUB_USER:-}" || -z "${DOCKER_HUB_PASS:-}" ]]
+ then
+ echo "Docker Hub credentials not set, skip push"
+ else
+ echo "Push ${image}:${image_tag} to Docker Hub"
+ echo "$DOCKER_HUB_PASS" | docker login -u "$DOCKER_HUB_USER" --password-stdin
+ docker push "${image}:${image_tag}"
+ fi
+ fi
+else
+ echo "Docker run image ${image}:${image_tag} ready"
+fi
+
+set -e
+set -u
+
+docker tag "${image}:${image_tag}" "${image}:latest"
+
+output_dir=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
+
+trap '{ rm -rf "$output_dir"; }' EXIT
+
+file_number=0
+pid_list=''
+
+# Used for killing tests when you kill the script.
+cancel_tests() {
+ set +e
+
+ if [ -n "$pid_list" ]; then
+ for pid in $pid_list; do
+ kill "$pid"
+ wait "$pid"
+ done
+ fi
+
+ # shellcheck disable=SC2046
+ docker kill $(docker ps -a -q --filter ancestor="$image" --format='{{.ID}}') &> /dev/null
+
+ if [ -d "$output_dir" ]; then
+ rm -rf "$output_dir"
+ fi
+
+ echo
+ exit 1
+}
+
+trap cancel_tests INT TERM
+
+for vim in $(docker run --rm "$DOCKER_RUN_IMAGE" ls /vim-build/bin | grep '^neovim\|^vim' ); do
+ if ( [[ $vim =~ ^vim-v8.0 ]] && ((run_vim_80_tests)) ) \
+ || ( [[ $vim =~ ^vim-v8.2 ]] && ((run_vim_82_tests)) ) \
+ || ( [[ $vim =~ ^neovim-v0.2 ]] && ((run_neovim_02_tests)) ) \
+ || ( [[ $vim =~ ^neovim-v0.6 ]] && ((run_neovim_06_tests)) ); then
+ echo "Starting Vim: $vim..."
+ file_number=$((file_number+1))
+ test/script/run-vader-tests $quiet_flag $verbose_flag "$vim" "$tests" \
+ > "$output_dir/$file_number" 2>&1 &
+ pid_list="$pid_list $!"
+ fi
+done
+
+if ((run_linters)); then
+ echo "Starting Vint..."
+ file_number=$((file_number+1))
+ test/script/run-vint > "$output_dir/$file_number" 2>&1 &
+ pid_list="$pid_list $!"
+
+ echo "Starting Custom checks..."
+ file_number=$((file_number+1))
+ test/script/custom-checks &> "$output_dir/$file_number" 2>&1 &
+ pid_list="$pid_list $!"
+fi
+
+echo
+
+failed=0
+index=0
+
+for pid in $pid_list; do
+ this_failed=0
+ index=$((index+1))
+
+ if ! wait "$pid"; then
+ failed=1
+ this_failed=1
+ fi
+
+ # Hide output for things that passed if -q is set.
+ if [ "$quiet_flag" != '-q' ] || ((this_failed)); then
+ cat "$output_dir/$index"
+ fi
+done
+
+if ((failed)); then
+ echo 'Something went wrong!'
+else
+ echo 'All tests passed!'
+fi
+
+exit $failed
diff --git a/sources_non_forked/ale/run-tests.bat b/sources_non_forked/ale/run-tests.bat
new file mode 100644
index 00000000..9ba6b554
--- /dev/null
+++ b/sources_non_forked/ale/run-tests.bat
@@ -0,0 +1,30 @@
+@echo off
+REM Run tests on Windows.
+REM
+REM To run these tests, you should set up your Windows machine with the same
+REM paths that are used in AppVeyor.
+
+set tests=test/*.vader test/*/*.vader test/*/*/*.vader test/*/*/*/*.vader
+
+REM Use the first argument for selecting tests to run.
+if not "%1"=="" set tests=%1
+
+set VADER_OUTPUT_FILE=%~dp0\vader_output
+REM Automatically re-run Windows tests, which can fail some times.
+set tries=0
+
+:RUN_TESTS
+set /a tries=%tries%+1
+type nul > "%VADER_OUTPUT_FILE%"
+C:\vim\vim\vim80\vim.exe -u test/vimrc "+Vader! %tests%"
+set code=%ERRORLEVEL%
+
+IF %code% EQU 0 GOTO :SHOW_RESULTS
+IF %tries% GEQ 2 GOTO :SHOW_RESULTS
+GOTO :RUN_TESTS
+
+:SHOW_RESULTS
+type "%VADER_OUTPUT_FILE%"
+del "%VADER_OUTPUT_FILE%"
+
+exit /B %code%
diff --git a/sources_non_forked/ale/supported-tools.md b/sources_non_forked/ale/supported-tools.md
index b2c0ec48..24e8de42 100644
--- a/sources_non_forked/ale/supported-tools.md
+++ b/sources_non_forked/ale/supported-tools.md
@@ -23,6 +23,7 @@ formatting.
* Ada
* [ada_language_server](https://github.com/AdaCore/ada_language_server)
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [gcc](https://gcc.gnu.org)
* [gnatpp](https://docs.adacore.com/gnat_ugn-docs/html/gnat_ugn/gnat_ugn/gnat_utility_programs.html#the-gnat-pretty-printer-gnatpp) :floppy_disk:
* Ansible
@@ -33,7 +34,8 @@ formatting.
* [apkbuild-lint](https://gitlab.alpinelinux.org/Leo/atools)
* [secfixes-check](https://gitlab.alpinelinux.org/Leo/atools)
* AsciiDoc
- * [alex](https://github.com/wooorm/alex) :floppy_disk:
+ * [alex](https://github.com/get-alex/alex)
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [languagetool](https://languagetool.org/) :floppy_disk:
* [proselint](http://proselint.com/)
* [redpen](http://redpen.cc/)
@@ -42,10 +44,13 @@ formatting.
* [write-good](https://github.com/btford/write-good)
* ASM
* [gcc](https://gcc.gnu.org)
+* AVRA
+ * [avra](https://github.com/Ro5bert/avra)
* Awk
* [gawk](https://www.gnu.org/software/gawk/)
* Bash
* [bashate](https://github.com/openstack/bashate)
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [language-server](https://github.com/mads-hartmann/bash-language-server)
* shell [-n flag](https://www.gnu.org/software/bash/manual/bash.html#index-set)
* [shellcheck](https://www.shellcheck.net/)
@@ -56,6 +61,8 @@ formatting.
* [buildifier](https://github.com/bazelbuild/buildtools)
* BibTeX
* [bibclean](http://ftp.math.utah.edu/pub/bibclean/)
+* BitBake
+ * [oelint-adv](https://github.com/priv-kweihmann/oelint-adv)
* Bourne Shell
* shell [-n flag](http://linux.die.net/man/1/sh)
* [shellcheck](https://www.shellcheck.net/)
@@ -68,13 +75,15 @@ formatting.
* [clangd](https://clang.llvm.org/extra/clangd.html)
* [clangtidy](http://clang.llvm.org/extra/clang-tidy/) :floppy_disk:
* [cppcheck](http://cppcheck.sourceforge.net)
- * [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint)
+ * [cpplint](https://github.com/cpplint/cpplint)
* [cquery](https://github.com/cquery-project/cquery)
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [flawfinder](https://www.dwheeler.com/flawfinder/)
* [gcc](https://gcc.gnu.org/)
* [uncrustify](https://github.com/uncrustify/uncrustify)
* C#
* [csc](http://www.mono-project.com/docs/about-mono/languages/csharp/) :floppy_disk: see:`help ale-cs-csc` for details and configuration
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [dotnet-format](https://github.com/dotnet/format)
* [mcs](http://www.mono-project.com/docs/about-mono/languages/csharp/) see:`help ale-cs-mcs` for details
* [mcsc](http://www.mono-project.com/docs/about-mono/languages/csharp/) :floppy_disk: see:`help ale-cs-mcsc` for details and configuration
@@ -91,6 +100,7 @@ formatting.
* [cppcheck](http://cppcheck.sourceforge.net)
* [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint) :floppy_disk:
* [cquery](https://github.com/cquery-project/cquery)
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [flawfinder](https://www.dwheeler.com/flawfinder/)
* [gcc](https://gcc.gnu.org/)
* [uncrustify](https://github.com/uncrustify/uncrustify)
@@ -104,7 +114,8 @@ formatting.
* [cfn-python-lint](https://github.com/awslabs/cfn-python-lint)
* CMake
* [cmake-format](https://github.com/cheshirekow/cmake_format)
- * [cmakelint](https://github.com/richq/cmake-lint)
+ * [cmake-lint](https://github.com/cheshirekow/cmake_format)
+ * [cmakelint](https://github.com/cmake-lint/cmake-lint)
* CoffeeScript
* [coffee](http://coffeescript.org/)
* [coffeelint](https://www.npmjs.com/package/coffeelint)
@@ -112,6 +123,8 @@ formatting.
* [ameba](https://github.com/veelenga/ameba) :floppy_disk:
* [crystal](https://crystal-lang.org/) :floppy_disk:
* CSS
+ * [VSCode CSS language server](https://github.com/hrsh7th/vscode-langservers-extracted)
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [csslint](http://csslint.net/)
* [fecs](http://fecs.baidu.com/)
* [prettier](https://github.com/prettier/prettier)
@@ -135,9 +148,8 @@ formatting.
* Dart
* [analysis_server](https://github.com/dart-lang/sdk/tree/master/pkg/analysis_server)
* [dart-analyze](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) :floppy_disk:
- * [dart-format](https://github.com/dart-lang/sdk/tree/master/utils/dartfmt) :floppy_disk:
- * [dartanalyzer](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) :floppy_disk:
- * [dartfmt](https://github.com/dart-lang/sdk/tree/master/utils/dartfmt) :floppy_disk:
+ * [dart-format](https://github.com/dart-lang/sdk/tree/master/utils/dartfmt)
+ * [dartfmt](https://github.com/dart-lang/sdk/tree/master/utils/dartfmt)
* [language_server](https://github.com/natebosch/dart_language_server)
* desktop
* [desktop-file-validate](https://www.freedesktop.org/wiki/Software/desktop-file-utils/)
@@ -147,9 +159,11 @@ formatting.
* [dhall-lint](https://github.com/dhall-lang/dhall-lang)
* Dockerfile
* [dockerfile_lint](https://github.com/projectatomic/dockerfile_lint)
+ * [dprint](https://dprint.dev)
* [hadolint](https://github.com/hadolint/hadolint)
* Elixir
* [credo](https://github.com/rrrene/credo)
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell) :warning:
* [dialyxir](https://github.com/jeremyjh/dialyxir)
* [dogma](https://github.com/lpil/dogma) :floppy_disk:
* [elixir-ls](https://github.com/elixir-lsp/elixir-ls) :warning:
@@ -187,10 +201,12 @@ formatting.
* [glslls](https://github.com/svenstaro/glsl-language-server)
* Go
* [bingo](https://github.com/saibing/bingo) :warning:
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell) :warning:
* [go build](https://golang.org/cmd/go/) :warning: :floppy_disk:
* [go mod](https://golang.org/cmd/go/) :warning: :floppy_disk:
* [go vet](https://golang.org/cmd/vet/) :floppy_disk:
* [gofmt](https://golang.org/cmd/gofmt/)
+ * [gofumpt](https://github.com/mvdan/gofumpt)
* [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports) :warning:
* [golangci-lint](https://github.com/golangci/golangci-lint) :warning: :floppy_disk:
* [golangserver](https://github.com/sourcegraph/go-langserver) :warning:
@@ -217,6 +233,7 @@ formatting.
* Haskell
* [brittany](https://github.com/lspitzner/brittany)
* [cabal-ghc](https://www.haskell.org/cabal/)
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [floskell](https://github.com/ennocramer/floskell)
* [ghc](https://www.haskell.org/ghc/)
* [ghc-mod](https://github.com/DanielG/ghc-mod)
@@ -231,10 +248,13 @@ formatting.
* [stack-ghc](https://haskellstack.org/)
* [stylish-haskell](https://github.com/jaspervdj/stylish-haskell)
* HCL
+ * [packer-fmt](https://github.com/hashicorp/packer)
* [terraform-fmt](https://github.com/hashicorp/terraform)
* HTML
- * [alex](https://github.com/wooorm/alex) :floppy_disk:
+ * [VSCode HTML language server](https://github.com/hrsh7th/vscode-langservers-extracted)
+ * [alex](https://github.com/get-alex/alex)
* [angular](https://www.npmjs.com/package/@angular/language-server)
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [fecs](http://fecs.baidu.com/)
* [html-beautify](https://beautifier.io/)
* [htmlhint](http://htmlhint.com/)
@@ -253,13 +273,16 @@ formatting.
* Java
* [PMD](https://pmd.github.io/)
* [checkstyle](http://checkstyle.sourceforge.net) :floppy_disk:
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [eclipselsp](https://github.com/eclipse/eclipse.jdt.ls)
* [google-java-format](https://github.com/google/google-java-format)
* [javac](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
* [javalsp](https://github.com/georgewfraser/vscode-javac)
* [uncrustify](https://github.com/uncrustify/uncrustify)
* JavaScript
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [deno](https://deno.land/)
+ * [dprint](https://dprint.dev/)
* [eslint](http://eslint.org/)
* [fecs](http://fecs.baidu.com/)
* [flow](https://flowtype.org/)
@@ -272,16 +295,19 @@ formatting.
* [tsserver](https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29)
* [xo](https://github.com/sindresorhus/xo)
* JSON
- * [eslint](http://eslint.org/)
+ * [VSCode JSON language server](https://github.com/hrsh7th/vscode-langservers-extracted)
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell) :warning:
+ * [dprint](https://dprint.dev)
+ * [eslint](http://eslint.org/) :warning:
* [fixjson](https://github.com/rhysd/fixjson)
- * [jq](https://stedolan.github.io/jq/)
+ * [jq](https://stedolan.github.io/jq/) :warning:
* [jsonlint](https://github.com/zaach/jsonlint)
* [prettier](https://github.com/prettier/prettier)
* [spectral](https://github.com/stoplightio/spectral)
* JSON5
- * [eslint](http://eslint.org/)
+ * [eslint](http://eslint.org/) :warning:
* JSONC
- * [eslint](http://eslint.org/)
+ * [eslint](http://eslint.org/) :warning:
* Jsonnet
* [jsonnet-lint](https://jsonnet.org/learning/tools.html)
* [jsonnetfmt](https://jsonnet.org/learning/tools.html)
@@ -292,8 +318,9 @@ formatting.
* [ktlint](https://ktlint.github.io)
* [languageserver](https://github.com/fwcd/KotlinLanguageServer) see `:help ale-integration-kotlin` for configuration instructions
* LaTeX
- * [alex](https://github.com/wooorm/alex) :floppy_disk:
+ * [alex](https://github.com/get-alex/alex)
* [chktex](http://www.nongnu.org/chktex/)
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [lacheck](https://www.ctan.org/pkg/lacheck)
* [proselint](http://proselint.com/)
* [redpen](http://redpen.cc/)
@@ -308,20 +335,23 @@ formatting.
* LLVM
* [llc](https://llvm.org/docs/CommandGuide/llc.html)
* Lua
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [lua-format](https://github.com/Koihik/LuaFormatter)
* [luac](https://www.lua.org/manual/5.1/luac.html)
* [luacheck](https://github.com/mpeterv/luacheck)
* [luafmt](https://github.com/trixnz/lua-fmt)
+ * [selene](https://github.com/Kampfkarren/selene)
* [stylua](https://github.com/johnnymorganz/stylua)
* Mail
- * [alex](https://github.com/wooorm/alex) :floppy_disk:
+ * [alex](https://github.com/get-alex/alex)
* [languagetool](https://languagetool.org/) :floppy_disk:
* [proselint](http://proselint.com/)
* [vale](https://github.com/ValeLint/vale)
* Make
* [checkmake](https://github.com/mrtazz/checkmake)
* Markdown
- * [alex](https://github.com/wooorm/alex) :floppy_disk:
+ * [alex](https://github.com/get-alex/alex)
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [languagetool](https://languagetool.org/) :floppy_disk:
* [markdownlint](https://github.com/DavidAnson/markdownlint) :floppy_disk:
* [mdl](https://github.com/mivok/markdownlint)
@@ -348,8 +378,9 @@ formatting.
* [nixfmt](https://github.com/serokell/nixfmt)
* [nixpkgs-fmt](https://github.com/nix-community/nixpkgs-fmt)
* [rnix-lsp](https://github.com/nix-community/rnix-lsp)
+ * [statix](https://github.com/nerdypepper/statix)
* nroff
- * [alex](https://github.com/wooorm/alex) :floppy_disk:
+ * [alex](https://github.com/get-alex/alex)
* [proselint](http://proselint.com/)
* [write-good](https://github.com/btford/write-good)
* Objective-C
@@ -371,6 +402,8 @@ formatting.
* [ibm_validator](https://github.com/IBM/openapi-validator)
* [prettier](https://github.com/prettier/prettier)
* [yamllint](https://yamllint.readthedocs.io/)
+* Packer (HCL)
+ * [packer-fmt-fixer](https://github.com/hashicorp/packer)
* Pascal
* [ptop](https://www.freepascal.org/tools/ptop.var)
* Pawn
@@ -382,11 +415,13 @@ formatting.
* Perl6
* [perl6 -c](https://perl6.org) :warning:
* PHP
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [intelephense](https://github.com/bmewburn/intelephense-docs)
* [langserver](https://github.com/felixfbecker/php-language-server)
* [phan](https://github.com/phan/phan) see `:help ale-php-phan` to instructions
* [php -l](https://secure.php.net/)
* [php-cs-fixer](http://cs.sensiolabs.org/)
+ * [phpactor](https://github.com/phpactor/phpactor)
* [phpcbf](https://github.com/squizlabs/PHP_CodeSniffer)
* [phpcs](https://github.com/squizlabs/PHP_CodeSniffer)
* [phpmd](https://phpmd.org)
@@ -394,22 +429,25 @@ formatting.
* [psalm](https://getpsalm.org) :floppy_disk:
* [tlint](https://github.com/tightenco/tlint)
* PO
- * [alex](https://github.com/wooorm/alex) :floppy_disk:
+ * [alex](https://github.com/get-alex/alex)
* [msgfmt](https://www.gnu.org/software/gettext/manual/html_node/msgfmt-Invocation.html)
* [proselint](http://proselint.com/)
* [write-good](https://github.com/btford/write-good)
* Pod
- * [alex](https://github.com/wooorm/alex) :floppy_disk:
+ * [alex](https://github.com/get-alex/alex)
* [proselint](http://proselint.com/)
* [write-good](https://github.com/btford/write-good)
* Pony
* [ponyc](https://github.com/ponylang/ponyc)
* PowerShell
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [powershell](https://github.com/PowerShell/PowerShell)
* [psscriptanalyzer](https://github.com/PowerShell/PSScriptAnalyzer)
* Prolog
* [swipl](https://github.com/SWI-Prolog/swipl-devel)
* proto
+ * [buf-format](https://github.com/bufbuild/buf) :floppy_disk:
+ * [buf-lint](https://github.com/bufbuild/buf) :floppy_disk:
* [protoc-gen-lint](https://github.com/ckaznocha/protoc-gen-lint) :floppy_disk:
* [protolint](https://github.com/yoheimuta/protolint) :floppy_disk:
* Pug
@@ -427,7 +465,8 @@ formatting.
* [autoimport](https://lyz-code.github.io/autoimport/)
* [autopep8](https://github.com/hhatto/autopep8)
* [bandit](https://github.com/PyCQA/bandit) :warning:
- * [black](https://github.com/ambv/black)
+ * [black](https://github.com/psf/black)
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [flake8](http://flake8.pycqa.org/en/latest/)
* [flakehell](https://github.com/flakehell/flakehell)
* [isort](https://github.com/timothycrosley/isort)
@@ -442,6 +481,7 @@ formatting.
* [pyre](https://github.com/facebook/pyre-check) :warning:
* [pyright](https://github.com/microsoft/pyright)
* [reorder-python-imports](https://github.com/asottile/reorder_python_imports)
+ * [unimport](https://github.com/hakancelik96/unimport)
* [vulture](https://github.com/jendrikseipp/vulture) :warning: :floppy_disk:
* [yapf](https://github.com/google/yapf)
* QML
@@ -461,8 +501,13 @@ formatting.
* [ols](https://github.com/freebroccolo/ocaml-language-server)
* [reason-language-server](https://github.com/jaredly/reason-language-server)
* [refmt](https://github.com/reasonml/reason-cli)
+* Rego
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
+ * [opacheck](https://www.openpolicyagent.org/docs/latest/cli/#opa-check)
+ * [opafmt](https://www.openpolicyagent.org/docs/latest/cli/#opa-fmt)
* reStructuredText
- * [alex](https://github.com/wooorm/alex) :floppy_disk:
+ * [alex](https://github.com/get-alex/alex)
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [proselint](http://proselint.com/)
* [redpen](http://redpen.cc/)
* [rstcheck](https://github.com/myint/rstcheck)
@@ -475,6 +520,7 @@ formatting.
* [rpmlint](https://github.com/rpm-software-management/rpmlint) :warning: (see `:help ale-integration-spec`)
* Ruby
* [brakeman](http://brakemanscanner.org/) :floppy_disk:
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [debride](https://github.com/seattlerb/debride)
* [prettier](https://github.com/prettier/plugin-ruby)
* [rails_best_practices](https://github.com/flyerhzm/rails_best_practices) :floppy_disk:
@@ -487,6 +533,7 @@ formatting.
* [standardrb](https://github.com/testdouble/standard)
* Rust
* [cargo](https://github.com/rust-lang/cargo) :floppy_disk: (see `:help ale-integration-rust` for configuration instructions)
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [rls](https://github.com/rust-lang-nursery/rls) :warning:
* [rust-analyzer](https://github.com/rust-analyzer/rust-analyzer) :warning:
* [rustc](https://www.rust-lang.org/) :warning:
@@ -497,6 +544,7 @@ formatting.
* [sass-lint](https://www.npmjs.com/package/sass-lint)
* [stylelint](https://github.com/stylelint/stylelint)
* Scala
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [fsc](https://www.scala-lang.org/old/sites/default/files/linuxsoft_archives/docu/files/tools/fsc.html)
* [metals](https://scalameta.org/metals/)
* [sbtserver](https://www.scala-sbt.org/1.x/docs/sbt-server.html)
@@ -517,6 +565,7 @@ formatting.
* [solhint](https://github.com/protofire/solhint)
* [solium](https://github.com/duaraghav8/Solium)
* SQL
+ * [dprint](https://dprint.dev)
* [pgformatter](https://github.com/darold/pgFormatter)
* [sql-lint](https://github.com/joereynolds/sql-lint)
* [sqlfmt](https://github.com/jackc/sqlfmt)
@@ -531,6 +580,7 @@ formatting.
* [svelteserver](https://github.com/sveltejs/language-tools/tree/master/packages/language-server)
* Swift
* [Apple swift-format](https://github.com/apple/swift-format)
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [sourcekit-lsp](https://github.com/apple/sourcekit-lsp)
* [swiftformat](https://github.com/nicklockwood/SwiftFormat)
* [swiftlint](https://github.com/realm/SwiftLint)
@@ -539,17 +589,20 @@ formatting.
* Tcl
* [nagelfar](http://nagelfar.sourceforge.net) :floppy_disk:
* Terraform
+ * [checkov](https://github.com/bridgecrewio/checkov)
* [terraform](https://github.com/hashicorp/terraform)
* [terraform-fmt-fixer](https://github.com/hashicorp/terraform)
* [terraform-ls](https://github.com/hashicorp/terraform-ls)
* [terraform-lsp](https://github.com/juliosueiras/terraform-lsp)
* [tflint](https://github.com/wata727/tflint)
* Texinfo
- * [alex](https://github.com/wooorm/alex) :floppy_disk:
+ * [alex](https://github.com/get-alex/alex)
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [proselint](http://proselint.com/)
* [write-good](https://github.com/btford/write-good)
* Text
- * [alex](https://github.com/wooorm/alex) :warning: :floppy_disk:
+ * [alex](https://github.com/get-alex/alex) :warning:
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [languagetool](https://languagetool.org/) :floppy_disk:
* [proselint](http://proselint.com/) :warning:
* [redpen](http://redpen.cc/) :warning:
@@ -559,8 +612,12 @@ formatting.
* Thrift
* [thrift](http://thrift.apache.org/)
* [thriftcheck](https://github.com/pinterest/thriftcheck)
+* TOML
+ * [dprint](https://dprint.dev)
* TypeScript
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [deno](https://deno.land/)
+ * [dprint](https://dprint.dev/)
* [eslint](http://eslint.org/)
* [fecs](http://fecs.baidu.com/)
* [prettier](https://github.com/prettier/prettier)
@@ -589,23 +646,30 @@ formatting.
* [vimls](https://github.com/iamcco/vim-language-server)
* [vint](https://github.com/Kuniwak/vint)
* Vim help
- * [alex](https://github.com/wooorm/alex) :warning: :floppy_disk:
+ * [alex](https://github.com/get-alex/alex) :warning:
* [proselint](http://proselint.com/) :warning:
* [write-good](https://github.com/btford/write-good) :warning:
* Vue
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [prettier](https://github.com/prettier/prettier)
* [vls](https://github.com/vuejs/vetur/tree/master/server)
+ * [volar](https://github.com/johnsoncodehk/volar)
+* WGSL
+ * [naga](https://github.com/gfx-rs/naga)
* XHTML
- * [alex](https://github.com/wooorm/alex) :floppy_disk:
+ * [alex](https://github.com/get-alex/alex)
+ * [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
* [proselint](http://proselint.com/)
* [write-good](https://github.com/btford/write-good)
* XML
* [xmllint](http://xmlsoft.org/xmllint.html)
* YAML
- * [circleci](https://circleci.com/docs/2.0/local-cli) :floppy_disk:
+ * [actionlint](https://github.com/rhysd/actionlint) :warning:
+ * [circleci](https://circleci.com/docs/2.0/local-cli) :floppy_disk: :warning:
* [prettier](https://github.com/prettier/prettier)
* [spectral](https://github.com/stoplightio/spectral)
- * [swaglint](https://github.com/byCedric/swaglint)
+ * [swaglint](https://github.com/byCedric/swaglint) :warning:
+ * [yaml-language-server](https://github.com/redhat-developer/yaml-language-server)
* [yamlfix](https://lyz-code.github.io/yamlfix)
* [yamllint](https://yamllint.readthedocs.io/)
* YANG
@@ -613,4 +677,5 @@ formatting.
* Zeek
* [zeek](http://zeek.org) :floppy_disk:
* Zig
+ * [zigfmt](https://github.com/ziglang/zig)
* [zls](https://github.com/zigtools/zls)
diff --git a/sources_non_forked/ale/test/completion/test_ale_import_command.vader b/sources_non_forked/ale/test/completion/test_ale_import_command.vader
new file mode 100644
index 00000000..4770466e
--- /dev/null
+++ b/sources_non_forked/ale/test/completion/test_ale_import_command.vader
@@ -0,0 +1,562 @@
+Before:
+ Save g:ale_enabled
+ Save b:ale_enabled
+ Save g:ale_lint_on_text_changed
+ Save g:ale_completion_enabled
+ Save g:ale_completion_autoimport
+ Save g:ale_completion_max_suggestions
+ Save g:ale_linters
+ Save b:ale_linters
+
+ let g:ale_enabled = 0
+ let b:ale_enabled = 0
+ let g:ale_lint_on_text_changed = 'always'
+ let g:ale_completion_enabled = 0
+ let g:ale_completion_autoimport = 0
+ let g:ale_completion_max_suggestions = 50
+ let g:ale_linters = {'typescript': ['tsserver'], 'python': ['pyre']}
+ unlet! b:ale_linters
+
+ let g:server_started_value = 1
+ let g:request_id = 0
+ let g:LastCallback = v:null
+ let g:LastHandleCallback = v:null
+ let g:sent_message_list = []
+ let g:code_action_list = []
+ let g:execute_list = []
+ let g:ale_queue_call_list = []
+
+ runtime autoload/ale.vim
+ runtime autoload/ale/util.vim
+ runtime autoload/ale/code_action.vim
+ runtime autoload/ale/lsp.vim
+ runtime autoload/ale/lsp_linter.vim
+
+ function! ale#util#Execute(expr) abort
+ call add(g:execute_list, a:expr)
+ endfunction
+
+ function! ale#Queue(...) abort
+ call add(g:ale_queue_call_list, a:000)
+ endfunction
+
+ function! ale#lsp#RegisterCallback(id, Callback) abort
+ let g:LastHandleCallback = a:Callback
+ endfunction
+
+ function! ale#lsp#NotifyForChanges(id, buffer) abort
+ endfunction
+
+ function! ale#lsp#HasCapability(id, capability) abort
+ return 1
+ endfunction
+
+ function! ale#lsp#Send(id, message) abort
+ let g:request_id += 1
+
+ call add(g:sent_message_list, a:message)
+
+ return g:request_id
+ endfunction
+
+ function! ale#lsp_linter#StartLSP(buffer, linter, Callback) abort
+ let g:LastCallback = a:Callback
+
+ return g:server_started_value
+ endfunction
+
+ function! ale#code_action#HandleCodeAction(code_action, options) abort
+ Assert !get(a:options, 'should_save')
+
+ call add(g:code_action_list, a:code_action)
+ endfunction
+
+ function GetLastMessage()
+ return get(g:execute_list, -1, '')
+ endfunction
+
+ function CheckLintStates(conn_id, message)
+ " Check that we request more linter results after adding completions.
+ AssertEqual [[0, '']], g:ale_queue_call_list
+
+ let g:ale_enabled = 0
+
+ let g:ale_queue_call_list = []
+ call g:LastHandleCallback(a:conn_id, a:message)
+ AssertEqual [], g:ale_queue_call_list
+
+ let g:ale_enabled = 1
+ let g:ale_lint_on_text_changed = 1
+
+ let g:ale_queue_call_list = []
+ call g:LastHandleCallback(a:conn_id, a:message)
+ AssertEqual [[0, '']], g:ale_queue_call_list
+
+ let g:ale_lint_on_text_changed = 'normal'
+
+ let g:ale_queue_call_list = []
+ call g:LastHandleCallback(a:conn_id, a:message)
+ AssertEqual [[0, '']], g:ale_queue_call_list
+
+ let g:ale_lint_on_text_changed = 'insert'
+
+ let g:ale_queue_call_list = []
+ call g:LastHandleCallback(a:conn_id, a:message)
+ AssertEqual [[0, '']], g:ale_queue_call_list
+
+ let g:ale_queue_call_list = []
+ let g:ale_lint_on_text_changed = 'never'
+
+ call g:LastHandleCallback(a:conn_id, a:message)
+ AssertEqual [], g:ale_queue_call_list
+
+ let g:ale_lint_on_text_changed = '0'
+
+ call g:LastHandleCallback(a:conn_id, a:message)
+ AssertEqual [], g:ale_queue_call_list
+
+ let g:ale_lint_on_text_changed = 0
+
+ call g:LastHandleCallback(a:conn_id, a:message)
+ AssertEqual [], g:ale_queue_call_list
+
+ let g:ale_lint_on_text_changed = 'xxx'
+
+ call g:LastHandleCallback(a:conn_id, a:message)
+ AssertEqual [], g:ale_queue_call_list
+ endfunction
+
+After:
+ call ale#linter#Reset()
+
+ Restore
+
+ delfunction GetLastMessage
+ delfunction CheckLintStates
+
+ unlet! g:LastCallback
+ unlet! g:LastHandleCallback
+ unlet! g:request_id
+ unlet! g:server_started_value
+ unlet! g:sent_message_list
+ unlet! g:code_action_list
+ unlet! g:ale_queue_call_list
+ unlet! g:execute_list
+ unlet! g:received_message
+ unlet! b:ale_old_omnifunc
+ unlet! b:ale_old_completeopt
+ unlet! b:ale_completion_info
+ unlet! b:ale_completion_result
+ unlet! b:ale_complete_done_time
+
+ runtime autoload/ale.vim
+ runtime autoload/ale/util.vim
+ runtime autoload/ale/code_action.vim
+ runtime autoload/ale/lsp.vim
+ runtime autoload/ale/lsp_linter.vim
+
+Given typescript(Some example TypeScript code):
+ let xyz = 123
+ let foo = missingword
+
+ let abc = 456
+
+Execute(ALEImport should complain when there's no word at the cursor):
+ call setpos('.', [bufnr(''), 3, 1, 0])
+ ALEImport
+
+ AssertEqual 'echom ''Nothing to complete at cursor!''', GetLastMessage()
+
+Execute(ALEImport should tell the user if no LSP is available):
+ let g:server_started_value = 0
+
+ call setpos('.', [bufnr(''), 2, 16, 0])
+ ALEImport
+
+ AssertEqual
+ \ 'echom ''No completion providers are available.''',
+ \ GetLastMessage()
+
+Execute(ALEImport should request imports correctly for tsserver):
+ call setpos('.', [bufnr(''), 2, 16, 0])
+
+ ALEImport
+
+ AssertEqual
+ \ {
+ \ 'conn_id': 0,
+ \ 'request_id': 0,
+ \ 'source': 'ale-import',
+ \ 'column': 21,
+ \ 'line': 2,
+ \ 'line_length': 21,
+ \ 'prefix': 'missingword',
+ \ 'additional_edits_only': 1,
+ \ },
+ \ b:ale_completion_info
+ Assert g:LastCallback isnot v:null
+
+ call g:LastCallback(ale#linter#Get(&filetype)[0], {
+ \ 'connection_id': 347,
+ \ 'buffer': bufnr(''),
+ \})
+
+ AssertEqual
+ \ {
+ \ 'conn_id': 347,
+ \ 'request_id': 1,
+ \ 'source': 'ale-import',
+ \ 'column': 21,
+ \ 'line': 2,
+ \ 'line_length': 21,
+ \ 'prefix': 'missingword',
+ \ 'additional_edits_only': 1,
+ \ },
+ \ b:ale_completion_info
+ Assert g:LastHandleCallback isnot v:null
+
+ call g:LastHandleCallback(347, {
+ \ 'request_seq': 1,
+ \ 'command': 'completions',
+ \ 'body': [
+ \ {'name': 'missingwordIgnoreMe'},
+ \ {'name': 'missingword'},
+ \ ],
+ \})
+
+ AssertEqual
+ \ [
+ \ [0, 'ts@completions', {
+ \ 'file': expand('%:p'),
+ \ 'includeExternalModuleExports': 1,
+ \ 'offset': 21,
+ \ 'line': 2,
+ \ 'prefix': 'missingword',
+ \ }],
+ \ [0, 'ts@completionEntryDetails', {
+ \ 'file': expand('%:p'),
+ \ 'entryNames': [{'name': 'missingword'}],
+ \ 'offset': 21,
+ \ 'line': 2,
+ \ }]
+ \ ],
+ \ g:sent_message_list
+ AssertEqual 2, b:ale_completion_info.request_id
+
+ let g:ale_enabled = 1
+ let g:received_message = {
+ \ 'request_seq': 2,
+ \ 'command': 'completionEntryDetails',
+ \ 'body': [
+ \ {
+ \ 'name': 'missingword',
+ \ 'kind': 'className',
+ \ 'displayParts': [],
+ \ 'codeActions': [{
+ \ 'description': 'import { missingword } from "./Something";',
+ \ 'changes': [],
+ \ }],
+ \ },
+ \ ],
+ \}
+ call g:LastHandleCallback(347, g:received_message)
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'description': 'import { missingword } from "./Something";',
+ \ 'changes': [],
+ \ },
+ \ ],
+ \ g:code_action_list
+
+ call CheckLintStates(347, g:received_message)
+
+Execute(ALEImport should tell the user when no completions were found from tsserver):
+ call setpos('.', [bufnr(''), 2, 16, 0])
+
+ ALEImport
+
+ AssertEqual
+ \ {
+ \ 'conn_id': 0,
+ \ 'request_id': 0,
+ \ 'source': 'ale-import',
+ \ 'column': 21,
+ \ 'line': 2,
+ \ 'line_length': 21,
+ \ 'prefix': 'missingword',
+ \ 'additional_edits_only': 1,
+ \ },
+ \ b:ale_completion_info
+ Assert g:LastCallback isnot v:null
+
+ call g:LastCallback(ale#linter#Get(&filetype)[0], {
+ \ 'connection_id': 347,
+ \ 'buffer': bufnr(''),
+ \})
+
+ AssertEqual
+ \ {
+ \ 'conn_id': 347,
+ \ 'request_id': 1,
+ \ 'source': 'ale-import',
+ \ 'column': 21,
+ \ 'line': 2,
+ \ 'line_length': 21,
+ \ 'prefix': 'missingword',
+ \ 'additional_edits_only': 1,
+ \ },
+ \ b:ale_completion_info
+ Assert g:LastHandleCallback isnot v:null
+
+ call g:LastHandleCallback(347, {
+ \ 'request_seq': 1,
+ \ 'command': 'completions',
+ \ 'body': [
+ \ {'name': 'missingwordIgnoreMe'},
+ \ ],
+ \})
+
+ AssertEqual 'echom ''No possible imports found.''', GetLastMessage()
+
+Given python(Some example Python code):
+ xyz = 123
+ foo = missingword
+
+ abc = 456
+
+Execute(ALEImport should request imports correctly for language servers):
+ call setpos('.', [bufnr(''), 2, 12, 0])
+
+ ALEImport
+
+ AssertEqual
+ \ {
+ \ 'conn_id': 0,
+ \ 'request_id': 0,
+ \ 'source': 'ale-import',
+ \ 'column': 17,
+ \ 'line': 2,
+ \ 'line_length': 17,
+ \ 'prefix': 'missingword',
+ \ 'additional_edits_only': 1,
+ \ },
+ \ b:ale_completion_info
+ Assert g:LastCallback isnot v:null
+
+ call g:LastCallback(ale#linter#Get(&filetype)[0], {
+ \ 'connection_id': 347,
+ \ 'buffer': bufnr(''),
+ \})
+
+ AssertEqual
+ \ {
+ \ 'conn_id': 347,
+ \ 'request_id': 1,
+ \ 'source': 'ale-import',
+ \ 'column': 17,
+ \ 'line': 2,
+ \ 'line_length': 17,
+ \ 'prefix': 'missingword',
+ \ 'additional_edits_only': 1,
+ \ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
+ \ },
+ \ b:ale_completion_info
+ Assert g:LastHandleCallback isnot v:null
+
+ AssertEqual
+ \ [
+ \ [0, 'textDocument/completion', {
+ \ 'textDocument': {'uri': ale#path#ToFileURI(expand('%:p'))},
+ \ 'position': {'character': 16, 'line': 1}
+ \ }],
+ \ ],
+ \ g:sent_message_list
+ AssertEqual 1, b:ale_completion_info.request_id
+
+ let g:ale_enabled = 1
+ let g:received_message = {
+ \ 'id': 1,
+ \ 'jsonrpc': '2.0',
+ \ 'result': {
+ \ 'isIncomplete': v:false,
+ \ 'items': [
+ \ {
+ \ 'detail': 'Some other word we should ignore',
+ \ 'filterText': 'missingwordIgnoreMe',
+ \ 'insertText': 'missingwordIgnoreMe',
+ \ 'insertTextFormat': 1,
+ \ 'kind': 6,
+ \ 'label': ' missingwordIgnoreMe',
+ \ 'sortText': '3ee19999missingword',
+ \ 'additionalTextEdits': [
+ \ {
+ \ 'range': {
+ \ 'start': {'line': 1, 'character': 1},
+ \ 'end': {'line': 2, 'character': 1},
+ \ },
+ \ 'newText': 'from something import missingwordIgnoreMe',
+ \ },
+ \ ],
+ \ },
+ \ {
+ \ 'detail': 'Some word without text edits',
+ \ 'filterText': 'missingword',
+ \ 'insertText': 'missingword',
+ \ 'insertTextFormat': 1,
+ \ 'kind': 6,
+ \ 'label': ' missingword',
+ \ 'sortText': '3ee19999missingword',
+ \ },
+ \ {
+ \ 'detail': 'The word we should use',
+ \ 'filterText': 'missingword',
+ \ 'insertText': 'missingword',
+ \ 'insertTextFormat': 1,
+ \ 'kind': 6,
+ \ 'label': ' missingword',
+ \ 'sortText': '3ee19999missingword',
+ \ 'additionalTextEdits': [
+ \ {
+ \ 'range': {
+ \ 'start': {'line': 1, 'character': 1},
+ \ 'end': {'line': 2, 'character': 1},
+ \ },
+ \ 'newText': 'from something import missingword',
+ \ },
+ \ ],
+ \ },
+ \ {
+ \ 'detail': 'The other word we should not use',
+ \ 'filterText': 'missingword',
+ \ 'insertText': 'missingword',
+ \ 'insertTextFormat': 1,
+ \ 'kind': 6,
+ \ 'label': ' missingword',
+ \ 'sortText': '3ee19999missingword',
+ \ 'additionalTextEdits': [
+ \ {
+ \ 'range': {
+ \ 'start': {'line': 1, 'character': 1},
+ \ 'end': {'line': 2, 'character': 1},
+ \ },
+ \ 'newText': 'from something_else import missingword',
+ \ },
+ \ ],
+ \ },
+ \ ],
+ \ },
+ \}
+ call g:LastHandleCallback(347, g:received_message)
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'description': 'completion',
+ \ 'changes': [
+ \ {
+ \ 'fileName': expand('%:p'),
+ \ 'textChanges': [
+ \ {
+ \ 'start': {'line': 2, 'offset': 2},
+ \ 'end': {'line': 3, 'offset': 2},
+ \ 'newText': 'from something import missingword',
+ \ },
+ \ ],
+ \ },
+ \ ],
+ \ },
+ \ ],
+ \ g:code_action_list
+
+ call CheckLintStates(347, g:received_message)
+
+Execute(ALEImport should tell the user when no completions were found from a language server):
+ call setpos('.', [bufnr(''), 2, 12, 0])
+
+ ALEImport
+
+ AssertEqual
+ \ {
+ \ 'conn_id': 0,
+ \ 'request_id': 0,
+ \ 'source': 'ale-import',
+ \ 'column': 17,
+ \ 'line': 2,
+ \ 'line_length': 17,
+ \ 'prefix': 'missingword',
+ \ 'additional_edits_only': 1,
+ \ },
+ \ b:ale_completion_info
+ Assert g:LastCallback isnot v:null
+
+ call g:LastCallback(ale#linter#Get(&filetype)[0], {
+ \ 'connection_id': 347,
+ \ 'buffer': bufnr(''),
+ \})
+
+ AssertEqual
+ \ {
+ \ 'conn_id': 347,
+ \ 'request_id': 1,
+ \ 'source': 'ale-import',
+ \ 'column': 17,
+ \ 'line': 2,
+ \ 'line_length': 17,
+ \ 'prefix': 'missingword',
+ \ 'additional_edits_only': 1,
+ \ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
+ \ },
+ \ b:ale_completion_info
+ Assert g:LastHandleCallback isnot v:null
+
+ AssertEqual
+ \ [
+ \ [0, 'textDocument/completion', {
+ \ 'textDocument': {'uri': ale#path#ToFileURI(expand('%:p'))},
+ \ 'position': {'character': 16, 'line': 1}
+ \ }],
+ \ ],
+ \ g:sent_message_list
+ AssertEqual 1, b:ale_completion_info.request_id
+
+ let g:received_message = {
+ \ 'id': 1,
+ \ 'jsonrpc': '2.0',
+ \ 'result': {
+ \ 'isIncomplete': v:false,
+ \ 'items': [
+ \ {
+ \ 'detail': 'Some other word we should ignore',
+ \ 'filterText': 'missingwordIgnoreMe',
+ \ 'insertText': 'missingwordIgnoreMe',
+ \ 'insertTextFormat': 1,
+ \ 'kind': 6,
+ \ 'label': ' missingwordIgnoreMe',
+ \ 'sortText': '3ee19999missingword',
+ \ 'additionalTextEdits': [
+ \ {
+ \ 'range': {
+ \ 'start': {'line': 1, 'character': 1},
+ \ 'end': {'line': 2, 'character': 1},
+ \ },
+ \ 'newText': 'from something import missingwordIgnoreMe',
+ \ },
+ \ ],
+ \ },
+ \ {
+ \ 'detail': 'Some word without text edits',
+ \ 'filterText': 'missingword',
+ \ 'insertText': 'missingword',
+ \ 'insertTextFormat': 1,
+ \ 'kind': 6,
+ \ 'label': ' missingword',
+ \ 'sortText': '3ee19999missingword',
+ \ },
+ \ ],
+ \ },
+ \}
+ call g:LastHandleCallback(347, g:received_message)
+
+ AssertEqual 'echom ''No possible imports found.''', GetLastMessage()
diff --git a/sources_non_forked/ale/test/completion/test_complete_events.vader b/sources_non_forked/ale/test/completion/test_complete_events.vader
new file mode 100644
index 00000000..cee15985
--- /dev/null
+++ b/sources_non_forked/ale/test/completion/test_complete_events.vader
@@ -0,0 +1,35 @@
+Before:
+ let g:complete_post_triggered = 0
+
+ augroup VaderTest
+ autocmd!
+ autocmd User ALECompletePost let g:complete_post_triggered = 1
+ augroup END
+
+After:
+ unlet! b:ale_completion_info
+ unlet! g:complete_post_triggered
+
+ augroup VaderTest
+ autocmd!
+ augroup END
+
+ augroup! VaderTest
+
+Execute(ALECompletePost should not be triggered when completion is cancelled):
+ call ale#completion#HandleUserData({})
+
+ Assert !g:complete_post_triggered
+
+Execute(ALECompletePost should not be triggered when tools other than ALE insert completions):
+ call ale#completion#HandleUserData({'user_data': ''})
+ call ale#completion#HandleUserData({'user_data': '{}'})
+
+ Assert !g:complete_post_triggered
+
+Execute(ALECompletePost should be triggered when ALE inserts completions):
+ call ale#completion#HandleUserData({
+ \ 'user_data': json_encode({'_ale_completion_item': 1}),
+ \})
+
+ Assert g:complete_post_triggered
diff --git a/sources_non_forked/ale/test/completion/test_completion_events.vader b/sources_non_forked/ale/test/completion/test_completion_events.vader
new file mode 100644
index 00000000..ed6dbea3
--- /dev/null
+++ b/sources_non_forked/ale/test/completion/test_completion_events.vader
@@ -0,0 +1,486 @@
+Before:
+ Save g:ale_completion_enabled
+ Save g:ale_completion_delay
+ Save g:ale_completion_max_suggestions
+ Save &l:omnifunc
+ Save &l:completeopt
+
+ unlet! b:ale_completion_enabled
+ let g:ale_completion_enabled = 1
+ let g:get_completions_called = 0
+ let g:feedkeys_calls = []
+ let g:fake_mode = 'i'
+
+ let b:ale_linters = {
+ \ 'typescript': ['tsserver'],
+ \}
+
+ let &l:completeopt = 'menu,menuone,preview,noselect,noinsert'
+
+ runtime autoload/ale/util.vim
+
+ function! ale#util#FeedKeys(string) abort
+ call add(g:feedkeys_calls, [a:string])
+ endfunction
+
+ " Pretend we're in insert mode for most tests.
+ function! ale#util#Mode(...) abort
+ return g:fake_mode
+ endfunction
+
+ function! CheckCompletionCalled(expect_success) abort
+ let g:get_completions_called = 0
+
+ " We just want to check if the function is called.
+ function! ale#completion#GetCompletions(source)
+ let g:get_completions_called = 1
+ endfunction
+
+ let g:ale_completion_delay = 0
+
+ " Run this check a few times, as it can fail randomly.
+ for l:i in range(has('nvim-0.3') || has('win32') ? 5 : 1)
+ call ale#completion#Queue()
+ sleep 1m
+
+ if g:get_completions_called is a:expect_success
+ break
+ endif
+ endfor
+
+ AssertEqual a:expect_success, g:get_completions_called
+ endfunction
+
+ let g:handle_code_action_called = 0
+ function! MockHandleCodeAction() abort
+ " delfunction! ale#code_action#HandleCodeAction
+ function! ale#code_action#HandleCodeAction(action, options) abort
+ Assert !get(a:options, 'should_save')
+ let g:handle_code_action_called += 1
+ endfunction
+ endfunction
+
+After:
+ Restore
+
+ unlet! b:ale_completion_enabled
+ unlet! g:output
+ unlet! g:fake_mode
+ unlet! g:get_completions_called
+ unlet! g:handle_code_action_called
+ unlet! b:ale_old_omnifunc
+ unlet! b:ale_old_completeopt
+ unlet! b:ale_completion_info
+ unlet! b:ale_completion_result
+ unlet! b:ale_complete_done_time
+ unlet! b:ale_linters
+
+ delfunction CheckCompletionCalled
+ delfunction ale#code_action#HandleCodeAction
+ delfunction MockHandleCodeAction
+
+ if exists('*CompleteCallback')
+ delfunction CompleteCallback
+ endif
+
+ " Stop any timers we left behind.
+ " This stops the tests from failing randomly.
+ call ale#completion#StopTimer()
+
+ " Reset the function. The runtime command below should fix this, but doesn't
+ " seem to fix it.
+ function! ale#util#Mode(...) abort
+ return call('mode', a:000)
+ endfunction
+
+ runtime autoload/ale/completion.vim
+ runtime autoload/ale/code_action.vim
+ runtime autoload/ale/util.vim
+
+Execute(ale#completion#GetCompletions should be called when the cursor position stays the same):
+ call CheckCompletionCalled(1)
+
+Execute(ale#completion#GetCompletions should not be called if the global setting is disabled):
+ let g:ale_completion_enabled = 0
+ call CheckCompletionCalled(0)
+
+Execute(ale#completion#GetCompletions should not be called if the buffer setting is disabled):
+ let b:ale_completion_enabled = 0
+ call CheckCompletionCalled(0)
+
+Given typescript():
+ let abc = y.
+ let foo = ab
+ let foo = (ab)
+
+Execute(ale#completion#GetCompletions should not be called when the cursor position changes):
+ call setpos('.', [bufnr(''), 1, 2, 0])
+
+ " We just want to check if the function is called.
+ function! ale#completion#GetCompletions(source)
+ let g:get_completions_called = 1
+ endfunction
+
+ let g:ale_completion_delay = 0
+ call ale#completion#Queue()
+
+ " Change the cursor position before the callback is triggered.
+ call setpos('.', [bufnr(''), 2, 2, 0])
+
+ sleep 1m
+
+ Assert !g:get_completions_called
+
+Execute(ale#completion#GetCompletions should not be called if you switch to normal mode):
+ let &l:completeopt = 'menu,preview'
+ let g:fake_mode = 'n'
+
+ " We just want to check if the function is called.
+ function! ale#completion#GetCompletions(source)
+ let g:get_completions_called = 1
+ endfunction
+
+ let g:ale_completion_delay = 0
+ call ale#completion#Queue()
+
+ sleep 1m
+
+ Assert !g:get_completions_called
+
+Execute(Completion should not be done shortly after the CompleteDone function):
+ call CheckCompletionCalled(1)
+ call ale#completion#Done()
+ call CheckCompletionCalled(0)
+
+Execute(ale#completion#Show() should remember the omnifunc setting and replace it):
+ let &l:omnifunc = 'FooBar'
+
+ let b:ale_completion_info = {'source': 'ale-automatic'}
+ call ale#completion#Show([{'word': 'x', 'kind': 'v', 'icase': 1}])
+
+ AssertEqual 'FooBar', b:ale_old_omnifunc
+ AssertEqual 'ale#completion#AutomaticOmniFunc', &l:omnifunc
+
+ AssertEqual [], g:feedkeys_calls
+ sleep 1ms
+ AssertEqual [["\(ale_show_completion_menu)"]], g:feedkeys_calls
+
+Execute(ale#completion#Show() should remember the completeopt setting and replace it):
+ let &l:completeopt = 'menu'
+
+ let b:ale_completion_info = {'source': 'ale-automatic'}
+ call ale#completion#Show([{'word': 'x', 'kind': 'v', 'icase': 1}])
+
+ AssertEqual 'menu', b:ale_old_completeopt
+ AssertEqual 'menu,menuone,noinsert', &l:completeopt
+
+ AssertEqual [], g:feedkeys_calls
+ sleep 1ms
+ AssertEqual [["\(ale_show_completion_menu)"]], g:feedkeys_calls
+
+Execute(ale#completion#Show() should set the preview option if it's set):
+ let &l:completeopt = 'menu,preview'
+
+ let b:ale_completion_info = {'source': 'ale-automatic'}
+ call ale#completion#Show([{'word': 'x', 'kind': 'v', 'icase': 1}])
+
+ AssertEqual 'menu,preview', b:ale_old_completeopt
+ AssertEqual 'menu,menuone,noinsert,preview', &l:completeopt
+
+ AssertEqual [], g:feedkeys_calls
+ sleep 1ms
+ AssertEqual [["\(ale_show_completion_menu)"]], g:feedkeys_calls
+
+Execute(ale#completion#Show() should not replace the completeopt setting for manual completion):
+ let b:ale_completion_info = {'source': 'ale-manual'}
+
+ let &l:completeopt = 'menu,preview'
+
+ call ale#completion#Show([{'word': 'x', 'kind': 'v', 'icase': 1}])
+
+ Assert !exists('b:ale_old_completeopt')
+
+ AssertEqual [], g:feedkeys_calls
+ sleep 1ms
+ AssertEqual [["\(ale_show_completion_menu)"]], g:feedkeys_calls
+
+Execute(ale#completion#AutomaticOmniFunc() should also remember the completeopt setting and replace it):
+ let &l:completeopt = 'menu,noselect'
+
+ let b:ale_completion_info = {'source': 'ale-automatic'}
+ call ale#completion#AutomaticOmniFunc(0, '')
+
+ AssertEqual 'menu,noselect', b:ale_old_completeopt
+ AssertEqual 'menu,menuone,noinsert,noselect', &l:completeopt
+
+Execute(ale#completion#AutomaticOmniFunc() should set the preview option if it's set):
+ let &l:completeopt = 'menu,preview'
+
+ let b:ale_completion_info = {'source': 'ale-automatic'}
+ call ale#completion#AutomaticOmniFunc(0, '')
+
+ AssertEqual 'menu,preview', b:ale_old_completeopt
+ AssertEqual 'menu,menuone,noinsert,preview', &l:completeopt
+
+Execute(ale#completion#Show() should make the correct feedkeys() call for automatic completion):
+ let b:ale_completion_info = {'source': 'ale-automatic'}
+ call ale#completion#Show([{'word': 'x', 'kind': 'v', 'icase': 1}])
+
+ AssertEqual [], g:feedkeys_calls
+ sleep 1ms
+ AssertEqual [["\(ale_show_completion_menu)"]], g:feedkeys_calls
+
+Execute(ale#completion#Show() should make the correct feedkeys() call for manual completion):
+ let b:ale_completion_info = {'source': 'ale-automatic'}
+ call ale#completion#Show([{'word': 'x', 'kind': 'v', 'icase': 1}])
+
+ AssertEqual [], g:feedkeys_calls
+ sleep 1ms
+ AssertEqual [["\(ale_show_completion_menu)"]], g:feedkeys_calls
+
+Execute(ale#completion#Show() should not call feedkeys() for other sources):
+ let b:ale_completion_info = {'source': 'other-source'}
+ call ale#completion#Show([{'word': 'x', 'kind': 'v', 'icase': 1}])
+
+ sleep 1ms
+ AssertEqual [], g:feedkeys_calls
+
+Execute(ale#completion#Show() shouldn't do anything if you switch back to normal mode):
+ let &l:completeopt = 'menu,preview'
+ let g:fake_mode = 'n'
+
+ call ale#completion#Show([{'word': 'x', 'kind': 'v', 'icase': 1}])
+
+ AssertEqual 'menu,preview', &l:completeopt
+ Assert !exists('b:ale_old_omnifunc')
+ Assert !exists('b:ale_old_completeopt')
+ Assert !exists('b:ale_completion_result')
+ AssertEqual [], g:feedkeys_calls
+
+Execute(ale#completion#Show() should save the result it is given):
+ call ale#completion#Show([])
+
+ AssertEqual [], b:ale_completion_result
+
+ call ale#completion#Show([{'word': 'x', 'kind': 'v', 'icase': 1}])
+
+ AssertEqual [{'word': 'x', 'kind': 'v', 'icase': 1}], b:ale_completion_result
+
+Execute(ale#completion#Done() should restore old omnifunc values):
+ let b:ale_old_omnifunc = 'FooBar'
+
+ call ale#completion#Done()
+
+ " We reset the old omnifunc setting and remove the buffer variable.
+ AssertEqual 'FooBar', &l:omnifunc
+ Assert !has_key(b:, 'ale_old_omnifunc')
+
+Execute(ale#completion#Done() should restore the old completeopt setting):
+ let b:ale_old_completeopt = 'menu'
+
+ call ale#completion#Done()
+
+ AssertEqual 'menu', &l:completeopt
+ Assert !has_key(b:, 'ale_old_completeopt')
+
+Execute(ale#completion#Done() should leave settings alone when none were remembered):
+ let &l:omnifunc = 'BazBoz'
+ let &l:completeopt = 'menu'
+
+ call ale#completion#Done()
+
+ AssertEqual 'BazBoz', &l:omnifunc
+ AssertEqual 'menu', &l:completeopt
+
+Execute(The completion request_id should be reset when queuing again):
+ let b:ale_completion_info = {'request_id': 123}
+
+ let g:ale_completion_delay = 0
+ call ale#completion#Queue()
+ sleep 1m
+
+ AssertEqual 0, b:ale_completion_info.request_id
+
+Execute(b:ale_completion_info should be set up correctly when requesting completions automatically):
+ let b:ale_completion_result = []
+ call setpos('.', [bufnr(''), 3, 14, 0])
+ call ale#completion#GetCompletions('ale-automatic')
+
+ AssertEqual
+ \ {
+ \ 'request_id': 0,
+ \ 'conn_id': 0,
+ \ 'column': 14,
+ \ 'line_length': 14,
+ \ 'line': 3,
+ \ 'prefix': 'ab',
+ \ 'source': 'ale-automatic',
+ \ },
+ \ b:ale_completion_info
+ Assert !exists('b:ale_completion_result')
+
+Execute(b:ale_completion_info should be set up correctly when requesting completions manually):
+ let b:ale_completion_result = []
+ call setpos('.', [bufnr(''), 3, 14, 0])
+ ALEComplete
+
+ AssertEqual
+ \ {
+ \ 'request_id': 0,
+ \ 'conn_id': 0,
+ \ 'column': 14,
+ \ 'line_length': 14,
+ \ 'line': 3,
+ \ 'prefix': 'ab',
+ \ 'source': 'ale-manual',
+ \ },
+ \ b:ale_completion_info
+ Assert !exists('b:ale_completion_result')
+
+Execute(b:ale_completion_info should be set up correctly for other sources):
+ let b:ale_completion_result = []
+ call setpos('.', [bufnr(''), 3, 14, 0])
+ call ale#completion#GetCompletions('ale-callback')
+
+ AssertEqual
+ \ {
+ \ 'request_id': 0,
+ \ 'conn_id': 0,
+ \ 'column': 14,
+ \ 'line_length': 14,
+ \ 'line': 3,
+ \ 'prefix': 'ab',
+ \ 'source': 'ale-callback',
+ \ },
+ \ b:ale_completion_info
+ Assert !exists('b:ale_completion_result')
+
+Execute(b:ale_completion_info should be set up correctly when requesting completions via callback):
+ let b:ale_completion_result = []
+ call setpos('.', [bufnr(''), 3, 14, 0])
+
+ function! CompleteCallback() abort
+ echo 'Called'
+ endfunction
+
+
+ call ale#completion#GetCompletions('ale-callback', {'callback': funcref('CompleteCallback')})
+
+ AssertEqual
+ \ {
+ \ 'request_id': 0,
+ \ 'conn_id': 0,
+ \ 'column': 14,
+ \ 'line_length': 14,
+ \ 'line': 3,
+ \ 'prefix': 'ab',
+ \ 'source': 'ale-callback',
+ \ },
+ \ b:ale_completion_info
+ Assert !exists('b:ale_completion_result')
+
+Execute(The correct keybinds should be configured):
+ redir => g:output
+ silent map (ale_show_completion_menu)
+ redir END
+
+ AssertEqual
+ \ [
+ \ 'n (ale_show_completion_menu) * :call ale#completion#RestoreCompletionOptions()',
+ \ 'o (ale_show_completion_menu) * ',
+ \ 'v (ale_show_completion_menu) * ',
+ \ ],
+ \ sort(split(g:output, "\n"))
+
+Execute(Running the normal mode keybind should reset the settings):
+ let b:ale_old_omnifunc = 'FooBar'
+ let b:ale_old_completeopt = 'menu'
+
+ " We can't run the keybind, but we can call the function.
+ call ale#completion#RestoreCompletionOptions()
+
+ AssertEqual 'FooBar', &l:omnifunc
+ AssertEqual 'menu', &l:completeopt
+ Assert !has_key(b:, 'ale_old_omnifunc')
+ Assert !has_key(b:, 'ale_old_completeopt')
+
+Execute(HandleUserData should call ale#code_action#HandleCodeAction):
+ let b:ale_completion_info = {'source': 'ale-manual'}
+ call MockHandleCodeAction()
+
+ call ale#completion#HandleUserData({})
+ AssertEqual g:handle_code_action_called, 0
+
+ call ale#completion#HandleUserData({
+ \ 'user_data': ''
+ \})
+ AssertEqual g:handle_code_action_called, 0
+
+ call ale#completion#HandleUserData({
+ \ 'user_data': json_encode({}),
+ \})
+ AssertEqual g:handle_code_action_called, 0
+
+ call ale#completion#HandleUserData({
+ \ 'user_data': json_encode({
+ \ '_ale_completion_item': 1,
+ \ 'code_actions': [],
+ \ }),
+ \})
+ AssertEqual g:handle_code_action_called, 0
+
+ call ale#completion#HandleUserData({
+ \ 'user_data': json_encode({
+ \ '_ale_completion_item': 1,
+ \ 'code_actions': [
+ \ {'description': '', 'changes': []},
+ \ ],
+ \ }),
+ \})
+ AssertEqual g:handle_code_action_called, 1
+
+ let b:ale_completion_info = {'source': 'ale-automatic'}
+ call ale#completion#HandleUserData({
+ \ 'user_data': json_encode({
+ \ '_ale_completion_item': 1,
+ \ 'code_actions': [
+ \ {'description': '', 'changes': []},
+ \ ],
+ \ }),
+ \})
+ AssertEqual g:handle_code_action_called, 2
+
+ let b:ale_completion_info = {'source': 'ale-callback'}
+ call ale#completion#HandleUserData({
+ \ 'user_data': json_encode({
+ \ '_ale_completion_item': 1,
+ \ 'code_actions': [
+ \ {'description': '', 'changes': []},
+ \ ],
+ \ }),
+ \})
+ AssertEqual g:handle_code_action_called, 3
+
+ let b:ale_completion_info = {'source': 'ale-omnifunc'}
+ call ale#completion#HandleUserData({
+ \ 'user_data': json_encode({
+ \ '_ale_completion_item': 1,
+ \ 'code_actions': [
+ \ {'description': '', 'changes': []},
+ \ ],
+ \ }),
+ \})
+ AssertEqual g:handle_code_action_called, 4
+
+Execute(ale#code_action#HandleCodeAction should not be called when when source is not ALE):
+ call MockHandleCodeAction()
+ let b:ale_completion_info = {'source': 'syntastic'}
+ call ale#completion#HandleUserData({
+ \ 'user_data': json_encode({
+ \ '_ale_completion_item': 1,
+ \ 'code_actions': [
+ \ {'description': '', 'changes': []},
+ \ ],
+ \ }),
+ \})
+ AssertEqual g:handle_code_action_called, 0
diff --git a/sources_non_forked/ale/test/completion/test_completion_filtering.vader b/sources_non_forked/ale/test/completion/test_completion_filtering.vader
new file mode 100644
index 00000000..172203a4
--- /dev/null
+++ b/sources_non_forked/ale/test/completion/test_completion_filtering.vader
@@ -0,0 +1,142 @@
+Before:
+ Save g:ale_completion_excluded_words
+
+ let g:ale_completion_excluded_words = []
+
+After:
+ Restore
+
+ unlet! b:ale_completion_excluded_words
+ unlet! b:suggestions
+
+Execute(Prefix filtering should work for Lists of strings):
+ AssertEqual
+ \ ['FooBar', 'foo'],
+ \ ale#completion#Filter(bufnr(''), '', ['FooBar', 'FongBar', 'baz', 'foo'], 'foo', 0)
+ AssertEqual
+ \ ['FooBar', 'FongBar', 'baz', 'foo'],
+ \ ale#completion#Filter(bufnr(''), '', ['FooBar', 'FongBar', 'baz', 'foo'], '.', 0)
+ AssertEqual
+ \ ['FooBar', 'FongBar', 'baz', 'foo'],
+ \ ale#completion#Filter(bufnr(''), '', ['FooBar', 'FongBar', 'baz', 'foo'], '', 0)
+
+Execute(Exact filtering should work):
+ AssertEqual
+ \ ['foo'],
+ \ ale#completion#Filter(bufnr(''), '', ['FooBar', 'FongBar', 'baz', 'foo'], 'foo', 1)
+ AssertEqual
+ \ ['FooBar', 'FongBar', 'baz', 'foo'],
+ \ ale#completion#Filter(bufnr(''), '', ['FooBar', 'FongBar', 'baz', 'foo'], '.', 1)
+ AssertEqual
+ \ ['Foo'],
+ \ ale#completion#Filter(bufnr(''), '', ['FooBar', 'FongBar', 'Foo', 'foo'], 'Foo', 1)
+
+Execute(Prefix filtering should work for completion items):
+ AssertEqual
+ \ [{'word': 'FooBar'}, {'word': 'foo'}],
+ \ ale#completion#Filter(
+ \ bufnr(''),
+ \ '',
+ \ [
+ \ {'word': 'FooBar'},
+ \ {'word': 'FongBar'},
+ \ {'word': 'baz'},
+ \ {'word': 'foo'},
+ \ ],
+ \ 'foo',
+ \ 0,
+ \ )
+
+ AssertEqual
+ \ [
+ \ {'word': 'FooBar'},
+ \ {'word': 'FongBar'},
+ \ {'word': 'baz'},
+ \ {'word': 'foo'},
+ \ ],
+ \ ale#completion#Filter(
+ \ bufnr(''),
+ \ '',
+ \ [
+ \ {'word': 'FooBar'},
+ \ {'word': 'FongBar'},
+ \ {'word': 'baz'},
+ \ {'word': 'foo'},
+ \ ],
+ \ '.',
+ \ 0,
+ \ )
+
+Execute(Excluding words from completion results should work):
+ let b:ale_completion_excluded_words = ['it', 'describe']
+
+ AssertEqual
+ \ [{'word': 'Italian'}],
+ \ ale#completion#Filter(
+ \ bufnr(''),
+ \ '',
+ \ [
+ \ {'word': 'Italian'},
+ \ {'word': 'it'},
+ \ ],
+ \ 'it',
+ \ 0,
+ \ )
+
+ AssertEqual
+ \ [{'word': 'Deutsch'}],
+ \ ale#completion#Filter(
+ \ bufnr(''),
+ \ '',
+ \ [
+ \ {'word': 'describe'},
+ \ {'word': 'Deutsch'},
+ \ ],
+ \ 'de',
+ \ 0,
+ \ )
+
+ AssertEqual
+ \ [{'word': 'Deutsch'}],
+ \ ale#completion#Filter(
+ \ bufnr(''),
+ \ '',
+ \ [
+ \ {'word': 'describe'},
+ \ {'word': 'Deutsch'},
+ \ ],
+ \ '.',
+ \ 0,
+ \ )
+
+Execute(Excluding words from completion results should work with lists of Strings):
+ let b:ale_completion_excluded_words = ['it', 'describe']
+
+ AssertEqual
+ \ ['Italian'],
+ \ ale#completion#Filter(bufnr(''), '', ['Italian', 'it'], 'it', 0)
+ AssertEqual
+ \ ['Deutsch'],
+ \ ale#completion#Filter(bufnr(''), '', ['describe', 'Deutsch'], 'de', 0)
+ AssertEqual
+ \ ['Deutsch'],
+ \ ale#completion#Filter(bufnr(''), '', ['describe', 'Deutsch'], '.', 0)
+ AssertEqual
+ \ ['Deutsch'],
+ \ ale#completion#Filter(bufnr(''), '', ['Deutsch'], '', 0)
+
+Execute(Filtering shouldn't modify the original list):
+ let b:ale_completion_excluded_words = ['it', 'describe']
+ let b:suggestions = [{'word': 'describe'}]
+
+ AssertEqual [], ale#completion#Filter(bufnr(''), '', b:suggestions, '.', 0)
+ AssertEqual b:suggestions, [{'word': 'describe'}]
+ AssertEqual [], ale#completion#Filter(bufnr(''), '', b:suggestions, 'de', 0)
+ AssertEqual b:suggestions, [{'word': 'describe'}]
+
+Execute(Filtering should respect filetype triggers):
+ let b:suggestions = [{'word': 'describe'}]
+
+ AssertEqual b:suggestions, ale#completion#Filter(bufnr(''), '', b:suggestions, '.', 0)
+ AssertEqual b:suggestions, ale#completion#Filter(bufnr(''), 'rust', b:suggestions, '.', 0)
+ AssertEqual b:suggestions, ale#completion#Filter(bufnr(''), 'rust', b:suggestions, '::', 0)
diff --git a/sources_non_forked/ale/test/completion/test_completion_prefixes.vader b/sources_non_forked/ale/test/completion/test_completion_prefixes.vader
new file mode 100644
index 00000000..3f2cab15
--- /dev/null
+++ b/sources_non_forked/ale/test/completion/test_completion_prefixes.vader
@@ -0,0 +1,65 @@
+Given typescript():
+ let abc = y.
+ let foo = ab
+ let foo = (ab)
+ let string1 = '
+ let string2 = "
+
+Execute(Completion should be done after dots in TypeScript):
+ AssertEqual '.', ale#completion#GetPrefix(&filetype, 1, 13)
+
+Execute(Completion should be done after words in TypeScript):
+ AssertEqual 'ab', ale#completion#GetPrefix(&filetype, 2, 13)
+
+Execute(Completion should be done after words in parens in TypeScript):
+ AssertEqual 'ab', ale#completion#GetPrefix(&filetype, 3, 14)
+
+Execute(Completion should not be done after parens in TypeScript):
+ AssertEqual '', ale#completion#GetPrefix(&filetype, 3, 15)
+
+Execute(Completion should be done after strings in TypeScript):
+ AssertEqual '''', ale#completion#GetPrefix(&filetype, 4, 16)
+ AssertEqual '"', ale#completion#GetPrefix(&filetype, 5, 16)
+
+Execute(Completion prefixes should work for other filetypes):
+ AssertEqual 'ab', ale#completion#GetPrefix('xxxyyyzzz', 3, 14)
+
+Execute(Completion prefixes should work for other filetypes):
+ AssertEqual 'ab', ale#completion#GetPrefix('xxxyyyzzz', 3, 14)
+
+Given rust():
+ let abc = y.
+ let abc = String::
+ let foo = (ab)
+
+Execute(Completion should be done after dots in Rust):
+ AssertEqual '.', ale#completion#GetPrefix(&filetype, 1, 13)
+
+Execute(Completion should be done after colons in Rust):
+ AssertEqual '::', ale#completion#GetPrefix(&filetype, 2, 19)
+
+Execute(Completion should be done after words in parens in Rust):
+ AssertEqual 'ab', ale#completion#GetPrefix(&filetype, 3, 14)
+
+Execute(Completion should not be done after parens in Rust):
+ AssertEqual '', ale#completion#GetPrefix(&filetype, 3, 15)
+
+Given lisp():
+ (minus-name
+ (full-name)
+
+Execute(Completion should be done for function names with minuses in Lisp):
+ AssertEqual 'minus-name', ale#completion#GetPrefix(&filetype, 1, 12)
+
+Execute(Completion should not be done after parens in Lisp):
+ AssertEqual '', ale#completion#GetPrefix(&filetype, 2, 12)
+
+Given clojure():
+ (minus-name
+ (full-name)
+
+Execute(Completion should be done for function names with minuses in Clojure):
+ AssertEqual 'minus-name', ale#completion#GetPrefix(&filetype, 1, 12)
+
+Execute(Completion should not be done after parens in Clojure):
+ AssertEqual '', ale#completion#GetPrefix(&filetype, 2, 12)
diff --git a/sources_non_forked/ale/test/completion/test_lsp_completion_messages.vader b/sources_non_forked/ale/test/completion/test_lsp_completion_messages.vader
new file mode 100644
index 00000000..f6aa332b
--- /dev/null
+++ b/sources_non_forked/ale/test/completion/test_lsp_completion_messages.vader
@@ -0,0 +1,307 @@
+Before:
+ Save g:ale_completion_delay
+ Save g:ale_completion_max_suggestions
+ Save g:ale_completion_info
+ Save &l:omnifunc
+ Save &l:completeopt
+
+ let g:ale_completion_enabled = 1
+
+ call ale#test#SetDirectory('/testplugin/test/completion')
+ call ale#test#SetFilename('dummy.txt')
+
+ runtime autoload/ale/lsp.vim
+
+ let g:message_list = []
+ let g:capability_checked = ''
+ let g:conn_id = v:null
+ let g:Callback = ''
+ let g:init_callback_list = []
+
+ function! ale#lsp_linter#StartLSP(buffer, linter, Callback) abort
+ let g:conn_id = ale#lsp#Register('executable', '/foo/bar', {})
+ call ale#lsp#MarkDocumentAsOpen(g:conn_id, a:buffer)
+
+ let l:details = {
+ \ 'command': 'foobar',
+ \ 'buffer': a:buffer,
+ \ 'connection_id': g:conn_id,
+ \ 'project_root': '/foo/bar',
+ \}
+
+ call add(g:init_callback_list, {-> a:Callback(a:linter, l:details)})
+ endfunction
+
+ " Pretend we're in insert mode for most tests.
+ function! ale#util#Mode(...) abort
+ return 'i'
+ endfunction
+
+ function! ale#lsp#HasCapability(conn_id, capability) abort
+ let g:capability_checked = a:capability
+
+ return 1
+ endfunction
+
+ function! ale#lsp#RegisterCallback(conn_id, callback) abort
+ let g:Callback = a:callback
+ endfunction
+
+ " Replace the Send function for LSP, so we can monitor calls to it.
+ function! ale#lsp#Send(conn_id, message) abort
+ call add(g:message_list, a:message)
+
+ return 1
+ endfunction
+
+After:
+ Restore
+
+ if g:conn_id isnot v:null
+ call ale#lsp#RemoveConnectionWithID(g:conn_id)
+ endif
+
+ unlet! g:message_list
+ unlet! g:capability_checked
+ unlet! g:init_callback_list
+ unlet! g:conn_id
+ unlet! g:Callback
+ unlet! b:ale_old_omnifunc
+ unlet! b:ale_old_completeopt
+ unlet! b:ale_completion_info
+ unlet! b:ale_complete_done_time
+ unlet! b:ale_linters
+ unlet! b:ale_tsserver_completion_names
+
+ " Reset the function.
+ function! ale#util#Mode(...) abort
+ return call('mode', a:000)
+ endfunction
+
+ call ale#test#RestoreDirectory()
+ call ale#linter#Reset()
+
+ " Stop any timers we left behind.
+ " This stops the tests from failing randomly.
+ call ale#completion#StopTimer()
+
+ runtime autoload/ale/completion.vim
+ runtime autoload/ale/lsp.vim
+ runtime autoload/ale/lsp_linter.vim
+
+Given typescript(Some typescript file):
+ foo
+ somelongerline
+ bazxyzxyzxyz
+
+Execute(The right message should be sent for the initial tsserver request):
+ runtime ale_linters/typescript/tsserver.vim
+ let b:ale_linters = ['tsserver']
+ " The cursor position needs to match what was saved before.
+ call setpos('.', [bufnr(''), 1, 3, 0])
+
+ call ale#completion#GetCompletions('ale-automatic')
+
+ " We shouldn't register the callback yet.
+ AssertEqual '''''', string(g:Callback)
+
+ AssertEqual 1, len(g:init_callback_list)
+ call map(g:init_callback_list, 'v:val()')
+
+ AssertEqual 'completion', g:capability_checked
+
+ " We should send the right callback.
+ AssertEqual
+ \ 'function(''ale#completion#HandleTSServerResponse'')',
+ \ string(g:Callback)
+ " We should send the right message.
+ AssertEqual
+ \ [[0, 'ts@completions', {
+ \ 'file': expand('%:p'),
+ \ 'line': 1,
+ \ 'offset': 3,
+ \ 'prefix': 'fo',
+ \ 'includeExternalModuleExports': g:ale_completion_autoimport,
+ \ }]],
+ \ g:message_list
+ " We should set up the completion info correctly.
+ AssertEqual
+ \ {
+ \ 'line_length': 3,
+ \ 'conn_id': g:conn_id,
+ \ 'column': 3,
+ \ 'request_id': 1,
+ \ 'line': 1,
+ \ 'prefix': 'fo',
+ \ 'source': 'ale-automatic',
+ \ },
+ \ get(b:, 'ale_completion_info', {})
+
+Execute(The right message sent to the tsserver LSP when the first completion message is received):
+ " The cursor position needs to match what was saved before.
+ call setpos('.', [bufnr(''), 1, 1, 0])
+ let b:ale_completion_info = {
+ \ 'conn_id': 123,
+ \ 'prefix': 'f',
+ \ 'request_id': 4,
+ \ 'line': 1,
+ \ 'column': 1,
+ \}
+ " We should only show up to this many suggestions.
+ let g:ale_completion_max_suggestions = 3
+
+ " Handle the response for completions.
+ call ale#completion#HandleTSServerResponse(123, {
+ \ 'request_seq': 4,
+ \ 'command': 'completions',
+ \ 'body': [
+ \ {'name': 'Baz'},
+ \ {'name': 'dingDong'},
+ \ {'name': 'Foo', 'source': '/path/to/foo.ts'},
+ \ {'name': 'FooBar'},
+ \ {'name': 'frazzle'},
+ \ {'name': 'FFS'},
+ \ ],
+ \})
+
+ " We should save the names we got in the buffer, as TSServer doesn't return
+ " details for every name.
+ AssertEqual [{
+ \ 'word': 'Foo',
+ \ 'source': '/path/to/foo.ts',
+ \ }, {
+ \ 'word': 'FooBar',
+ \ 'source': '',
+ \ }, {
+ \ 'word': 'frazzle',
+ \ 'source': '',
+ \}],
+ \ get(b:, 'ale_tsserver_completion_names', [])
+
+ " The entry details messages should have been sent.
+ AssertEqual
+ \ [[
+ \ 0,
+ \ 'ts@completionEntryDetails',
+ \ {
+ \ 'file': expand('%:p'),
+ \ 'entryNames': [{
+ \ 'name': 'Foo',
+ \ 'source': '/path/to/foo.ts',
+ \ }, {
+ \ 'name': 'FooBar',
+ \ }, {
+ \ 'name': 'frazzle',
+ \ }],
+ \ 'offset': 1,
+ \ 'line': 1,
+ \ },
+ \ ]],
+ \ g:message_list
+
+Given python(Some Python file):
+ foo
+ somelongerline
+ bazxyzxyzxyz
+
+Execute(The right message should be sent for the initial LSP request):
+ runtime ale_linters/python/pylsp.vim
+ let b:ale_linters = ['pylsp']
+ " The cursor position needs to match what was saved before.
+ call setpos('.', [bufnr(''), 1, 5, 0])
+
+ call ale#completion#GetCompletions('ale-automatic')
+
+ " We shouldn't register the callback yet.
+ AssertEqual '''''', string(g:Callback)
+
+ AssertEqual 1, len(g:init_callback_list)
+ call map(g:init_callback_list, 'v:val()')
+
+ AssertEqual 'completion', g:capability_checked
+
+ " We should send the right callback.
+ AssertEqual
+ \ 'function(''ale#completion#HandleLSPResponse'')',
+ \ string(g:Callback)
+ " We should send the right message.
+ " The character index needs to be at most the index of the last character on
+ " the line, or integration with pylsp will be broken.
+ "
+ " We need to send the message for changing the document first.
+ AssertEqual
+ \ [
+ \ [1, 'textDocument/didChange', {
+ \ 'textDocument': {
+ \ 'uri': ale#path#ToFileURI(expand('%:p')),
+ \ 'version': g:ale_lsp_next_version_id - 1,
+ \ },
+ \ 'contentChanges': [{'text': join(getline(1, '$'), "\n") . "\n"}]
+ \ }],
+ \ [0, 'textDocument/completion', {
+ \ 'textDocument': {'uri': ale#path#ToFileURI(expand('%:p'))},
+ \ 'position': {'line': 0, 'character': 2},
+ \ }],
+ \ ],
+ \ g:message_list
+ " We should set up the completion info correctly.
+ AssertEqual
+ \ {
+ \ 'line_length': 3,
+ \ 'conn_id': g:conn_id,
+ \ 'column': 3,
+ \ 'request_id': 1,
+ \ 'line': 1,
+ \ 'prefix': 'fo',
+ \ 'source': 'ale-automatic',
+ \ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
+ \ },
+ \ get(b:, 'ale_completion_info', {})
+
+Execute(Two completion requests shouldn't be sent in a row):
+ call ale#linter#PreventLoading('python')
+ call ale#linter#Define('python', {
+ \ 'name': 'foo',
+ \ 'lsp': 'stdio',
+ \ 'executable': 'foo',
+ \ 'command': 'foo',
+ \ 'project_root': {-> '/foo/bar'},
+ \})
+ call ale#linter#Define('python', {
+ \ 'name': 'bar',
+ \ 'lsp': 'stdio',
+ \ 'executable': 'foo',
+ \ 'command': 'foo',
+ \ 'project_root': {-> '/foo/bar'},
+ \})
+ let b:ale_linters = ['foo', 'bar']
+
+ " The cursor position needs to match what was saved before.
+ call setpos('.', [bufnr(''), 1, 5, 0])
+
+ call ale#completion#GetCompletions('ale-automatic')
+
+ " We shouldn't register the callback yet.
+ AssertEqual '''''', string(g:Callback)
+
+ AssertEqual 2, len(g:init_callback_list)
+ call map(g:init_callback_list, 'v:val()')
+
+ AssertEqual 'completion', g:capability_checked
+
+ " We should only send one completion message for two LSP servers.
+ AssertEqual
+ \ [
+ \ [1, 'textDocument/didChange', {
+ \ 'textDocument': {
+ \ 'uri': ale#path#ToFileURI(expand('%:p')),
+ \ 'version': g:ale_lsp_next_version_id - 1,
+ \ },
+ \ 'contentChanges': [{'text': join(getline(1, '$'), "\n") . "\n"}]
+ \ }],
+ \ [0, 'textDocument/completion', {
+ \ 'textDocument': {'uri': ale#path#ToFileURI(expand('%:p'))},
+ \ 'position': {'line': 0, 'character': 2},
+ \ }],
+ \ ],
+ \ g:message_list
diff --git a/sources_non_forked/ale/test/completion/test_lsp_completion_parsing.vader b/sources_non_forked/ale/test/completion/test_lsp_completion_parsing.vader
new file mode 100644
index 00000000..7fe22e0c
--- /dev/null
+++ b/sources_non_forked/ale/test/completion/test_lsp_completion_parsing.vader
@@ -0,0 +1,736 @@
+Before:
+ Save g:ale_completion_autoimport
+ Save g:ale_completion_max_suggestions
+
+ let g:ale_completion_max_suggestions = 50
+
+After:
+ Restore
+
+ unlet! b:ale_completion_info
+
+Execute(Should handle Rust completion results correctly):
+ let g:ale_completion_autoimport = 0
+
+ AssertEqual
+ \ [
+ \ {'word': 'new', 'dup': 0, 'menu': 'pub fn new() -> String', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'with_capacity', 'dup': 0, 'menu': 'pub fn with_capacity(capacity: usize) -> String', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'from_utf8', 'dup': 0, 'menu': 'pub fn from_utf8(vec: Vec) -> Result', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'from_utf8_lossy', 'dup': 0, 'menu': 'pub fn from_utf8_lossy<''a>(v: &''a [u8]) -> Cow<''a, str>', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'from_utf16', 'dup': 0, 'menu': 'pub fn from_utf16(v: &[u16]) -> Result', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'from_utf16_lossy', 'dup': 0, 'menu': 'pub fn from_utf16_lossy(v: &[u16]) -> String', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'from_raw_parts', 'dup': 0, 'menu': 'pub unsafe fn from_raw_parts(buf: *mut u8, length: usize, capacity: usize) -> String', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'from_utf8_unchecked', 'dup': 0, 'menu': 'pub unsafe fn from_utf8_unchecked(bytes: Vec) -> String', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'from_iter', 'dup': 0, 'menu': 'fn from_iter>(iter: I) -> String', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'from_iter', 'dup': 0, 'menu': 'fn from_iter>(iter: I) -> String', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'from_iter', 'dup': 0, 'menu': 'fn from_iter>(iter: I) -> String', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'from_iter', 'dup': 0, 'menu': 'fn from_iter>(iter: I) -> String', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'from_iter', 'dup': 0, 'menu': 'fn from_iter>>(iter: I) -> String', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'Searcher', 'dup': 0, 'menu': 'type Searcher = <&''b str as Pattern<''a>>::Searcher;', 'info': '', 'kind': 't', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'default', 'dup': 0, 'menu': 'fn default() -> String', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'Output', 'dup': 0, 'menu': 'type Output = String;', 'info': '', 'kind': 't', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'Output', 'dup': 0, 'menu': 'type Output = str;', 'info': '', 'kind': 't', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'Output', 'dup': 0, 'menu': 'type Output = str;', 'info': '', 'kind': 't', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'Output', 'dup': 0, 'menu': 'type Output = str;', 'info': '', 'kind': 't', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'Output', 'dup': 0, 'menu': 'type Output = str;', 'info': '', 'kind': 't', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'Output', 'dup': 0, 'menu': 'type Output = str;', 'info': '', 'kind': 't', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'Output', 'dup': 0, 'menu': 'type Output = str;', 'info': '', 'kind': 't', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'Target', 'dup': 0, 'menu': 'type Target = str;', 'info': '', 'kind': 't', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'Err', 'dup': 0, 'menu': 'type Err = ParseError;', 'info': '', 'kind': 't', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'from_str', 'dup': 0, 'menu': 'fn from_str(s: &str) -> Result', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'from', 'dup': 0, 'menu': 'fn from(s: &''a str) -> String', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'from', 'dup': 0, 'menu': 'fn from(s: Box) -> String', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'from', 'dup': 0, 'menu': 'fn from(s: Cow<''a, str>) -> String', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'to_vec', 'dup': 0, 'menu': 'pub fn to_vec(&self) -> Vec where T: Clone,', 'info': '', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \],
+ \ ale#completion#ParseLSPCompletions({
+ \ "jsonrpc":"2.0",
+ \ "id":65,
+ \ "result":[
+ \ {
+ \ "label":"new",
+ \ "kind":3,
+ \ "detail":"pub fn new() -> String"
+ \ },
+ \ {
+ \ "label":"with_capacity",
+ \ "kind":3,
+ \ "detail":"pub fn with_capacity(capacity: usize) -> String"
+ \ },
+ \ {
+ \ "label":"from_utf8",
+ \ "kind":3,
+ \ "detail":"pub fn from_utf8(vec: Vec) -> Result"
+ \ },
+ \ {
+ \ "label":"from_utf8_lossy",
+ \ "kind":3,
+ \ "detail":"pub fn from_utf8_lossy<'a>(v: &'a [u8]) -> Cow<'a, str>"
+ \ },
+ \ {
+ \ "label":"from_utf16",
+ \ "kind":3,
+ \ "detail":"pub fn from_utf16(v: &[u16]) -> Result"
+ \ },
+ \ {
+ \ "label":"from_utf16_lossy",
+ \ "kind":3,
+ \ "detail":"pub fn from_utf16_lossy(v: &[u16]) -> String"
+ \ },
+ \ {
+ \ "label":"from_raw_parts",
+ \ "kind":3,
+ \ "detail":"pub unsafe fn from_raw_parts(buf: *mut u8, length: usize, capacity: usize) -> String"
+ \ },
+ \ {
+ \ "label":"from_utf8_unchecked",
+ \ "kind":3,
+ \ "detail":"pub unsafe fn from_utf8_unchecked(bytes: Vec) -> String"
+ \ },
+ \ {
+ \ "label":"from_iter",
+ \ "kind":3,
+ \ "detail":"fn from_iter>(iter: I) -> String"
+ \ },
+ \ {
+ \ "label":"from_iter",
+ \ "kind":3,
+ \ "detail":"fn from_iter>(iter: I) -> String"
+ \ },
+ \ {
+ \ "label":"from_iter",
+ \ "kind":3,
+ \ "detail":"fn from_iter>(iter: I) -> String"
+ \ },
+ \ {
+ \ "label":"from_iter",
+ \ "kind":3,
+ \ "detail":"fn from_iter>(iter: I) -> String"
+ \ },
+ \ {
+ \ "label":"from_iter",
+ \ "kind":3,
+ \ "detail":"fn from_iter>>(iter: I) -> String"
+ \ },
+ \ {
+ \ "label":"Searcher",
+ \ "kind":8,
+ \ "detail":"type Searcher = <&'b str as Pattern<'a>>::Searcher;"
+ \ },
+ \ {
+ \ "label":"default",
+ \ "kind":3,
+ \ "detail":"fn default() -> String"
+ \ },
+ \ {
+ \ "label":"Output",
+ \ "kind":8,
+ \ "detail":"type Output = String;"
+ \ },
+ \ {
+ \ "label":"Output",
+ \ "kind":8,
+ \ "detail":"type Output = str;"
+ \ },
+ \ {
+ \ "label":"Output",
+ \ "kind":8,
+ \ "detail":"type Output = str;"
+ \ },
+ \ {
+ \ "label":"Output",
+ \ "kind":8,
+ \ "detail":"type Output = str;"
+ \ },
+ \ {
+ \ "label":"Output",
+ \ "kind":8,
+ \ "detail":"type Output = str;"
+ \ },
+ \ {
+ \ "label":"Output",
+ \ "kind":8,
+ \ "detail":"type Output = str;"
+ \ },
+ \ {
+ \ "label":"Output",
+ \ "kind":8,
+ \ "detail":"type Output = str;"
+ \ },
+ \ {
+ \ "label":"Target",
+ \ "kind":8,
+ \ "detail":"type Target = str;"
+ \ },
+ \ {
+ \ "label":"Err",
+ \ "kind":8,
+ \ "detail":"type Err = ParseError;"
+ \ },
+ \ {
+ \ "label":"from_str",
+ \ "kind":3,
+ \ "detail":"fn from_str(s: &str) -> Result"
+ \ },
+ \ {
+ \ "label":"from",
+ \ "kind":3,
+ \ "detail":"fn from(s: &'a str) -> String"
+ \ },
+ \ {
+ \ "label":"from",
+ \ "kind":3,
+ \ "detail":"fn from(s: Box) -> String"
+ \ },
+ \ {
+ \ "label":"from",
+ \ "kind":3,
+ \ "detail":"fn from(s: Cow<'a, str>) -> String"
+ \ },
+ \ {
+ \ "label":"to_vec",
+ \ "kind":3,
+ \ "detail":"pub fn to_vec(&self) -> Vec\nwhere\n T: Clone,"
+ \ }
+ \ ]
+ \ })
+
+Execute(Should handle Python completion results correctly):
+ let g:ale_completion_autoimport = 0
+ let b:ale_completion_info = {
+ \ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
+ \}
+
+ AssertEqual
+ \ [
+ \ {'word': 'what', 'dup': 0, 'menu': 'example-python-project.bar.Bar', 'info': "what()\n\n", 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ ],
+ \ ale#completion#ParseLSPCompletions({
+ \ "jsonrpc":"2.0",
+ \ "id":6,
+ \ "result":{
+ \ "isIncomplete":v:false,
+ \ "items":[
+ \ {
+ \ "label":"what()",
+ \ "kind":3,
+ \ "detail":"example-python-project.bar.Bar",
+ \ "documentation":"what()\n\n",
+ \ "sortText":"awhat",
+ \ "insertText":"what"
+ \ },
+ \ {
+ \ "label":"__class__",
+ \ "kind":7,
+ \ "detail":"object",
+ \ "documentation":"type(object_or_name, bases, dict)\ntype(object) -> the object's type\ntype(name, bases, dict) -> a new type",
+ \ "sortText":"z__class__",
+ \ "insertText":"__class__"
+ \ },
+ \ {
+ \ "label":"__delattr__(name)",
+ \ "kind":3,
+ \ "detail":"object",
+ \ "documentation":"Implement delattr(self, name).",
+ \ "sortText":"z__delattr__",
+ \ "insertText":"__delattr__"
+ \ },
+ \ {
+ \ "label":"__dir__()",
+ \ "kind":3,
+ \ "detail":"object",
+ \ "documentation":"__dir__() -> list\ndefault dir() implementation",
+ \ "sortText":"z__dir__",
+ \ "insertText":"__dir__"
+ \ },
+ \ {
+ \ "label":"__doc__",
+ \ "kind":18,
+ \ "detail":"object",
+ \ "documentation":"str(object='') -> str\nstr(bytes_or_buffer[, encoding[, errors]]) -> str\n\nCreate a new string object from the given object. If encoding or\nerrors is specified, then the object must expose a data buffer\nthat will be decoded using the given encoding and error handler.\nOtherwise, returns the result of object.__str__() (if defined)\nor repr(object).\nencoding defaults to sys.getdefaultencoding().\nerrors defaults to 'strict'.",
+ \ "sortText":"z__doc__",
+ \ "insertText":"__doc__"
+ \ },
+ \ {
+ \ "label":"__eq__(value)",
+ \ "kind":3,
+ \ "detail":"object",
+ \ "documentation":"Return self==value.",
+ \ "sortText":"z__eq__",
+ \ "insertText":"__eq__"
+ \ },
+ \ {
+ \ "label":"__format__()",
+ \ "kind":3,
+ \ "detail":"object",
+ \ "documentation":"default object formatter",
+ \ "sortText":"z__format__",
+ \ "insertText":"__format__"
+ \ },
+ \ {
+ \ "label":"__ge__(value)",
+ \ "kind":3,
+ \ "detail":"object",
+ \ "documentation":"Return self>=value.",
+ \ "sortText":"z__ge__",
+ \ "insertText":"__ge__"
+ \ },
+ \ {
+ \ "label":"__getattribute__(name)",
+ \ "kind":3,
+ \ "detail":"object",
+ \ "documentation":"Return getattr(self, name).",
+ \ "sortText":"z__getattribute__",
+ \ "insertText":"__getattribute__"
+ \ },
+ \ {
+ \ "label":"__gt__(value)",
+ \ "kind":3,
+ \ "detail":"object",
+ \ "documentation":"Return self>value.",
+ \ "sortText":"z__gt__",
+ \ "insertText":"__gt__"
+ \ },
+ \ {
+ \ "label":"__hash__()",
+ \ "kind":3,
+ \ "detail":"object",
+ \ "documentation":"Return hash(self).",
+ \ "sortText":"z__hash__",
+ \ "insertText":"__hash__"
+ \ },
+ \ {
+ \ "label":"__init__(args, kwargs)",
+ \ "kind":3,
+ \ "detail":"object",
+ \ "documentation":"Initialize self.\u00a0\u00a0See help(type(self)) for accurate signature.",
+ \ "sortText":"z__init__",
+ \ "insertText":"__init__"
+ \ },
+ \ {
+ \ "label":"__init_subclass__()",
+ \ "kind":3,
+ \ "detail":"object",
+ \ "documentation":"This method is called when a class is subclassed.\n\nThe default implementation does nothing. It may be\noverridden to extend subclasses.",
+ \ "sortText":"z__init_subclass__",
+ \ "insertText":"__init_subclass__"
+ \ },
+ \ {
+ \ "label":"__le__(value)",
+ \ "kind":3,
+ \ "detail":"object",
+ \ "documentation":"Return self<=value.",
+ \ "sortText":"z__le__",
+ \ "insertText":"__le__"
+ \ },
+ \ {
+ \ "label":"__lt__(value)",
+ \ "kind":3,
+ \ "detail":"object",
+ \ "documentation":"Return self int\nsize of object in memory, in bytes",
+ \ "sortText":"z__sizeof__",
+ \ "insertText":"__sizeof__"
+ \ },
+ \ {
+ \ "label":"__str__()",
+ \ "kind":3,
+ \ "detail":"object",
+ \ "documentation":"Return str(self).",
+ \ "sortText":"z__str__",
+ \ "insertText":"__str__"
+ \ },
+ \ {
+ \ "label":"__subclasshook__()",
+ \ "kind":3,
+ \ "detail":"object",
+ \ "documentation":"Abstract classes can override this to customize issubclass().\n\nThis is invoked early on by abc.ABCMeta.__subclasscheck__().\nIt should return True, False or NotImplemented.\u00a0\u00a0If it returns\nNotImplemented, the normal algorithm is used.\u00a0\u00a0Otherwise, it\noverrides the normal algorithm (and the outcome is cached).",
+ \ "sortText":"z__subclasshook__",
+ \ "insertText":"__subclasshook__"
+ \ }
+ \ ]
+ \ }
+ \ })
+
+Execute(Should handle extra Python completion results correctly):
+ let g:ale_completion_autoimport = 0
+
+ let b:ale_completion_info = {
+ \ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
+ \ 'prefix': 'mig',
+ \}
+
+ AssertEqual
+ \ [
+ \ {'word': 'migrations', 'dup': 0, 'menu': 'xxx', 'info': 'migrations', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ {'word': 'MigEngine', 'dup': 0, 'menu': 'xxx', 'info': 'mig engine', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ ],
+ \ ale#completion#ParseLSPCompletions({
+ \ 'jsonrpc': '2.0',
+ \ 'id': 6,
+ \ 'result': {
+ \ 'isIncomplete': v:false,
+ \ 'items': [
+ \ {
+ \ 'label': 'migrations',
+ \ 'kind': 3,
+ \ 'detail': 'xxx',
+ \ 'documentation': 'migrations',
+ \ },
+ \ {
+ \ 'label': 'MigEngine',
+ \ 'kind': 3,
+ \ 'detail': 'xxx',
+ \ 'documentation': 'mig engine',
+ \ },
+ \ {
+ \ 'label': 'ignore me',
+ \ 'kind': 3,
+ \ 'detail': 'nope',
+ \ 'documentation': 'nope',
+ \ },
+ \ ]
+ \ }
+ \ })
+
+Execute(Should handle missing keys):
+ let g:ale_completion_autoimport = 0
+
+ AssertEqual
+ \ [
+ \ {'word': 'x', 'dup': 0, 'menu': '', 'info': '', 'kind': 'v', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ ],
+ \ ale#completion#ParseLSPCompletions({
+ \ 'jsonrpc': '2.0',
+ \ 'id': 6,
+ \ 'result': {
+ \ 'isIncomplete': v:false,
+ \ 'items': [
+ \ {
+ \ 'label': 'x',
+ \ },
+ \ ]
+ \ }
+ \ })
+
+Execute(Should handle documentation in the markdown format):
+ let g:ale_completion_autoimport = 0
+
+ AssertEqual
+ \ [
+ \ {'word': 'migrations', 'dup': 0, 'menu': 'xxx', 'info': 'Markdown documentation', 'kind': 'f', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ ],
+ \ ale#completion#ParseLSPCompletions({
+ \ 'jsonrpc': '2.0',
+ \ 'id': 6,
+ \ 'result': {
+ \ 'isIncomplete': v:false,
+ \ 'items': [
+ \ {
+ \ 'label': 'migrations',
+ \ 'kind': 3,
+ \ 'detail': 'xxx',
+ \ 'documentation': {
+ \ 'kind': 'markdown',
+ \ 'value': 'Markdown documentation',
+ \ },
+ \ },
+ \ ],
+ \ },
+ \ })
+
+Execute(Should handle completion messages with textEdit objects):
+ let g:ale_completion_autoimport = 0
+
+ AssertEqual
+ \ [
+ \ {'word': 'next_callback', 'dup': 0, 'menu': 'PlayTimeCallback', 'info': '', 'kind': 'v', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ ],
+ \ ale#completion#ParseLSPCompletions({
+ \ 'id': 226,
+ \ 'jsonrpc': '2.0',
+ \ 'result': {
+ \ 'isIncomplete': v:false,
+ \ 'items': [
+ \ {
+ \ 'detail': 'PlayTimeCallback',
+ \ 'filterText': 'next_callback',
+ \ 'insertText': 'ignoreme',
+ \ 'insertTextFormat': 1,
+ \ 'kind': 6,
+ \ 'label': ' next_callback',
+ \ 'sortText': '3ee19999next_callback',
+ \ 'textEdit': {
+ \ 'newText': 'next_callback',
+ \ 'range': {
+ \ 'end': {'character': 13, 'line': 12},
+ \ 'start': {'character': 4, 'line': 12},
+ \ },
+ \ },
+ \ },
+ \ ],
+ \ },
+ \ })
+
+Execute(Should handle completion messages with textEdit objects and no insertTextFormat key):
+ let g:ale_completion_autoimport = 0
+
+ AssertEqual
+ \ [
+ \ {'word': 'next_callback', 'dup': 0, 'menu': 'PlayTimeCallback', 'info': '', 'kind': 'v', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ ],
+ \ ale#completion#ParseLSPCompletions({
+ \ 'id': 226,
+ \ 'jsonrpc': '2.0',
+ \ 'result': {
+ \ 'isIncomplete': v:false,
+ \ 'items': [
+ \ {
+ \ 'detail': 'PlayTimeCallback',
+ \ 'filterText': 'next_callback',
+ \ 'insertText': 'ignoreme',
+ \ 'kind': 6,
+ \ 'label': ' next_callback',
+ \ 'sortText': '3ee19999next_callback',
+ \ 'textEdit': {
+ \ 'newText': 'next_callback',
+ \ 'range': {
+ \ 'end': {'character': 13, 'line': 12},
+ \ 'start': {'character': 4, 'line': 12},
+ \ },
+ \ },
+ \ },
+ \ ],
+ \ },
+ \ })
+
+Execute(Should handle completion messages with the deprecated insertText attribute):
+ let g:ale_completion_autoimport = 0
+
+ AssertEqual
+ \ [
+ \ {'word': 'next_callback', 'dup': 0, 'menu': 'PlayTimeCallback', 'info': '', 'kind': 'v', 'icase': 1, 'user_data': json_encode({'_ale_completion_item': 1})},
+ \ ],
+ \ ale#completion#ParseLSPCompletions({
+ \ 'id': 226,
+ \ 'jsonrpc': '2.0',
+ \ 'result': {
+ \ 'isIncomplete': v:false,
+ \ 'items': [
+ \ {
+ \ 'detail': 'PlayTimeCallback',
+ \ 'filterText': 'next_callback',
+ \ 'insertText': 'next_callback',
+ \ 'insertTextFormat': 1,
+ \ 'kind': 6,
+ \ 'label': ' next_callback',
+ \ 'sortText': '3ee19999next_callback',
+ \ },
+ \ ],
+ \ },
+ \ })
+
+Execute(Should handle completion messages with additionalTextEdits when ale_completion_autoimport is turned on):
+ let g:ale_completion_autoimport = 1
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'word': 'next_callback',
+ \ 'dup': 1,
+ \ 'menu': 'PlayTimeCallback',
+ \ 'info': '',
+ \ 'kind': 'v',
+ \ 'icase': 1,
+ \ 'user_data': json_encode({
+ \ '_ale_completion_item': 1,
+ \ 'code_actions': [
+ \ {
+ \ 'description': 'completion',
+ \ 'changes': [
+ \ {
+ \ 'fileName': expand('#' . bufnr('') . ':p'),
+ \ 'textChanges': [
+ \ {
+ \ 'start': {
+ \ 'line': 11,
+ \ 'offset': 2,
+ \ },
+ \ 'end': {
+ \ 'line': 13,
+ \ 'offset': 4,
+ \ },
+ \ 'newText': 'from "module" import next_callback',
+ \ },
+ \ ],
+ \ },
+ \ ],
+ \ },
+ \ ],
+ \ }),
+ \ },
+ \ ],
+ \ ale#completion#ParseLSPCompletions({
+ \ 'id': 226,
+ \ 'jsonrpc': '2.0',
+ \ 'result': {
+ \ 'isIncomplete': v:false,
+ \ 'items': [
+ \ {
+ \ 'detail': 'PlayTimeCallback',
+ \ 'filterText': 'next_callback',
+ \ 'insertText': 'next_callback',
+ \ 'insertTextFormat': 1,
+ \ 'kind': 6,
+ \ 'label': ' next_callback',
+ \ 'sortText': '3ee19999next_callback',
+ \ 'additionalTextEdits': [
+ \ {
+ \ 'range': {
+ \ 'start': {
+ \ 'line': 10,
+ \ 'character': 1,
+ \ },
+ \ 'end': {
+ \ 'line': 12,
+ \ 'character': 3,
+ \ },
+ \ },
+ \ 'newText': 'from "module" import next_callback',
+ \ },
+ \ ],
+ \ },
+ \ ],
+ \ },
+ \ })
+
+Execute(Should not handle completion messages with additionalTextEdits when ale_completion_autoimport is turned off):
+ let g:ale_completion_autoimport = 0
+ let b:ale_completion_info = {'line': 30}
+
+ AssertEqual
+ \ [],
+ \ ale#completion#ParseLSPCompletions({
+ \ 'id': 226,
+ \ 'jsonrpc': '2.0',
+ \ 'result': {
+ \ 'isIncomplete': v:false,
+ \ 'items': [
+ \ {
+ \ 'detail': 'PlayTimeCallback',
+ \ 'filterText': 'next_callback',
+ \ 'insertText': 'next_callback',
+ \ 'insertTextFormat': 1,
+ \ 'kind': 6,
+ \ 'label': ' next_callback',
+ \ 'sortText': '3ee19999next_callback',
+ \ 'additionalTextEdits': [
+ \ {
+ \ 'range': {
+ \ 'start': {
+ \ 'line': 10,
+ \ 'character': 1,
+ \ },
+ \ 'end': {
+ \ 'line': 12,
+ \ 'character': 3,
+ \ },
+ \ },
+ \ 'newText': 'from "module" import next_callback',
+ \ },
+ \ ],
+ \ },
+ \ ],
+ \ },
+ \ })
+
+Execute(Should still handle completion messages with empty additionalTextEdits with ale_completion_autoimport turned off):
+ let g:ale_completion_autoimport = 0
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'word': 'next_callback',
+ \ 'dup': 0,
+ \ 'menu': 'PlayTimeCallback',
+ \ 'info': '',
+ \ 'kind': 'v',
+ \ 'icase': 1,
+ \ 'user_data': json_encode({'_ale_completion_item': 1}),
+ \ }
+ \ ],
+ \ ale#completion#ParseLSPCompletions({
+ \ 'id': 226,
+ \ 'jsonrpc': '2.0',
+ \ 'result': {
+ \ 'isIncomplete': v:false,
+ \ 'items': [
+ \ {
+ \ 'detail': 'PlayTimeCallback',
+ \ 'filterText': 'next_callback',
+ \ 'insertText': 'next_callback',
+ \ 'insertTextFormat': 1,
+ \ 'kind': 6,
+ \ 'label': ' next_callback',
+ \ 'sortText': '3ee19999next_callback',
+ \ 'additionalTextEdits': [],
+ \ },
+ \ ],
+ \ },
+ \ })
diff --git a/sources_non_forked/ale/test/completion/test_omnifunc_completion.vader b/sources_non_forked/ale/test/completion/test_omnifunc_completion.vader
new file mode 100644
index 00000000..1db64705
--- /dev/null
+++ b/sources_non_forked/ale/test/completion/test_omnifunc_completion.vader
@@ -0,0 +1,60 @@
+Before:
+ unlet! b:ale_completion_info
+ unlet! b:ale_completion_result
+
+ let b:lsp_started = 0
+
+ runtime autoload/ale/lsp_linter.vim
+
+ function! ale#lsp_linter#StartLSP(buffer, linter, Callback) abort
+ return b:lsp_started
+ endfunction
+
+ function! SetCompletionResult(...) abort
+ let b:ale_completion_result = ['foo']
+ endfunction
+
+ function! SetCompletionResponse(...) abort
+ let b:ale_completion_result = ['foo']
+ endfunction
+
+After:
+ unlet! b:ale_completion_info
+ unlet! b:ale_completion_result
+ unlet! b:lsp_started
+
+ delfunction SetCompletionResult
+ delfunction SetCompletionResponse
+
+ runtime autoload/ale/lsp_linter.vim
+
+ call ale#linter#Reset()
+
+Given typescript():
+ let abc = y.
+ let foo = ab
+ let foo = (ab)
+
+Execute(-3 should be returned when completion results cannot be requested):
+ AssertEqual -3, ale#completion#OmniFunc(1, '')
+
+Execute(The start position should be returned when results can be requested):
+ let b:lsp_started = 1
+ call setpos('.', [bufnr(''), 3, 14, 0])
+
+ AssertEqual 11, ale#completion#OmniFunc(1, '')
+
+Execute(The omnifunc function should return async results):
+ " Neovim 0.2.0 and 0.4.4 struggles at running these tests.
+ if !has('nvim')
+ call timer_start(0, function('SetCompletionResult'))
+
+ AssertEqual ['foo'], ale#completion#OmniFunc(0, '')
+ endif
+
+Execute(The omnifunc function should parse and return async responses):
+ if !has('nvim')
+ call timer_start(0, function('SetCompletionResponse'))
+
+ AssertEqual ['foo'], ale#completion#OmniFunc(0, '')
+ endif
diff --git a/sources_non_forked/ale/test/completion/test_public_completion_api.vader b/sources_non_forked/ale/test/completion/test_public_completion_api.vader
new file mode 100644
index 00000000..03394820
--- /dev/null
+++ b/sources_non_forked/ale/test/completion/test_public_completion_api.vader
@@ -0,0 +1,47 @@
+Before:
+ call ale#linter#Reset()
+
+ unlet! b:ale_linters
+ unlet! b:ale_completion_info
+ unlet! b:ale_completion_result
+
+After:
+ call ale#linter#Reset()
+
+ unlet! b:ale_linters
+ unlet! b:ale_completion_info
+ unlet! b:ale_completion_result
+
+Execute(ale#completion#GetCompletionResult() should return v:null when there are no results):
+ AssertEqual v:null, ale#completion#GetCompletionResult()
+
+Execute(ale#completion#GetCompletionResult() should return a result computed previously):
+ let b:ale_completion_result = [1]
+
+ AssertEqual [1], ale#completion#GetCompletionResult()
+
+Execute(ale#completion#GetCompletionPosition() should return 0 when there is no completion information):
+ AssertEqual 0, ale#completion#GetCompletionPosition()
+
+Given python(Some Python file):
+ foo bar
+
+Execute(ale#completion#GetCompletionPosition() should return the position in the file when information is available):
+ let b:ale_completion_info = {'line': 1, 'column': 6}
+
+ " This is the first character of 'bar'
+ AssertEqual 4, ale#completion#GetCompletionPosition()
+
+Execute(ale#completion#GetCompletionPositionForDeoplete() should return the position on the given input string):
+ " This is the first character of 'bar'
+ AssertEqual 4, ale#completion#GetCompletionPositionForDeoplete('foo bar')
+
+Execute(ale#completion#CanProvideCompletions should return 0 when no completion sources are available):
+ let b:ale_linters = ['flake8']
+ AssertEqual 0, ale#completion#CanProvideCompletions()
+
+Execute(ale#completion#CanProvideCompletions should return 1 when at least one completion source is available):
+ runtime ale_linters/python/pylsp.vim
+ let b:ale_linters = ['pylsp']
+
+ AssertEqual 1, ale#completion#CanProvideCompletions()
diff --git a/sources_non_forked/ale/test/completion/test_tsserver_completion_parsing.vader b/sources_non_forked/ale/test/completion/test_tsserver_completion_parsing.vader
new file mode 100644
index 00000000..231c0f95
--- /dev/null
+++ b/sources_non_forked/ale/test/completion/test_tsserver_completion_parsing.vader
@@ -0,0 +1,309 @@
+Before:
+ Save g:ale_completion_tsserver_remove_warnings
+
+ let g:ale_completion_tsserver_remove_warnings = 0
+
+After:
+ Restore
+
+ unlet! b:ale_tsserver_completion_names
+
+Execute(TypeScript completions responses should be parsed correctly):
+ AssertEqual [],
+ \ ale#completion#ParseTSServerCompletions({
+ \ 'body': [],
+ \})
+ AssertEqual
+ \ [
+ \ {
+ \ 'word': 'foo',
+ \ 'source': '/path/to/foo.ts',
+ \ },
+ \ {
+ \ 'word': 'bar',
+ \ 'source': '',
+ \ },
+ \ {
+ \ 'word': 'baz',
+ \ 'source': '',
+ \ }
+ \ ],
+ \ ale#completion#ParseTSServerCompletions({
+ \ 'body': [
+ \ {'name': 'foo', 'source': '/path/to/foo.ts'},
+ \ {'name': 'bar'},
+ \ {'name': 'baz'},
+ \ ],
+ \})
+
+Execute(TypeScript completions responses should include warnings):
+ AssertEqual
+ \ [
+ \ {
+ \ 'word': 'foo',
+ \ 'source': '/path/to/foo.ts',
+ \ },
+ \ {
+ \ 'word': 'bar',
+ \ 'source': '',
+ \ },
+ \ {
+ \ 'word': 'baz',
+ \ 'source': '',
+ \ }
+ \ ],
+ \ ale#completion#ParseTSServerCompletions({
+ \ 'body': [
+ \ {'name': 'foo', 'source': '/path/to/foo.ts'},
+ \ {'name': 'bar', 'kind': 'warning'},
+ \ {'name': 'baz'},
+ \ ],
+ \})
+
+Execute(TypeScript completions responses should not include warnings if excluded):
+ let g:ale_completion_tsserver_remove_warnings = 1
+ AssertEqual
+ \ [
+ \ {
+ \ 'word': 'foo',
+ \ 'source': '/path/to/foo.ts',
+ \ },
+ \ {
+ \ 'word': 'baz',
+ \ 'source': '',
+ \ }
+ \ ],
+ \ ale#completion#ParseTSServerCompletions({
+ \ 'body': [
+ \ {'name': 'foo', 'source': '/path/to/foo.ts'},
+ \ {'name': 'bar', 'kind': 'warning'},
+ \ {'name': 'baz'},
+ \ ],
+ \})
+
+Execute(TypeScript completion details responses should be parsed correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'word': 'abc',
+ \ 'menu': '(property) Foo.abc: number',
+ \ 'info': '',
+ \ 'kind': 'v',
+ \ 'icase': 1,
+ \ 'user_data': json_encode({'_ale_completion_item': 1}),
+ \ 'dup': g:ale_completion_autoimport,
+ \ },
+ \ {
+ \ 'word': 'def',
+ \ 'menu': '(property) Foo.def: number',
+ \ 'info': 'foo bar baz',
+ \ 'kind': 'v',
+ \ 'icase': 1,
+ \ 'user_data': json_encode({'_ale_completion_item': 1}),
+ \ 'dup': g:ale_completion_autoimport,
+ \ },
+ \ {
+ \ 'word': 'ghi',
+ \ 'menu': '(class) Foo',
+ \ 'info': '',
+ \ 'kind': 'v',
+ \ 'icase': 1,
+ \ 'user_data': json_encode({'_ale_completion_item': 1}),
+ \ 'dup': g:ale_completion_autoimport,
+ \ },
+ \ ],
+ \ ale#completion#ParseTSServerCompletionEntryDetails({
+ \ 'body': [
+ \ {
+ \ 'name': 'abc',
+ \ 'kind': 'parameterName',
+ \ 'displayParts': [
+ \ {'text': '('},
+ \ {'text': 'property'},
+ \ {'text': ')'},
+ \ {'text': ' '},
+ \ {'text': 'Foo'},
+ \ {'text': '.'},
+ \ {'text': 'abc'},
+ \ {'text': ':'},
+ \ {'text': ' '},
+ \ {'text': 'number'},
+ \ ],
+ \ },
+ \ {
+ \ 'name': 'def',
+ \ 'kind': 'parameterName',
+ \ 'displayParts': [
+ \ {'text': '('},
+ \ {'text': 'property'},
+ \ {'text': ')'},
+ \ {'text': ' '},
+ \ {'text': 'Foo'},
+ \ {'text': '.'},
+ \ {'text': 'def'},
+ \ {'text': ':'},
+ \ {'text': ' '},
+ \ {'text': 'number'},
+ \ ],
+ \ 'documentation': [
+ \ {'text': 'foo'},
+ \ {'text': ' '},
+ \ {'text': 'bar'},
+ \ {'text': ' '},
+ \ {'text': 'baz'},
+ \ ],
+ \ },
+ \ {
+ \ 'name': 'ghi',
+ \ 'kind': 'className',
+ \ 'displayParts': [
+ \ {'text': '('},
+ \ {'text': 'class'},
+ \ {'text': ')'},
+ \ {'text': ' '},
+ \ {'text': 'Foo'},
+ \ ],
+ \ },
+ \ ],
+ \})
+
+Execute(Entries without details should be included in the responses):
+ let b:ale_tsserver_completion_names = [{
+ \ 'word': 'xyz',
+ \ 'source': '/path/to/xyz.ts',
+ \ }]
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'word': 'abc',
+ \ 'menu': 'import { def } from "./Foo"; (property) Foo.abc: number',
+ \ 'info': '',
+ \ 'kind': 'v',
+ \ 'icase': 1,
+ \ 'user_data': json_encode({
+ \ '_ale_completion_item': 1,
+ \ 'code_actions': [{
+ \ 'description': 'import { def } from "./Foo";',
+ \ 'changes': [],
+ \ }],
+ \ }),
+ \ 'dup': g:ale_completion_autoimport,
+ \ },
+ \ {
+ \ 'word': 'def',
+ \ 'menu': '(property) Foo.def: number',
+ \ 'info': 'foo bar baz',
+ \ 'kind': 'v',
+ \ 'icase': 1,
+ \ 'user_data': json_encode({'_ale_completion_item': 1}),
+ \ 'dup': g:ale_completion_autoimport,
+ \ },
+ \ {
+ \ 'word': 'xyz',
+ \ 'menu': '',
+ \ 'info': '',
+ \ 'kind': 'v',
+ \ 'user_data': json_encode({'_ale_completion_item': 1}),
+ \ 'icase': 1,
+ \ },
+ \ ],
+ \ ale#completion#ParseTSServerCompletionEntryDetails({
+ \ 'body': [
+ \ {
+ \ 'name': 'abc',
+ \ 'kind': 'parameterName',
+ \ 'displayParts': [
+ \ {'text': '('},
+ \ {'text': 'property'},
+ \ {'text': ')'},
+ \ {'text': ' '},
+ \ {'text': 'Foo'},
+ \ {'text': '.'},
+ \ {'text': 'abc'},
+ \ {'text': ':'},
+ \ {'text': ' '},
+ \ {'text': 'number'},
+ \ ],
+ \ 'codeActions': [{
+ \ 'description': 'import { def } from "./Foo";',
+ \ 'changes': [],
+ \ }],
+ \ },
+ \ {
+ \ 'name': 'def',
+ \ 'kind': 'parameterName',
+ \ 'displayParts': [
+ \ {'text': '('},
+ \ {'text': 'property'},
+ \ {'text': ')'},
+ \ {'text': ' '},
+ \ {'text': 'Foo'},
+ \ {'text': '.'},
+ \ {'text': 'def'},
+ \ {'text': ':'},
+ \ {'text': ' '},
+ \ {'text': 'number'},
+ \ ],
+ \ 'documentation': [
+ \ {'text': 'foo'},
+ \ {'text': ' '},
+ \ {'text': 'bar'},
+ \ {'text': ' '},
+ \ {'text': 'baz'},
+ \ ],
+ \ },
+ \ ],
+ \})
+
+Execute(Default imports should be handled correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'word': 'abcd',
+ \ 'menu': 'Import default ''abcd'' from module "./foo" (alias) const abcd: 3',
+ \ 'info': '',
+ \ 'kind': 't',
+ \ 'icase': 1,
+ \ 'user_data': json_encode({
+ \ '_ale_completion_item': 1,
+ \ 'code_actions': [{
+ \ 'description': 'Import default ''abcd'' from module "./foo"',
+ \ 'changes': [],
+ \ }],
+ \ }),
+ \ 'dup': g:ale_completion_autoimport,
+ \ },
+ \ ],
+ \ ale#completion#ParseTSServerCompletionEntryDetails({
+ \ 'body': [
+ \ {
+ \ 'name': 'default',
+ \ 'kind': 'alias',
+ \ 'displayParts': [
+ \ {'kind': 'punctuation', 'text': '('},
+ \ {'kind': 'text', 'text': 'alias'},
+ \ {'kind': 'punctuation', 'text': ')'},
+ \ {'kind': 'space', 'text': ' '},
+ \ {'kind': 'keyword', 'text': 'const'},
+ \ {'kind': 'space', 'text': ' '},
+ \ {'kind': 'localName', 'text': 'abcd'},
+ \ {'kind': 'punctuation', 'text': ':'},
+ \ {'kind': 'space', 'text': ' '},
+ \ {'kind': 'stringLiteral', 'text': '3'},
+ \ {'kind': 'lineBreak', 'text': '^@'},
+ \ {'kind': 'keyword', 'text': 'export'},
+ \ {'kind': 'space', 'text': ' '},
+ \ {'kind': 'keyword', 'text': 'default'},
+ \ {'kind': 'space', 'text': ' '},
+ \ {'kind': 'aliasName', 'text': 'abcd'}
+ \ ],
+ \ 'codeActions': [
+ \ {
+ \ 'description': 'Import default ''abcd'' from module "./foo"',
+ \ 'changes': [],
+ \ },
+ \ ],
+ \ },
+ \ ],
+ \ })
diff --git a/sources_non_forked/ale/test/fix/test_ale_fix.vader b/sources_non_forked/ale/test/fix/test_ale_fix.vader
new file mode 100644
index 00000000..6529f6f9
--- /dev/null
+++ b/sources_non_forked/ale/test/fix/test_ale_fix.vader
@@ -0,0 +1,884 @@
+Before:
+ Save g:ale_fixers
+ Save &shell
+ Save g:ale_enabled
+ Save g:ale_fix_on_save
+ Save g:ale_lint_on_save
+ Save g:ale_echo_cursor
+ Save g:ale_command_wrapper
+ Save g:ale_filename_mappings
+
+ silent! cd /testplugin/test/fix
+
+ unlet! b:ale_lint_on_save
+ let g:ale_enabled = 0
+ let g:ale_echo_cursor = 0
+ let g:ale_command_wrapper = ''
+ let g:ale_run_synchronously = 1
+ let g:ale_set_lists_synchronously = 1
+ let g:ale_fix_buffer_data = {}
+ let g:ale_fixers = {
+ \ 'testft': [],
+ \}
+ let g:ale_filename_mappings = {}
+
+ let g:pre_success = 0
+ let g:post_success = 0
+ augroup VaderTest
+ autocmd!
+ autocmd User ALEFixPre let g:pre_success = 1
+ autocmd User ALEFixPost let g:post_success = 1
+ augroup END
+
+ if !has('win32')
+ let &shell = '/bin/bash'
+ endif
+
+ call ale#test#SetDirectory('/testplugin/test')
+ call ale#test#SetFilename('test.txt')
+ call ale#linter#PreventLoading('testft')
+
+ function AddCarets(buffer, lines) abort
+ " map() is applied to the original lines here.
+ " This way, we can ensure that defensive copies are made.
+ return map(a:lines, '''^'' . v:val')
+ endfunction
+
+ function Capitalize(buffer, lines) abort
+ return map(a:lines, 'toupper(v:val)')
+ endfunction
+
+ function DoNothing(buffer, lines) abort
+ return 0
+ endfunction
+
+ function CatLine(buffer, lines) abort
+ return {'command': 'cat - <(echo d)'}
+ endfunction
+
+ function CatLineOneArg(buffer) abort
+ return {'command': 'cat - <(echo d)'}
+ endfunction
+
+ function CatLineDeferred(buffer, lines) abort
+ return ale#command#Run(a:buffer, 'echo', {
+ \ -> ale#command#Run(a:buffer, 'echo', {-> {'command': 'cat - <(echo d)'}})
+ \})
+ endfunction
+
+ function ReplaceWithTempFile(buffer, lines) abort
+ return {'command': 'echo x > %t', 'read_temporary_file': 1}
+ endfunction
+
+ function CatWithTempFile(buffer, lines) abort
+ return {'command': 'cat %t <(echo d)'}
+ endfunction
+
+ function EchoFilename(buffer, lines) abort
+ return {'command': 'echo %s'}
+ endfunction
+
+ function RemoveLastLine(buffer, lines) abort
+ return ['a', 'b']
+ endfunction
+
+ function RemoveLastLineOneArg(buffer) abort
+ return ['a', 'b']
+ endfunction
+
+ function! TestCallback(buffer, output)
+ return [{'lnum': 1, 'col': 1, 'text': 'xxx'}]
+ endfunction
+
+ " echo will output a single blank line, and we should ingore it.
+ function! IgnoredEmptyOutput(buffer, output)
+ return {'command': has('win32') ? 'echo(' : 'echo'}
+ endfunction
+
+ function! EchoLineNoPipe(buffer, output)
+ return {'command': 'echo new line', 'read_buffer': 0}
+ endfunction
+
+ function! SetUpLinters()
+ call ale#linter#Define('testft', {
+ \ 'name': 'testlinter',
+ \ 'callback': 'TestCallback',
+ \ 'executable': 'true',
+ \ 'command': 'true',
+ \})
+ endfunction
+
+ function GetLastMessage()
+ redir => l:output
+ silent mess
+ redir END
+
+ let l:lines = split(l:output, "\n")
+
+ return empty(l:lines) ? '' : l:lines[-1]
+ endfunction
+
+ function! FixWithJSONPostProcessing(buffer) abort
+ let l:ProcessWith = 'JSONPostProcessor'
+
+ " Test with lambdas where support is available.
+ if has('lambda')
+ let l:ProcessWith = {buffer, output -> JSONPostProcessor(buffer, output)}
+ endif
+
+ " Escaping needs to be handled specially for CMD on Windows.
+ let l:json_string = has('win32')
+ \ ? '{"output":["x","y","z"]}'
+ \ : ale#Escape('{"output": ["x", "y", "z"]}')
+
+ return {
+ \ 'command': 'echo ' . l:json_string,
+ \ 'read_buffer': 0,
+ \ 'process_with': l:ProcessWith,
+ \}
+ endfunction
+
+ function! JSONPostProcessor(buffer, output) abort
+ return json_decode(a:output[0]).output
+ endfunction
+
+After:
+ Restore
+ unlet! g:test_filename
+ unlet! g:ale_run_synchronously
+ unlet! g:ale_set_lists_synchronously
+ unlet! g:ale_run_synchronously_callbacks
+ unlet! g:ale_emulate_job_failure
+ unlet! b:ale_fixers
+ unlet! b:ale_lint_on_save
+ unlet! b:ale_fix_on_save
+ unlet! b:ale_quitting
+ delfunction AddCarets
+ delfunction Capitalize
+ delfunction DoNothing
+ delfunction CatLine
+ delfunction CatLineOneArg
+ delfunction CatLineDeferred
+ delfunction ReplaceWithTempFile
+ delfunction CatWithTempFile
+ delfunction EchoFilename
+ delfunction RemoveLastLine
+ delfunction RemoveLastLineOneArg
+ delfunction TestCallback
+ delfunction SetUpLinters
+ delfunction GetLastMessage
+ delfunction IgnoredEmptyOutput
+ delfunction EchoLineNoPipe
+ delfunction FixWithJSONPostProcessing
+ delfunction JSONPostProcessor
+
+ augroup VaderTest
+ autocmd!
+ augroup END
+
+ augroup! VaderTest
+
+ call ale#test#RestoreDirectory()
+
+ call ale#fix#registry#ResetToDefaults()
+ call ale#linter#Reset()
+
+ setlocal buftype=nofile
+
+ if exists('g:test_filename') && filereadable(g:test_filename)
+ call delete(g:test_filename)
+ endif
+
+ call setloclist(0, [])
+
+ let g:ale_fix_buffer_data = {}
+
+ " Clear the messages between tests.
+ echomsg ''
+
+ if !exists('g:ale_command_wrapper')
+ let g:ale_command_wrapper = ''
+ endif
+
+Given testft (A file with three lines):
+ a
+ b
+ c
+
+Execute(ALEFix should complain when there are no functions to call):
+ ALEFix
+ call ale#test#FlushJobs()
+ AssertEqual 'No fixers have been defined. Try :ALEFixSuggest', GetLastMessage()
+
+Execute(ALEFix should not complain when the command is run with a bang):
+ echom 'none'
+
+ ALEFix!
+ call ale#test#FlushJobs()
+ AssertEqual 'none', GetLastMessage()
+
+Execute(ALEFix should apply simple functions):
+ let g:ale_fixers.testft = ['AddCarets']
+ ALEFix
+ call ale#test#FlushJobs()
+
+Expect(The first function should be used):
+ ^a
+ ^b
+ ^c
+
+Execute(Should apply filename mpapings):
+ " The command echos %s, and we'll map the current path so we can check
+ " that ALEFix applies filename mappings, end-to-end.
+ let g:ale_filename_mappings = {
+ \ 'echo_filename': [
+ \ [expand('%:p:h') . '/', '/some/fake/path/'],
+ \ ],
+ \}
+
+ call ale#fix#registry#Add('echo_filename', 'EchoFilename', [], 'echo filename')
+ let g:ale_fixers.testft = ['echo_filename']
+ ALEFix
+ call ale#test#FlushJobs()
+ " Remote trailing whitespace from the line.
+ call setline(1, substitute(getline(1), '[ \r]\+$', '', ''))
+
+Expect(The mapped filename should be printed):
+ /some/fake/path/test.txt
+
+Execute(ALEFix should apply simple functions in a chain):
+ let g:ale_fixers.testft = ['AddCarets', 'Capitalize']
+ ALEFix
+ call ale#test#FlushJobs()
+
+Expect(Both functions should be used):
+ ^A
+ ^B
+ ^C
+
+Execute(ALEFix should allow 0 to be returned to skip functions):
+ let g:ale_fixers.testft = ['DoNothing', 'Capitalize']
+ ALEFix
+ call ale#test#FlushJobs()
+
+Expect(Only the second function should be applied):
+ A
+ B
+ C
+
+Execute(The * fixers shouldn't be used if an empty list is set for fixers):
+ let g:ale_fixers.testft = []
+ let g:ale_fixers['*'] = ['Capitalize']
+ ALEFix
+ call ale#test#FlushJobs()
+
+Expect(Nothing should be changed):
+ a
+ b
+ c
+
+Execute(* fixers should be used if no filetype is matched):
+ let g:ale_fixers = {'*': ['Capitalize']}
+ ALEFix
+ call ale#test#FlushJobs()
+
+Expect(The file should be changed):
+ A
+ B
+ C
+
+Execute(ALEFix should allow commands to be run):
+ if has('win32')
+ " Just skip this test on Windows, we can't run it.
+ call setline(1, ['a', 'b', 'c', 'd'])
+ else
+ let g:ale_fixers.testft = ['CatLine']
+ ALEFix
+ call ale#test#FlushJobs()
+ endif
+
+Expect(An extra line should be added):
+ a
+ b
+ c
+ d
+
+Execute(ALEFix should use fixers passed in commandline when provided):
+ let g:ale_fixers.testft = ['RemoveLastLine']
+ ALEFix AddCarets Capitalize
+ call ale#test#FlushJobs()
+
+Expect(Only fixers passed via command line should be run):
+ ^A
+ ^B
+ ^C
+
+Execute(ALEFix should allow temporary files to be read):
+ if has('win32')
+ " Just skip this test on Windows, we can't run it.
+ call setline(1, ['x'])
+ 2,3d
+ else
+ let g:ale_fixers.testft = ['ReplaceWithTempFile']
+ ALEFix
+ call ale#test#FlushJobs()
+ endif
+
+Expect(The line we wrote to the temporary file should be used here):
+ x
+
+Execute(ALEFix should not read the temporary file when the option is not set):
+ if has('win32')
+ " Just skip this test on Windows, we can't run it.
+ call setline(1, ['a', 'b', 'c', 'd'])
+ else
+ let g:ale_fixers.testft = ['CatWithTempFile']
+ ALEFix
+ call ale#test#FlushJobs()
+ endif
+
+Expect(An extra line should be added):
+ a
+ b
+ c
+ d
+
+Execute(ALEFix should allow jobs and simple functions to be combined):
+ if has('win32')
+ " Just skip this test on Windows, we can't run it.
+ call setline(1, ['X'])
+ 2,3d
+ else
+ let g:ale_fixers.testft = ['ReplaceWithTempFile', 'Capitalize']
+ ALEFix
+ call ale#test#FlushJobs()
+ endif
+
+Expect(The lines from the temporary file should be modified):
+ X
+
+Execute(ALEFix should send lines modified by functions to jobs):
+ if has('win32')
+ " Just skip this test on Windows, we can't run it.
+ call setline(1, ['A', 'B', 'C', 'd'])
+ else
+ let g:ale_fixers.testft = ['Capitalize', 'CatLine']
+ ALEFix
+ call ale#test#FlushJobs()
+ endif
+
+Expect(The lines should first be modified by the function, then the job):
+ A
+ B
+ C
+ d
+
+Execute(ALEFix should skip commands when jobs fail to run):
+ let g:ale_emulate_job_failure = 1
+ let g:ale_fixers.testft = ['CatLine', 'Capitalize']
+ ALEFix
+ call ale#test#FlushJobs()
+
+Expect(Only the second function should be applied):
+ A
+ B
+ C
+
+Execute(ALEFix should handle strings for selecting a single function):
+ let g:ale_fixers.testft = 'AddCarets'
+ ALEFix
+ call ale#test#FlushJobs()
+
+Expect(The first function should be used):
+ ^a
+ ^b
+ ^c
+
+Execute(ALEFix should use functions from the registry):
+ call ale#fix#registry#Add('add_carets', 'AddCarets', [], 'Add some carets')
+ let g:ale_fixers.testft = ['add_carets']
+ ALEFix
+ call ale#test#FlushJobs()
+
+Expect(The registry function should be used):
+ ^a
+ ^b
+ ^c
+
+Execute(ALEFix should be able to remove the last line for files):
+ let g:ale_fixers.testft = ['RemoveLastLine']
+ ALEFix
+ call ale#test#FlushJobs()
+
+Expect(There should be only two lines):
+ a
+ b
+
+Execute(ALEFix should accept funcrefs):
+ let g:ale_fixers.testft = [function('RemoveLastLine')]
+ ALEFix
+ call ale#test#FlushJobs()
+
+Expect(There should be only two lines):
+ a
+ b
+
+Execute(ALEFix should accept lambdas):
+ if has('nvim')
+ " NeoVim 0.1.7 can't interpret lambdas correctly, so just set the lines
+ " to make the test pass.
+ call setline(1, ['a', 'b', 'c', 'd'])
+ else
+ let g:ale_fixers.testft = [{buffer, lines -> lines + ['d']}]
+ ALEFix
+ call ale#test#FlushJobs()
+ endif
+
+Expect(There should be an extra line):
+ a
+ b
+ c
+ d
+
+Execute(ALEFix should user buffer-local fixer settings):
+ let g:ale_fixers.testft = ['AddCarets', 'Capitalize']
+ let b:ale_fixers = {'testft': ['RemoveLastLine']}
+ ALEFix
+ call ale#test#FlushJobs()
+
+Expect(There should be only two lines):
+ a
+ b
+
+Execute(ALEFix should allow Lists to be used for buffer-local fixer settings):
+ let g:ale_fixers.testft = ['AddCarets', 'Capitalize']
+ let b:ale_fixers = ['RemoveLastLine']
+ ALEFix
+ call ale#test#FlushJobs()
+
+Expect(There should be only two lines):
+ a
+ b
+
+Given testft (A file with three lines):
+ a
+ b
+ c
+
+Execute(ALEFix should fix files on the save event):
+ let g:ale_fix_on_save = 1
+ let g:ale_lint_on_save = 1
+ let g:ale_enabled = 1
+
+ let g:test_filename = tempname()
+ execute 'noautocmd silent file ' . fnameescape(g:test_filename)
+ call writefile(getline(1, '$'), g:test_filename)
+
+ let g:ale_fixers.testft = ['Capitalize']
+
+ " We have to set the buftype to empty so the file will be written.
+ setlocal buftype=
+
+ call SetUpLinters()
+ call ale#events#SaveEvent(bufnr(''))
+ call ale#test#FlushJobs()
+
+ " We should save the file.
+ AssertEqual ['A', 'B', 'C'], readfile(g:test_filename)
+ Assert !&modified, 'The file was marked as ''modified'''
+
+ if !has('win32')
+ " We should have run the linter.
+ AssertEqual [{
+ \ 'bufnr': bufnr('%'),
+ \ 'lnum': 1,
+ \ 'vcol': 0,
+ \ 'col': 1,
+ \ 'text': 'xxx',
+ \ 'type': 'E',
+ \ 'nr': -1,
+ \ 'pattern': '',
+ \ 'valid': 1,
+ \}], ale#test#GetLoclistWithoutNewerKeys()
+ endif
+
+Expect(The buffer should be modified):
+ A
+ B
+ C
+
+Given testft (A file with three lines):
+ a
+ b
+ c
+
+Execute(ALEFix should run the linters with b:ale_lint_on_save = 1):
+ let g:ale_fix_on_save = 0
+ let b:ale_fix_on_save = 1
+ let g:ale_lint_on_save = 1
+ let g:ale_enabled = 1
+
+ let g:test_filename = tempname()
+ execute 'noautocmd silent file ' . fnameescape(g:test_filename)
+ call writefile(getline(1, '$'), g:test_filename)
+
+ let g:ale_fixers.testft = ['Capitalize']
+
+ " We have to set the buftype to empty so the file will be written.
+ setlocal buftype=
+
+ call SetUpLinters()
+ call ale#events#SaveEvent(bufnr(''))
+ call ale#test#FlushJobs()
+
+ " We should save the file.
+ AssertEqual ['A', 'B', 'C'], readfile(g:test_filename)
+ Assert !&modified, 'The file was marked as ''modified'''
+
+ if !has('win32')
+ " We should have run the linter.
+ AssertEqual [{
+ \ 'bufnr': bufnr('%'),
+ \ 'lnum': 1,
+ \ 'vcol': 0,
+ \ 'col': 1,
+ \ 'text': 'xxx',
+ \ 'type': 'E',
+ \ 'nr': -1,
+ \ 'pattern': '',
+ \ 'valid': 1,
+ \}], ale#test#GetLoclistWithoutNewerKeys()
+ endif
+
+Expect(The buffer should be modified):
+ A
+ B
+ C
+
+Execute(ALEFix should not fix files on :wq):
+ let g:ale_fix_on_save = 1
+ let g:ale_lint_on_save = 1
+ let g:ale_enabled = 1
+
+ let g:test_filename = tempname()
+ execute 'noautocmd silent file ' . fnameescape(g:test_filename)
+ call writefile(getline(1, '$'), g:test_filename)
+
+ let g:ale_fixers.testft = ['Capitalize']
+
+ " We have to set the buftype to empty so the file will be written.
+ setlocal buftype=
+
+ call ale#events#QuitEvent(bufnr(''))
+
+ call SetUpLinters()
+ call ale#events#SaveEvent(bufnr(''))
+
+ " We should save the file.
+ AssertEqual ['a', 'b', 'c'], readfile(g:test_filename)
+ Assert &modified, 'The was not marked as ''modified'''
+
+ " We should not run the linter.
+ AssertEqual [], ale#test#GetLoclistWithoutNewerKeys()
+
+Expect(The buffer should not be modified):
+ a
+ b
+ c
+
+Given testft (A file with three lines):
+ a
+ b
+ c
+
+Execute(ALEFix should still lint with no linters to be applied):
+ let g:ale_fix_on_save = 1
+ let g:ale_lint_on_save = 1
+ let g:ale_enabled = 1
+
+ let g:test_filename = tempname()
+ execute 'noautocmd silent file ' . fnameescape(g:test_filename)
+
+ let g:ale_fixers.testft = []
+
+ call SetUpLinters()
+ call ale#events#SaveEvent(bufnr(''))
+ call ale#test#FlushJobs()
+
+ Assert !filereadable(g:test_filename), 'The file should not have been saved'
+
+ if !has('win32')
+ " We have run the linter.
+ AssertEqual [{
+ \ 'bufnr': bufnr('%'),
+ \ 'lnum': 1,
+ \ 'vcol': 0,
+ \ 'col': 1,
+ \ 'text': 'xxx',
+ \ 'type': 'E',
+ \ 'nr': -1,
+ \ 'pattern': '',
+ \ 'valid': 1,
+ \}], ale#test#GetLoclistWithoutNewerKeys()
+ endif
+
+Expect(The buffer should be the same):
+ a
+ b
+ c
+
+Execute(ALEFix should still lint when nothing was fixed on save):
+ let g:ale_fix_on_save = 1
+ let g:ale_lint_on_save = 1
+ let g:ale_enabled = 1
+
+ let g:test_filename = tempname()
+ execute 'noautocmd silent file ' . fnameescape(g:test_filename)
+
+ let g:ale_fixers.testft = ['DoNothing']
+
+ call SetUpLinters()
+ call ale#events#SaveEvent(bufnr(''))
+ call ale#test#FlushJobs()
+
+ Assert !filereadable(g:test_filename), 'The file should not have been saved'
+
+ if !has('win32')
+ " We should have run the linter.
+ AssertEqual [{
+ \ 'bufnr': bufnr('%'),
+ \ 'lnum': 1,
+ \ 'vcol': 0,
+ \ 'col': 1,
+ \ 'text': 'xxx',
+ \ 'type': 'E',
+ \ 'nr': -1,
+ \ 'pattern': '',
+ \ 'valid': 1,
+ \}], ale#test#GetLoclistWithoutNewerKeys()
+ endif
+
+Expect(The buffer should be the same):
+ a
+ b
+ c
+
+Execute(ALEFix should not lint the buffer on save if linting on save is disabled globally):
+ let g:ale_fix_on_save = 1
+ let g:ale_lint_on_save = 0
+ let g:ale_enabled = 1
+
+ let g:test_filename = tempname()
+ execute 'noautocmd silent file ' . fnameescape(g:test_filename)
+
+ let g:ale_fixers.testft = ['DoNothing']
+
+ call SetUpLinters()
+ call ale#events#SaveEvent(bufnr(''))
+ call ale#test#FlushJobs()
+
+ Assert !filereadable(g:test_filename), 'The file should not have been saved'
+
+ AssertEqual [], ale#test#GetLoclistWithoutNewerKeys()
+
+Expect(The buffer should be the same):
+ a
+ b
+ c
+
+Execute(ALEFix should not lint the buffer on save if linting on save is disabled locally):
+ let g:ale_fix_on_save = 1
+ let b:ale_lint_on_save = 0
+ let g:ale_enabled = 1
+
+ let g:test_filename = tempname()
+ execute 'noautocmd silent file ' . fnameescape(g:test_filename)
+
+ let g:ale_fixers.testft = ['DoNothing']
+
+ call SetUpLinters()
+ call ale#events#SaveEvent(bufnr(''))
+ call ale#test#FlushJobs()
+
+ Assert !filereadable(g:test_filename), 'The file should not have been saved'
+
+ AssertEqual [], ale#test#GetLoclistWithoutNewerKeys()
+
+Expect(The buffer should be the same):
+ a
+ b
+ c
+
+Given testft (A file with three lines):
+ a
+ b
+ c
+
+Execute(ale#fix#InitBufferData() should set up the correct data):
+ let g:test_filename = tempname()
+ execute 'noautocmd silent file ' . fnameescape(g:test_filename)
+
+ call ale#fix#InitBufferData(bufnr(''), 'save_file')
+
+ AssertEqual {
+ \ bufnr(''): {
+ \ 'temporary_directory_list': [],
+ \ 'done': 0,
+ \ 'lines_before': ['a', 'b', 'c'],
+ \ 'should_save': 1,
+ \ 'ignore_file_changed_errors': 0,
+ \ },
+ \}, g:ale_fix_buffer_data
+
+ call ale#fix#InitBufferData(bufnr(''), '!')
+
+ AssertEqual {
+ \ bufnr(''): {
+ \ 'temporary_directory_list': [],
+ \ 'done': 0,
+ \ 'lines_before': ['a', 'b', 'c'],
+ \ 'should_save': 0,
+ \ 'ignore_file_changed_errors': 1,
+ \ },
+ \}, g:ale_fix_buffer_data
+
+Execute(ALEFix simple functions should be able to accept one argument, the buffer):
+ let g:ale_fixers.testft = ['RemoveLastLineOneArg']
+ ALEFix
+ call ale#test#FlushJobs()
+
+Expect(There should be only two lines):
+ a
+ b
+
+Execute(ALEFix should modify a buffer that is not modifiable, if it becomes modifiable later):
+ let g:ale_fixers.testft = ['RemoveLastLineOneArg']
+
+ set nomodifiable
+ ALEFix
+ call ale#test#FlushJobs()
+ set modifiable
+ call ale#fix#ApplyQueuedFixes(bufnr(''))
+
+Expect(There should be only two lines):
+ a
+ b
+
+Execute(b:ale_fix_on_save = 1 should override g:ale_fix_on_save = 0):
+ let g:ale_fix_on_save = 0
+ let b:ale_fix_on_save = 1
+
+ let g:ale_fixers.testft = ['RemoveLastLineOneArg']
+ call ale#events#SaveEvent(bufnr(''))
+
+Expect(There should be only two lines):
+ a
+ b
+
+Execute(b:ale_fix_on_save = 0 should override g:ale_fix_on_save = 1):
+ let g:ale_fix_on_save = 1
+ let b:ale_fix_on_save = 0
+
+ let g:ale_fixers.testft = ['RemoveLastLineOneArg']
+ call ale#events#SaveEvent(bufnr(''))
+
+Expect(The lines should be the same):
+ a
+ b
+ c
+
+Execute(ALEFix functions returning jobs should be able to accept one argument):
+ if has('win32')
+ " Just skip this test on Windows, we can't run it.
+ call setline(1, ['a', 'b', 'c', 'd'])
+ else
+ let g:ale_fixers.testft = ['CatLine']
+ ALEFix
+ call ale#test#FlushJobs()
+ endif
+
+Expect(An extra line should be added):
+ a
+ b
+ c
+ d
+
+Execute(ALE should print a message telling you something isn't a valid fixer when you type some nonsense):
+ let g:ale_fixers.testft = ['CatLine', 'invalidname']
+ ALEFix
+ call ale#test#FlushJobs()
+
+ AssertEqual 'There is no fixer named `invalidname`. Check :ALEFixSuggest', GetLastMessage()
+
+Execute(ALE should complain about invalid fixers with minuses in the name):
+ let g:ale_fixers.testft = ['foo-bar']
+ ALEFix
+ call ale#test#FlushJobs()
+
+ AssertEqual 'There is no fixer named `foo-bar`. Check :ALEFixSuggest', GetLastMessage()
+
+Execute(ALE should tolerate valid fixers with minuses in the name):
+ let g:ale_fixers.testft = ['prettier-standard']
+ ALEFix
+ call ale#test#FlushJobs()
+
+Execute(Empty output should be ignored):
+ let g:ale_fixers.testft = ['IgnoredEmptyOutput']
+ ALEFix
+ call ale#test#FlushJobs()
+
+Expect(The lines should be the same):
+ a
+ b
+ c
+
+Execute(A temporary file shouldn't be piped into the command when disabled):
+ let g:ale_fixers.testft = ['EchoLineNoPipe']
+ ALEFix
+ call ale#test#FlushJobs()
+
+ AssertEqual
+ \ string(ale#job#PrepareCommand(bufnr(''), 'echo new line')),
+ \ string(ale#history#Get(bufnr(''))[-1].command)
+
+ " Remove trailing whitespace for Windows.
+ if has('win32')
+ %s/[[:space:]]*$//g
+ endif
+
+Expect(The new line should be used):
+ new line
+
+Execute(Post-processing should work):
+ let g:ale_fixers.testft = ['FixWithJSONPostProcessing']
+ ALEFix
+ call ale#test#FlushJobs()
+
+Expect(The lines in the JSON should be used):
+ x
+ y
+ z
+
+Execute(ALEFix should apply autocmds):
+ let g:ale_fixers.testft = ['AddCarets']
+ ALEFix
+ call ale#test#FlushJobs()
+
+ AssertEqual g:pre_success, 1
+ AssertEqual g:post_success, 1
+
+Execute(ALEFix should support ale#command#Run):
+ if has('win32')
+ " Just skip this test on Windows, we can't run it.
+ call setline(1, ['a', 'b', 'c', 'd'])
+ else
+ let g:ale_fixers.testft = ['CatLineDeferred']
+ ALEFix
+ call ale#test#FlushJobs()
+ endif
+
+Expect(The extra line should be added):
+ a
+ b
+ c
+ d
diff --git a/sources_non_forked/ale/test/fix/test_ale_fix_aliases.vader b/sources_non_forked/ale/test/fix/test_ale_fix_aliases.vader
new file mode 100644
index 00000000..d3c47b34
--- /dev/null
+++ b/sources_non_forked/ale/test/fix/test_ale_fix_aliases.vader
@@ -0,0 +1,5 @@
+Execute(prettier-eslint should be aliased):
+ AssertEqual 'ale#fixers#prettier_eslint#Fix', ale#fix#registry#GetFunc('prettier-eslint')
+
+Execute(prettier-standard should be aliased):
+ AssertEqual 'ale#fixers#prettier_standard#Fix', ale#fix#registry#GetFunc('prettier-standard')
diff --git a/sources_non_forked/ale/test/fix/test_ale_fix_completion.vader b/sources_non_forked/ale/test/fix/test_ale_fix_completion.vader
new file mode 100644
index 00000000..6c38bb8d
--- /dev/null
+++ b/sources_non_forked/ale/test/fix/test_ale_fix_completion.vader
@@ -0,0 +1,23 @@
+Execute (List of available fixers is empty):
+ call ale#fix#registry#Clear()
+
+Then (List of applicable fixers for python file is empty):
+ AssertEqual [], ale#fix#registry#GetApplicableFixers('python')
+
+Execute (Add ruby fixer):
+ call ale#fix#registry#Add('ruby_fixer', 'fixer_fun', ['ruby'], 'ruby fixer')
+
+Then (List of applicable fixers for python file is still empty):
+ AssertEqual [], ale#fix#registry#GetApplicableFixers('python')
+
+Execute (Add generic fixer):
+ call ale#fix#registry#Add('generic_fixer', 'fixer_fun', [], 'generic fixer')
+
+Then (Generic fixer should be returned as applicable for python file):
+ AssertEqual ['generic_fixer'], ale#fix#registry#GetApplicableFixers('python')
+
+Execute (Add python fixer):
+ call ale#fix#registry#Add('python_fixer', 'fixer_func', ['python'], 'python fixer')
+
+Then (List of fixers should contain both generic and python fixers):
+ AssertEqual ['generic_fixer', 'python_fixer'], ale#fix#registry#GetApplicableFixers('python')
diff --git a/sources_non_forked/ale/test/fix/test_ale_fix_completion_filter.vader b/sources_non_forked/ale/test/fix/test_ale_fix_completion_filter.vader
new file mode 100644
index 00000000..536b7138
--- /dev/null
+++ b/sources_non_forked/ale/test/fix/test_ale_fix_completion_filter.vader
@@ -0,0 +1,14 @@
+Before:
+ call ale#fix#registry#Clear()
+ call ale#test#SetFilename('test.js')
+ call ale#fix#registry#Add('prettier', '', ['javascript'], 'prettier')
+ call ale#fix#registry#Add('eslint', '', ['javascript'], 'eslint')
+ setfiletype javascript
+
+Execute(completeFixers returns all of the applicable fixers without an arglead):
+ AssertEqual ['eslint', 'prettier'],
+ \ ale#fix#registry#CompleteFixers('', 'ALEFix ', 7)
+
+Execute(completeFixers returns all of the applicable fixers without an arglead):
+ AssertEqual ['prettier'],
+ \ ale#fix#registry#CompleteFixers('pre', 'ALEFix ', 10)
diff --git a/sources_non_forked/ale/test/fix/test_ale_fix_ignore.vader b/sources_non_forked/ale/test/fix/test_ale_fix_ignore.vader
new file mode 100644
index 00000000..5eb9b9ab
--- /dev/null
+++ b/sources_non_forked/ale/test/fix/test_ale_fix_ignore.vader
@@ -0,0 +1,110 @@
+Before:
+ Save g:ale_fixers
+ Save g:ale_fix_on_save
+ Save g:ale_fix_on_save_ignore
+
+ let g:ale_fix_on_save = 1
+ let g:ale_fixers = {'abc': ['a', 'b'], 'xyz': ['c', 'd']}
+ unlet! b:ale_fixers
+ unlet! b:ale_fix_on_save_ignore
+
+ function FixerA(buffer, lines) abort
+ return a:lines + ['a']
+ endfunction
+
+ function FixerB(buffer, lines) abort
+ return a:lines + ['b']
+ endfunction
+
+ function FixerC(buffer, lines) abort
+ return a:lines + ['c']
+ endfunction
+
+ function FixerD(buffer, lines) abort
+ return a:lines + ['d']
+ endfunction
+
+ set filetype=abc.xyz
+ let g:test_filename = tempname()
+ execute 'noautocmd silent file ' . fnameescape(g:test_filename)
+
+ call ale#fix#registry#Add('a', 'FixerA', ['abc'], '')
+ call ale#fix#registry#Add('b', 'FixerB', ['abc'], '')
+ call ale#fix#registry#Add('c', 'FixerC', ['xyz'], '')
+ call ale#fix#registry#Add('d', 'FixerD', ['xyz'], '')
+
+After:
+ Restore
+
+ if exists('g:test_filename') && filereadable(g:test_filename)
+ call delete(g:test_filename)
+ endif
+
+ unlet! b:ale_fixers
+ unlet! b:ale_fix_on_save_ignore
+ unlet! g:test_filename
+
+ delfunction FixerA
+ delfunction FixerB
+ delfunction FixerC
+ delfunction FixerD
+
+ call ale#fix#registry#ResetToDefaults()
+
+Given abc.xyz (An empty file):
+Execute(Ignoring with a filetype in a global Dictionary should work):
+ let g:ale_fix_on_save_ignore = {'abc': ['b'], 'xyz': ['c']}
+
+ call ale#events#SaveEvent(bufnr(''))
+
+ AssertEqual ['', 'a', 'd'], getline(1, '$')
+
+Execute(Ignoring with a filetype in a global List should work):
+ let g:ale_fix_on_save_ignore = ['b', 'c']
+
+ call ale#events#SaveEvent(bufnr(''))
+
+ AssertEqual ['', 'a', 'd'], getline(1, '$')
+
+Execute(Ignoring with a filetype in a local Dictionary should work):
+ let g:ale_fix_on_save_ignore = {'abc': ['b'], 'xyz': ['c']}
+ " The local Dictionary should entirely replace the global one.
+ let b:ale_fix_on_save_ignore = {'abc': ['b']}
+
+ call ale#events#SaveEvent(bufnr(''))
+
+ AssertEqual ['', 'a', 'c', 'd'], getline(1, '$')
+
+Execute(Ignoring with a filetype in a local List should work):
+ let g:ale_fix_on_save_ignore = {'abc': ['b'], 'xyz': ['c']}
+ " The local List should entirely replace the global Dictionary.
+ let b:ale_fix_on_save_ignore = ['b']
+
+ call ale#events#SaveEvent(bufnr(''))
+
+ AssertEqual ['', 'a', 'c', 'd'], getline(1, '$')
+
+Execute(Ignoring functions by reference with a Dictionary should work):
+ let g:ale_fixers = {
+ \ 'abc': [function('FixerA'), function('FixerB')],
+ \ 'xyz': [function('FixerC'), function('FixerD')],
+ \}
+ let b:ale_fix_on_save_ignore = {
+ \ 'abc': [function('FixerB')],
+ \ 'xyz': [function('FixerC')],
+ \}
+
+ call ale#events#SaveEvent(bufnr(''))
+
+ AssertEqual ['', 'a', 'd'], getline(1, '$')
+
+Execute(Ignoring functions by reference with a List should work):
+ let g:ale_fixers = {
+ \ 'abc': [function('FixerA'), function('FixerB')],
+ \ 'xyz': [function('FixerC'), function('FixerD')],
+ \}
+ let b:ale_fix_on_save_ignore = [function('FixerB'), function('FixerC')]
+
+ call ale#events#SaveEvent(bufnr(''))
+
+ AssertEqual ['', 'a', 'd'], getline(1, '$')
diff --git a/sources_non_forked/ale/test/fix/test_ale_fix_suggest.vader b/sources_non_forked/ale/test/fix/test_ale_fix_suggest.vader
new file mode 100644
index 00000000..1100aeed
--- /dev/null
+++ b/sources_non_forked/ale/test/fix/test_ale_fix_suggest.vader
@@ -0,0 +1,102 @@
+Before:
+ call ale#fix#registry#Clear()
+
+ let g:buffer = bufnr('')
+
+ function GetSuggestions()
+ silent ALEFixSuggest
+
+ if bufnr('') != g:buffer
+ let l:lines = getline(1, '$')
+ else
+ let l:lines = []
+ endif
+
+ return l:lines
+ endfunction
+
+After:
+ if bufnr('') != g:buffer
+ :q!
+ endif
+
+ unlet! g:buffer
+
+ call ale#fix#registry#ResetToDefaults()
+ delfunction GetSuggestions
+
+Execute(ALEFixSuggest should return something sensible with no suggestions):
+ AssertEqual
+ \ [
+ \ 'There is nothing in the registry to suggest.',
+ \ '',
+ \ 'Press q to close this window',
+ \ ],
+ \ GetSuggestions()
+
+Execute(ALEFixSuggest should set the appropriate settings):
+ silent ALEFixSuggest
+
+ AssertEqual 'ale-fix-suggest', &filetype
+ Assert !&modified, 'The buffer was marked as modified'
+ Assert !&modifiable, 'The buffer was modifiable'
+
+Execute(ALEFixSuggest output should be correct for only generic handlers):
+ call ale#fix#registry#Add('zed', 'XYZ', [], 'Zedify things.')
+ call ale#fix#registry#Add('alpha', 'XYZ', [], 'Alpha things.')
+
+ AssertEqual
+ \ [
+ \ 'Try the following generic fixers:',
+ \ '',
+ \ '''alpha'' - Alpha things.',
+ \ '''zed'' - Zedify things.',
+ \ '',
+ \ 'See :help ale-fix-configuration',
+ \ '',
+ \ 'Press q to close this window',
+ \ ],
+ \ GetSuggestions()
+
+Execute(ALEFixSuggest output should be correct for only filetype handlers):
+ let &filetype = 'testft2.testft'
+
+ call ale#fix#registry#Add('zed', 'XYZ', ['testft2'], 'Zedify things.')
+ call ale#fix#registry#Add('alpha', 'XYZ', ['testft'], 'Alpha things.')
+
+ AssertEqual
+ \ [
+ \ 'Try the following fixers appropriate for the filetype:',
+ \ '',
+ \ '''alpha'' - Alpha things.',
+ \ '''zed'' - Zedify things.',
+ \ '',
+ \ 'See :help ale-fix-configuration',
+ \ '',
+ \ 'Press q to close this window',
+ \ ],
+ \ GetSuggestions()
+
+Execute(ALEFixSuggest should suggest filetype and generic handlers):
+ let &filetype = 'testft2.testft'
+
+ call ale#fix#registry#Add('zed', 'XYZ', ['testft2'], 'Zedify things.', ['foobar'])
+ call ale#fix#registry#Add('alpha', 'XYZ', ['testft'], 'Alpha things.')
+ call ale#fix#registry#Add('generic', 'XYZ', [], 'Generic things.')
+
+ AssertEqual
+ \ [
+ \ 'Try the following fixers appropriate for the filetype:',
+ \ '',
+ \ '''alpha'' - Alpha things.',
+ \ '''zed'', ''foobar'' - Zedify things.',
+ \ '',
+ \ 'Try the following generic fixers:',
+ \ '',
+ \ '''generic'' - Generic things.',
+ \ '',
+ \ 'See :help ale-fix-configuration',
+ \ '',
+ \ 'Press q to close this window',
+ \ ],
+ \ GetSuggestions()
diff --git a/sources_non_forked/ale/test/fixers/test_appleswiftformat_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_appleswiftformat_fixer_callback.vader
new file mode 100644
index 00000000..72465f4f
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_appleswiftformat_fixer_callback.vader
@@ -0,0 +1,47 @@
+Before:
+ call ale#assert#SetUpFixerTest('swift', 'apple-swift-format')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The swiftformat callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/swift/dummy.swift')
+ let g:ale_swift_appleswiftformat_executable = 'xxxinvalid'
+ let g:ale_swift_appleswiftformat_use_swiftpm = 0
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_swift_appleswiftformat_executable)
+ \ . ' format --in-place %t',
+ \ },
+ \ ale#fixers#appleswiftformat#Fix(bufnr(''))
+
+Execute(The swiftformat callback should return the correct default values and located configuration):
+ call ale#test#SetDirectory('/testplugin/test/test-files/swift/swift-package-project-with-config')
+ call ale#test#SetFilename('src/folder/dummy.swift')
+
+ let g:ale_swift_appleswiftformat_executable = 'xxxinvalid'
+ let g:ale_swift_appleswiftformat_use_swiftpm = 0
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_swift_appleswiftformat_executable)
+ \ . ' format --in-place %t --configuration ' . glob(g:dir . '/.swift-format'),
+ \ },
+ \ ale#fixers#appleswiftformat#Fix(bufnr(''))
+
+ call ale#test#RestoreDirectory()
+
+Execute(The swiftformat callback should use swiftpm is use_swiftpm is set to 1):
+ call ale#test#SetFilename('../test-files/swift/swift-package-project/src/folder/dummy.swift')
+ let g:ale_swift_appleswiftformat_use_swiftpm = 1
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('swift')
+ \ . ' run swift-format format --in-place %t',
+ \ },
+ \ ale#fixers#appleswiftformat#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_astyle_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_astyle_fixer_callback.vader
new file mode 100644
index 00000000..9d2e4c80
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_astyle_fixer_callback.vader
@@ -0,0 +1,96 @@
+Before:
+ Save g:ale_c_astyle_executable
+ Save g:ale_c_astyle_project_options
+ Save g:ale_cpp_astyle_project_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_c_astyle_executable = 'xxxinvalid'
+ let g:ale_cpp_astyle_executable = 'invalidpp'
+ let g:ale_c_astyle_project_options = ''
+ let g:ale_cpp_astyle_project_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The astyle callback should return the correct default values):
+ " Because this file doesn't exist, no astylrc config
+ " exists near it. Therefore, project_options is empty.
+ call ale#test#SetFilename('../c_files/testfile.c')
+ let targetfile = bufname(bufnr('%'))
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_astyle_executable)
+ \ . ' --stdin=' . ale#Escape(targetfile)
+ \ },
+ \ ale#fixers#astyle#Fix(bufnr(''))
+
+Execute(The astyle callback should support cpp files):
+ " Because this file doesn't exist, no astylrc config
+ " exists near it. Therefore, project_options is empty.
+ call ale#test#SetFilename('../cpp_files/dummy.cpp')
+ set filetype=cpp " The test fails without this
+ let targetfile = bufname(bufnr('%'))
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_cpp_astyle_executable)
+ \ . ' --stdin=' . ale#Escape(targetfile)
+ \ },
+ \ ale#fixers#astyle#Fix(bufnr(''))
+
+Execute(The astyle callback should support cpp files with option file set):
+ call ale#test#SetFilename('../cpp_files/dummy.cpp')
+ let g:ale_cpp_astyle_project_options = '.astylerc_cpp'
+ let targetfile = bufname(bufnr('%'))
+ set filetype=cpp " The test fails without this
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('invalidpp')
+ \ . ' --project=' . g:ale_cpp_astyle_project_options
+ \ . ' --stdin=' . ale#Escape(targetfile)
+ \ },
+ \ ale#fixers#astyle#Fix(bufnr(''))
+
+Execute(The astyle callback should return the correct default values with a specified option file):
+ call ale#test#SetFilename('../c_files/testfile.c')
+ let g:ale_c_astyle_project_options = '.astylerc_c'
+ let targetfile = bufname(bufnr('%'))
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' --project=' . g:ale_c_astyle_project_options
+ \ . ' --stdin=' . ale#Escape(targetfile)
+ \ },
+ \ ale#fixers#astyle#Fix(bufnr(''))
+
+Execute(The astyle callback should find nearest default option file _astylrc):
+ call ale#test#SetFilename('../test-files/c/makefile_project/subdir/file.c')
+ let targetfile = bufname(bufnr('%'))
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' --project=_astylerc'
+ \ . ' --stdin=' . ale#Escape(targetfile)
+ \ },
+ \ ale#fixers#astyle#Fix(bufnr(''))
+
+Execute(The astyle callback should find .astylrc in the same directory as src):
+ call ale#test#SetFilename('../test-files/cpp/dummy.cpp')
+ set filetype=cpp " The test fails without this
+ let targetfile = bufname(bufnr('%'))
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('invalidpp')
+ \ . ' --project=.astylerc'
+ \ . ' --stdin=' . ale#Escape(targetfile)
+ \ },
+ \ ale#fixers#astyle#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_autoflake_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_autoflake_fixer_callback.vader
new file mode 100644
index 00000000..91fc62b5
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_autoflake_fixer_callback.vader
@@ -0,0 +1,49 @@
+Before:
+ Save g:ale_python_autoflake_executable
+ Save g:ale_python_autoflake_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_python_autoflake_executable = 'xxxinvalid'
+ let g:ale_python_autoflake_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+ let g:dir = getcwd()
+
+ let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
+
+After:
+ Restore
+
+ unlet! b:bin_dir
+
+ call ale#test#RestoreDirectory()
+
+Execute(The autoflake callback should return the correct default values):
+ AssertEqual
+ \ 0,
+ \ ale#fixers#autoflake#Fix(bufnr(''))
+
+ silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/autoflake'))
+ \ . ' --in-place '
+ \ . ' %t',
+ \ 'read_temporary_file': 1,
+ \ },
+ \ ale#fixers#autoflake#Fix(bufnr(''))
+
+
+Execute(The autoflake callback should include options):
+ let g:ale_python_autoflake_options = '--some-option'
+
+ silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/autoflake'))
+ \ . ' --some-option'
+ \ . ' --in-place '
+ \ . ' %t',
+ \ 'read_temporary_file': 1,
+ \ },
+ \ ale#fixers#autoflake#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_autoimport_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_autoimport_fixer_callback.vader
new file mode 100644
index 00000000..edca5c38
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_autoimport_fixer_callback.vader
@@ -0,0 +1,47 @@
+Before:
+ Save g:ale_python_autoimport_executable
+ Save g:ale_python_autoimport_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_python_autoimport_executable = 'xxxinvalid'
+ let g:ale_python_autoimport_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+ let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
+
+After:
+ Restore
+
+ unlet! b:bin_dir
+
+ call ale#test#RestoreDirectory()
+
+Execute(The autoimport callback should return the correct default values):
+ AssertEqual
+ \ 0,
+ \ ale#fixers#autoimport#Fix(bufnr(''))
+
+ silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
+ AssertEqual
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/autoimport')) . ' -',
+ \ },
+ \ ale#fixers#autoimport#Fix(bufnr(''))
+
+Execute(The autoimport callback should respect custom options):
+ let g:ale_python_autoimport_options = '--multi-line=3 --trailing-comma'
+
+ AssertEqual
+ \ 0,
+ \ ale#fixers#autoimport#Fix(bufnr(''))
+
+ silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
+ AssertEqual
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/autoimport'))
+ \ . ' --multi-line=3 --trailing-comma -',
+ \ },
+ \ ale#fixers#autoimport#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_autopep8_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_autopep8_fixer_callback.vader
new file mode 100644
index 00000000..46671eda
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_autopep8_fixer_callback.vader
@@ -0,0 +1,37 @@
+Before:
+ Save g:ale_python_autopep8_executable
+ Save g:ale_python_autopep8_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_python_autopep8_executable = 'xxxinvalid'
+ let g:ale_python_autopep8_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+ let g:dir = getcwd()
+
+ let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
+
+After:
+ Restore
+
+ unlet! b:bin_dir
+
+ call ale#test#RestoreDirectory()
+
+Execute(The autopep8 callback should return the correct default values):
+ AssertEqual
+ \ 0,
+ \ ale#fixers#autopep8#Fix(bufnr(''))
+
+ silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
+ AssertEqual
+ \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/autopep8')) . ' -'},
+ \ ale#fixers#autopep8#Fix(bufnr(''))
+
+Execute(The autopep8 callback should include options):
+ let g:ale_python_autopep8_options = '--some-option'
+
+ silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
+ AssertEqual
+ \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/autopep8')) . ' --some-option -' },
+ \ ale#fixers#autopep8#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_bibclean_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_bibclean_fixer_callback.vader
new file mode 100644
index 00000000..88412eca
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_bibclean_fixer_callback.vader
@@ -0,0 +1,30 @@
+Before:
+ Save g:ale_bib_bibclean_executable
+ Save g:ale_bib_bibclean_options
+
+ let g:ale_bib_bibclean_executable = 'xxxinvalid'
+ let g:ale_bib_bibclean_options = '-align-equals'
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+ call ale#test#RestoreDirectory()
+
+Execute(The bibclean callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/bib/dummy.bib')
+
+ AssertEqual
+ \ {'command': ale#Escape(g:ale_bib_bibclean_executable) . ' -align-equals'},
+ \ ale#fixers#bibclean#Fix(bufnr(''))
+
+Execute(The bibclean callback should include custom bibclean options):
+ let g:ale_bib_bibclean_options = '-author -check-values'
+ call ale#test#SetFilename('../test-files/bib/dummy.bib')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_bib_bibclean_executable) . ' -author -check-values'
+ \ },
+ \ ale#fixers#bibclean#Fix(bufnr(''))
+
diff --git a/sources_non_forked/ale/test/fixers/test_black_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_black_fixer_callback.vader
new file mode 100644
index 00000000..bb76a1fe
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_black_fixer_callback.vader
@@ -0,0 +1,67 @@
+Before:
+ call ale#assert#SetUpFixerTest('python', 'black')
+
+ let g:dir = getcwd()
+ let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+ unlet! g:dir
+ unlet! b:bin_dir
+
+Execute(The black callback should return the correct default values):
+ silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
+ AssertEqual
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/black')) . ' -'},
+ \ ale#fixers#black#Fix(bufnr(''))
+
+Execute(The black callback should include options):
+ let g:ale_python_black_options = '--some-option'
+ let g:ale_python_black_change_directory = 0
+
+ silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
+ AssertEqual
+ \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/black')) . ' --some-option -' },
+ \ ale#fixers#black#Fix(bufnr(''))
+
+Execute(The black callback should include --pyi for .pyi files):
+ let g:ale_python_black_change_directory = 0
+
+ silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.pyi')
+
+ AssertEqual
+ \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/black')) . ' --pyi -' },
+ \ ale#fixers#black#Fix(bufnr(''))
+
+Execute(The black callback should not concatenate options):
+ let g:ale_python_black_options = '--some-option'
+ let g:ale_python_black_change_directory = 0
+
+ silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.pyi')
+
+ AssertEqual
+ \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/black')) . ' --some-option --pyi -' },
+ \ ale#fixers#black#Fix(bufnr(''))
+
+Execute(Pipenv is detected when python_black_auto_pipenv is set):
+ let g:ale_python_black_auto_pipenv = 1
+ let g:ale_python_black_change_directory = 0
+
+ call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
+
+ AssertEqual
+ \ {'command': ale#Escape('pipenv') . ' run black -'},
+ \ ale#fixers#black#Fix(bufnr(''))
+
+Execute(Poetry is detected when python_black_auto_poetry is set):
+ let g:ale_python_black_auto_poetry = 1
+ let g:ale_python_black_change_directory = 0
+
+ call ale#test#SetFilename('../test-files/python/poetry/whatever.py')
+
+ AssertEqual
+ \ {'command': ale#Escape('poetry') . ' run black -'},
+ \ ale#fixers#black#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_break_up_long_lines_python_fixer.vader b/sources_non_forked/ale/test/fixers/test_break_up_long_lines_python_fixer.vader
new file mode 100644
index 00000000..c7809acd
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_break_up_long_lines_python_fixer.vader
@@ -0,0 +1,39 @@
+Before:
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ call ale#test#RestoreDirectory()
+
+Execute(Long lines with basic function calls should be broken up correctly):
+ AssertEqual
+ \ [
+ \ 'def foo():',
+ \ ' some_variable = this_is_a_longer_function(',
+ \ 'first_argument,',
+ \ ' second_argument,',
+ \ ' third_with_function_call(',
+ \ 'foo,',
+ \ ' bar,',
+ \ '))',
+ \ ],
+ \ ale#fixers#generic_python#BreakUpLongLines(bufnr(''), [
+ \ 'def foo():',
+ \ ' some_variable = this_is_a_longer_function(first_argument, second_argument, third_with_function_call(foo, bar))',
+ \ ])
+
+Execute(Longer lines should be permitted if a configuration file allows it):
+ call ale#test#SetFilename('../test-files/long-line/foo/bar.py')
+
+ AssertEqual
+ \ [
+ \ 'x = this_line_is_between_79_and_90_characters(first, second, third, fourth, fifth)',
+ \ 'y = this_line_is_longer_than_90_characters(',
+ \ 'much_longer_word,',
+ \ ' another_longer_word,',
+ \ ' a_third_long_word,',
+ \ ')'
+ \ ],
+ \ ale#fixers#generic_python#BreakUpLongLines(bufnr(''), [
+ \ 'x = this_line_is_between_79_and_90_characters(first, second, third, fourth, fifth)',
+ \ 'y = this_line_is_longer_than_90_characters(much_longer_word, another_longer_word, a_third_long_word)',
+ \ ])
diff --git a/sources_non_forked/ale/test/fixers/test_brittany_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_brittany_fixer_callback.vader
new file mode 100644
index 00000000..073e368c
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_brittany_fixer_callback.vader
@@ -0,0 +1,24 @@
+Before:
+ Save g:ale_haskell_brittany_executable
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_haskell_brittany_executable = 'xxxinvalid'
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The brittany callback should return the correct default values):
+ call ale#test#SetFilename('../haskell_files/testfile.hs')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' --write-mode inplace'
+ \ . ' %t',
+ \ },
+ \ ale#fixers#brittany#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_buf_format_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_buf_format_fixer_callback.vader
new file mode 100644
index 00000000..ee484820
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_buf_format_fixer_callback.vader
@@ -0,0 +1,21 @@
+Before:
+ Save g:ale_proto_buf_format_executable
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_proto_buf_format_executable = 'xxxinvalid'
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The buf-format callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/proto/testfile.proto')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid') . ' format %t',
+ \ },
+ \ ale#fixers#buf_format#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_buildifier_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_buildifier_fixer_callback.vader
new file mode 100644
index 00000000..f82e8e6e
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_buildifier_fixer_callback.vader
@@ -0,0 +1,29 @@
+Before:
+ let g:ale_bazel_buildifier_options = ''
+ call ale#assert#SetUpFixerTest('bzl', 'buildifier')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The buildifier callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/bazel/WORKSPACE')
+
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape(g:ale_bazel_buildifier_executable)
+ \ . ' -mode fix -lint fix -path '
+ \ . ale#Escape(ale#test#GetFilename('../test-files/bazel/WORKSPACE'))
+ \ . ' -'
+ \ }
+
+Execute(The buildifier callback should include any additional options):
+ call ale#test#SetFilename('../test-files/bazel/WORKSPACE')
+ let g:ale_bazel_buildifier_options = '--some-option'
+
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape(g:ale_bazel_buildifier_executable)
+ \ . ' -mode fix -lint fix -path '
+ \ . ale#Escape(ale#test#GetFilename('../test-files/bazel/WORKSPACE'))
+ \ . ' --some-option -'
+ \ }
diff --git a/sources_non_forked/ale/test/fixers/test_clangformat_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_clangformat_fixer_callback.vader
new file mode 100644
index 00000000..130ca7f7
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_clangformat_fixer_callback.vader
@@ -0,0 +1,64 @@
+Before:
+ Save g:ale_c_clangformat_executable
+ Save g:c_clangformat_style_option
+ Save g:c_clangformat_use_local_file
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_c_clangformat_executable = 'xxxinvalid'
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+ let g:dir = getcwd()
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The clang-format callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/c/dummy.c')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_clangformat_executable)
+ \ . ' --assume-filename=' . ale#Escape(bufname(bufnr('')))
+ \ },
+ \ ale#fixers#clangformat#Fix(bufnr(''))
+
+Execute(The clangformat callback should include any additional options):
+ call ale#test#SetFilename('../test-files/c/dummy.c')
+ let g:ale_c_clangformat_options = '--some-option'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_clangformat_executable)
+ \ . ' --assume-filename=' . ale#Escape(bufname(bufnr('')))
+ \ . ' --some-option',
+ \ },
+ \ ale#fixers#clangformat#Fix(bufnr(''))
+
+Execute(The clangformat callback should include style options as well):
+ call ale#test#SetFilename('../test-files/c/dummy.c')
+ let g:ale_c_clangformat_options = '--some-option'
+ let g:ale_c_clangformat_style_option = '{BasedOnStyle: Microsoft, ColumnLimit:80,}'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_clangformat_executable)
+ \ . ' --assume-filename=' . ale#Escape(bufname(bufnr('')))
+ \ . ' --some-option' . " -style='{BasedOnStyle: Microsoft, ColumnLimit:80,}'",
+ \ },
+ \ ale#fixers#clangformat#Fix(bufnr(''))
+
+Execute(The clangformat callback should use local file instead of style options):
+ call ale#test#SetFilename('../test-files/clangformat/with_clangformat/dummy.c')
+ let g:ale_c_clangformat_options = '--some-option'
+ let g:ale_c_clangformat_style_option = '{BasedOnStyle: Microsoft, ColumnLimit:80,}'
+ let g:ale_c_clangformat_use_local_file = 1
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_clangformat_executable)
+ \ . ' --assume-filename=' . ale#Escape(bufname(bufnr('')))
+ \ . ' --some-option' . ' -style=file',
+ \ },
+ \ ale#fixers#clangformat#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_clangtidy_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_clangtidy_fixer_callback.vader
new file mode 100644
index 00000000..d6678bd9
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_clangtidy_fixer_callback.vader
@@ -0,0 +1,47 @@
+Before:
+ Save g:ale_c_build_dir
+ Save g:ale_c_clangtidy_executable
+ Save g:ale_c_clangtidy_checks
+ Save g:ale_c_clangtidy_extra_options
+ Save g:ale_cpp_clangtidy_executable
+ Save g:ale_cpp_clangtidy_checks
+ Save g:ale_cpp_clangtidy_extra_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_c_clangtidy_executable = 'xxxinvalid'
+ let g:ale_c_clangtidy_checks = []
+ let g:ale_c_clangtidy_extra_options = ''
+ let g:ale_cpp_clangtidy_executable = 'xxxinvalidpp'
+ let g:ale_cpp_clangtidy_checks = []
+ let g:ale_cpp_clangtidy_extra_options = ''
+ let g:ale_c_build_dir = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The clangtidy callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/c/dummy.c')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_c_clangtidy_executable)
+ \ . ' -fix -fix-errors %t'
+ \ },
+ \ ale#fixers#clangtidy#Fix(bufnr(''))
+
+Execute(The clangtidy callback should include any additional options):
+ call ale#test#SetFilename('../test-files/c/dummy.c')
+ let g:ale_c_clangtidy_extra_options = '--some-option'
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_c_clangtidy_executable)
+ \ . ' -fix -fix-errors --some-option %t',
+ \ },
+ \ ale#fixers#clangtidy#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_cmakeformat_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_cmakeformat_fixer_callback.vader
new file mode 100644
index 00000000..545fe067
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_cmakeformat_fixer_callback.vader
@@ -0,0 +1,36 @@
+Before:
+ Save g:ale_cmake_cmakeformat_executable
+ Save g:ale_cmake_cmakeformat_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_cmake_cmakeformat_executable = 'xxxinvalid'
+ let g:ale_cmake_cmakeformat_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The cmakeformat callback should return the correct default values):
+ call ale#test#SetFilename('../cmake_files/CMakeList.txt')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' -'
+ \ },
+ \ ale#fixers#cmakeformat#Fix(bufnr(''))
+
+Execute(The cmakeformat callback should include custom cmakeformat options):
+ let g:ale_cmake_cmakeformat_options = "-r '(a) -> a'"
+ call ale#test#SetFilename('../cmake_files/CMakeList.txt')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' ' . g:ale_cmake_cmakeformat_options
+ \ . ' -',
+ \ },
+ \ ale#fixers#cmakeformat#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_crystal_format_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_crystal_format_fixer_callback.vader
new file mode 100644
index 00000000..d7d9588b
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_crystal_format_fixer_callback.vader
@@ -0,0 +1,33 @@
+Before:
+ Save g:ale_crystal_format_executable
+ Save g:ale_crystal_format_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_crystal_format_executable = 'xxxinvalid'
+ let g:ale_crystal_format_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The crystal format callback should return the correct default values):
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid') . ' tool format -',
+ \ },
+ \ ale#fixers#crystal#Fix(bufnr(''))
+
+Execute(The crystal format callback should include custom options):
+ let g:ale_crystal_format_options = "-list=true"
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' tool format ' . g:ale_crystal_format_options
+ \ . ' -',
+ \ },
+ \ ale#fixers#crystal#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_dart_format_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_dart_format_fixer_callback.vader
new file mode 100644
index 00000000..8dfd20b6
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_dart_format_fixer_callback.vader
@@ -0,0 +1,40 @@
+Before:
+ Save g:ale_dart_format_executable
+ Save g:ale_dart_format_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_dart_format_executable = 'xxxinvalid'
+ let g:ale_dart_format_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The dart format callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/dart/testfile.dart')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' format'
+ \ . ' %t',
+ \ },
+ \ ale#fixers#dart_format#Fix(bufnr(''))
+
+Execute(The dart format callback should include custom dart format options):
+ let g:ale_dart_format_options = "-l 80"
+ call ale#test#SetFilename('../test-files/dart/testfile.dart')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' format'
+ \ . ' ' . g:ale_dart_format_options
+ \ . ' %t',
+ \ },
+ \ ale#fixers#dart_format#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_dartfmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_dartfmt_fixer_callback.vader
new file mode 100644
index 00000000..c783c9a4
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_dartfmt_fixer_callback.vader
@@ -0,0 +1,40 @@
+Before:
+ Save g:ale_dart_dartfmt_executable
+ Save g:ale_dart_dartfmt_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_dart_dartfmt_executable = 'xxxinvalid'
+ let g:ale_dart_dartfmt_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The dartfmt callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/dart/testfile.dart')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' -w'
+ \ . ' %t',
+ \ },
+ \ ale#fixers#dartfmt#Fix(bufnr(''))
+
+Execute(The dartfmt callback should include custom dartfmt options):
+ let g:ale_dart_dartfmt_options = "-l 80"
+ call ale#test#SetFilename('../test-files/dart/testfile.dart')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' -w'
+ \ . ' ' . g:ale_dart_dartfmt_options
+ \ . ' %t',
+ \ },
+ \ ale#fixers#dartfmt#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_dfmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_dfmt_fixer_callback.vader
new file mode 100644
index 00000000..5749224e
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_dfmt_fixer_callback.vader
@@ -0,0 +1,40 @@
+Before:
+ Save g:ale_d_dfmt_executable
+ Save g:ale_d_dfmt_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_d_dfmt_executable = 'xxxinvalid'
+ let g:ale_d_dfmt_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The dfmt callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/d/test.d')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' -i'
+ \ . ' %t',
+ \ },
+ \ ale#fixers#dfmt#Fix(bufnr(''))
+
+Execute(The dfmt callback should include custom dfmt options):
+ let g:ale_d_dfmt_options = "--space-after-cast"
+ call ale#test#SetFilename('../test-files/d/test.d')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' -i'
+ \ . ' ' . g:ale_d_dfmt_options
+ \ . ' %t',
+ \ },
+ \ ale#fixers#dfmt#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_dhall_format_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_dhall_format_fixer_callback.vader
new file mode 100644
index 00000000..8fa2fe7c
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_dhall_format_fixer_callback.vader
@@ -0,0 +1,22 @@
+Before:
+ Save g:ale_dhall_executable
+ Save g:ale_dhall_options
+
+ " Use an invalid global executable, so we don’t match it.
+ let g:ale_dhall_executable = 'odd-dhall'
+ let g:ale_dhall_options = '--ascii'
+
+ call ale#assert#SetUpFixerTest('dhall', 'dhall-format')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The dhall-format callback should return the correct options):
+ call ale#test#SetFilename('../dhall_files/testfile.dhall')
+
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape('odd-dhall')
+ \ . ' --ascii'
+ \ . ' format'
+ \ }
diff --git a/sources_non_forked/ale/test/fixers/test_dhall_freeze_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_dhall_freeze_fixer_callback.vader
new file mode 100644
index 00000000..02473697
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_dhall_freeze_fixer_callback.vader
@@ -0,0 +1,22 @@
+Before:
+ Save g:ale_dhall_executable
+ Save g:ale_dhall_options
+
+ " Use an invalid global executable, so we don’t match it.
+ let g:ale_dhall_executable = 'odd-dhall'
+ let g:ale_dhall_options = '--ascii'
+ let g:ale_dhall_freeze_options = '--all'
+
+ call ale#assert#SetUpFixerTest('dhall', 'dhall-freeze')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The dhall-freeze callback should return the correct options):
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape('odd-dhall')
+ \ . ' --ascii'
+ \ . ' freeze'
+ \ . ' --all'
+ \ }
diff --git a/sources_non_forked/ale/test/fixers/test_dhall_lint_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_dhall_lint_fixer_callback.vader
new file mode 100644
index 00000000..e2054eb0
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_dhall_lint_fixer_callback.vader
@@ -0,0 +1,20 @@
+Before:
+ Save g:ale_dhall_executable
+ Save g:ale_dhall_options
+
+ " Use an invalid global executable, so we don’t match it.
+ let g:ale_dhall_executable = 'odd-dhall'
+ let g:ale_dhall_options = '--ascii'
+
+ call ale#assert#SetUpFixerTest('dhall', 'dhall-lint')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The dhall-lint callback should return the correct options):
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape('odd-dhall')
+ \ . ' --ascii'
+ \ . ' lint'
+ \ }
diff --git a/sources_non_forked/ale/test/fixers/test_dotnet_format_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_dotnet_format_fixer_callback.vader
new file mode 100644
index 00000000..a3993573
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_dotnet_format_fixer_callback.vader
@@ -0,0 +1,41 @@
+Before:
+ Save g:ale_cs_dotnet_format_executable
+ Save g:ale_cs_dotnet_format_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_cs_dotnet_format_executable = 'xxxinvalid'
+ let g:ale_cs_dotnet_format_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The dotnet format callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/cs/testfile.cs')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' format'
+ \ . ' --folder --include %t "$(dirname %t)"',
+ \ },
+ \ ale#fixers#dotnet_format#Fix(bufnr(''))
+
+Execute(The dotnet format callback should include custom dotnet format options):
+ let g:ale_cs_dotnet_format_options = "-l 80"
+ call ale#test#SetFilename('../test-files/cs/testfile.cs')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' format'
+ \ . ' ' . g:ale_cs_dotnet_format_options
+ \ . ' --folder --include %t "$(dirname %t)"',
+ \ },
+ \ ale#fixers#dotnet_format#Fix(bufnr(''))
+
diff --git a/sources_non_forked/ale/test/fixers/test_dprint_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_dprint_fixer_callback.vader
new file mode 100644
index 00000000..6a9d0118
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_dprint_fixer_callback.vader
@@ -0,0 +1,44 @@
+Before:
+ call ale#assert#SetUpFixerTest('typescript', 'dprint')
+ call ale#test#SetFilename('../test-files/dprint/blank.ts')
+ let g:ale_dprint_executable_override = 0
+ let g:ale_dprint_executable = 'dprint'
+ let g:ale_dprint_config = ''
+
+After:
+ Restore
+ call ale#assert#TearDownFixerTest()
+
+Execute(The dprint callback should return 0 for a non-existent executable):
+ let g:ale_dprint_executable = 'foo'
+ AssertFixer 0
+
+Execute(The dprint callback should return the correct default values):
+ let g:ale_dprint_executable_override = 1
+ AssertFixer {
+ \ 'command': ale#Escape('dprint')
+ \ . ' fmt '
+ \ . ' --stdin %s'
+ \ }
+
+Execute(The dprint callback should include config):
+ let g:ale_dprint_executable_override = 1
+ let g:ale_dprint_config = 'dprint.json'
+
+ AssertFixer {
+ \ 'command': ale#Escape('dprint')
+ \ . ' fmt '
+ \ . ' -c '
+ \ . ale#Escape((has('win32') ? 'C:\testplugin\test\test-files\dprint\dprint.json' : '/testplugin/test/test-files/dprint/dprint.json'))
+ \ . ' --stdin %s'
+ \ }
+
+Execute(The dprint callback should include custom options):
+ let g:ale_dprint_executable_override = 1
+ let g:ale_dprint_options = '--verbose'
+
+ AssertFixer {
+ \ 'command': ale#Escape('dprint')
+ \ . ' fmt '
+ \ . '--verbose' . ' --stdin %s'
+ \ }
diff --git a/sources_non_forked/ale/test/fixers/test_elm_format_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_elm_format_fixer_callback.vader
new file mode 100644
index 00000000..35244737
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_elm_format_fixer_callback.vader
@@ -0,0 +1,74 @@
+Before:
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ unlet! b:ale_elm_format_executable
+ unlet! b:ale_elm_format_use_global
+ unlet! b:ale_elm_format_options
+
+ call ale#test#RestoreDirectory()
+
+Execute(The elm-format command should have default params):
+ call ale#test#SetFilename('../test-files/elm/src/subdir/testfile.elm')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command':
+ \ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/elm/node_modules/.bin/elm-format'))
+ \ . ' %t --yes',
+ \ },
+ \ ale#fixers#elm_format#Fix(bufnr(''))
+
+Execute(The elm-format command should manage use_global = 1 param):
+ call ale#test#SetFilename('../test-files/elm/src/subdir/testfile.elm')
+ let b:ale_elm_format_use_global = 1
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command':
+ \ ale#Escape('elm-format')
+ \ . ' %t --yes',
+ \ },
+ \ ale#fixers#elm_format#Fix(bufnr(''))
+
+Execute(The elm-format command should manage executable param):
+ call ale#test#SetFilename('../test-files/elm/src/subdir/testfile.elm')
+ let b:ale_elm_format_use_global = 1
+ let b:ale_elm_format_executable = 'elmformat'
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command':
+ \ ale#Escape('elmformat')
+ \ . ' %t --yes',
+ \ },
+ \ ale#fixers#elm_format#Fix(bufnr(''))
+
+Execute(The elm-format command should manage empty options):
+ call ale#test#SetFilename('../test-files/elm/src/subdir/testfile.elm')
+ let b:ale_elm_format_options = ''
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command':
+ \ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/elm/node_modules/.bin/elm-format'))
+ \ . ' %t',
+ \ },
+ \ ale#fixers#elm_format#Fix(bufnr(''))
+
+Execute(The elm-format command should manage custom options):
+ call ale#test#SetFilename('../test-files/elm/src/subdir/testfile.elm')
+ let b:ale_elm_format_options = '--param1 --param2'
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command':
+ \ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/elm/node_modules/.bin/elm-format'))
+ \ . ' %t --param1 --param2',
+ \ },
+ \ ale#fixers#elm_format#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_erblint_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_erblint_fixer_callback.vader
new file mode 100644
index 00000000..7b56e3a9
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_erblint_fixer_callback.vader
@@ -0,0 +1,55 @@
+Before:
+ Save g:ale_eruby_erblint_executable
+ Save g:ale_eruby_erblint_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_eruby_erblint_executable = 'xxxinvalid'
+ let g:ale_eruby_erblint_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The erblint callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/eruby/dummy.html.erb')
+
+ AssertEqual
+ \ {
+ \ 'process_with': 'ale#fixers#erblint#PostProcess',
+ \ 'command': ale#Escape(g:ale_eruby_erblint_executable)
+ \ . ' --autocorrect --stdin %s',
+ \ },
+ \ ale#fixers#erblint#Fix(bufnr(''))
+
+Execute(The erblint callback should include custom erblint options):
+ let g:ale_eruby_erblint_options = '--lint-all'
+ call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')
+
+ AssertEqual
+ \ {
+ \ 'process_with': 'ale#fixers#erblint#PostProcess',
+ \ 'command': ale#Escape(g:ale_eruby_erblint_executable)
+ \ . ' --lint-all'
+ \ . ' --autocorrect --stdin %s',
+ \ },
+ \ ale#fixers#erblint#Fix(bufnr(''))
+
+Execute(The erblint post-processor should remove diagnostics content):
+ AssertEqual
+ \ [
+ \ '',
+ \ '',
+ \ '
',
+ \ ],
+ \ ale#fixers#erblint#PostProcess(bufnr(''), [
+ \ 'Linting 1 files with 11 autocorrectable linters...',
+ \ '',
+ \ '1 error(s) corrected in ERB files',
+ \ '================ /home/user/demo.html.erb ==================',
+ \ '',
+ \ '',
+ \ '
',
+ \ ])
diff --git a/sources_non_forked/ale/test/fixers/test_erlfmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_erlfmt_fixer_callback.vader
new file mode 100644
index 00000000..132cd6ee
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_erlfmt_fixer_callback.vader
@@ -0,0 +1,25 @@
+Before:
+ Save b:ale_elm_format_executable
+ Save b:ale_elm_format_options
+
+ let b:ale_elm_format_executable = 'erlfmt'
+ let b:ale_elm_format_options = ''
+
+After:
+ Restore
+
+Execute(The erlfmt command should handle empty options):
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('erlfmt') . ' %s'
+ \ },
+ \ ale#fixers#erlfmt#Fix(bufnr(''))
+
+Execute(The erlfmt command should handle custom options):
+ let b:ale_erlang_erlfmt_options = '--insert-pragma'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('erlfmt') . ' --insert-pragma %s'
+ \ },
+ \ ale#fixers#erlfmt#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_eslint_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_eslint_fixer_callback.vader
new file mode 100644
index 00000000..4a1dc47c
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_eslint_fixer_callback.vader
@@ -0,0 +1,339 @@
+Before:
+ call ale#assert#SetUpFixerTest('javascript', 'eslint')
+ Save g:ale_command_wrapper
+
+ runtime autoload/ale/handlers/eslint.vim
+
+ let g:ale_command_wrapper = ''
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The executable path should be correct):
+ call ale#test#SetFilename('../test-files/eslint/react-app/subdir/testfile.js')
+
+ " eslint_d output with an older eslint version is used here.
+ GivenCommandOutput ['v4.4.1 (eslint_d v5.1.0)']
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/react-app'),
+ \ 'command': (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js'))
+ \ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/.eslintrc.js'))
+ \ . ' --fix %t',
+ \ }
+
+Execute(The ESLint fixer shouldn't run if no configuration file can be found):
+ call ale#test#SetFilename('../no-configuration')
+ AssertFixerNotExecuted
+
+Execute(The ESLint fixer should use a config file option if set for old versions):
+ call ale#test#SetFilename('../no-configuration')
+ let b:ale_javascript_eslint_options = '-c /foo.cfg'
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'cwd': '',
+ \ 'command': ale#Escape('eslint') . ' -c /foo.cfg --fix %t',
+ \ }
+
+ let b:ale_javascript_eslint_options = '--bar -c /foo.cfg'
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'cwd': '',
+ \ 'command': ale#Escape('eslint') . ' --bar -c /foo.cfg --fix %t',
+ \ }
+
+ let b:ale_javascript_eslint_options = '--config /foo.cfg'
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'cwd': '',
+ \ 'command': ale#Escape('eslint') . ' --config /foo.cfg --fix %t',
+ \ }
+
+ let b:ale_javascript_eslint_options = '--bar --config /foo.cfg'
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'cwd': '',
+ \ 'command': ale#Escape('eslint') . ' --bar --config /foo.cfg --fix %t',
+ \ }
+
+Execute(The ESLint fixer should use a -c file option if set for eslint_d):
+ let b:ale_javascript_eslint_executable = '/bin/eslint_d'
+ GivenCommandOutput ['v3.19.0 (eslint_d v4.2.0)']
+ call ale#test#SetFilename('../no-configuration')
+ let b:ale_javascript_eslint_options = '-c /foo.cfg'
+
+ AssertFixer
+ \ {
+ \ 'process_with': 'ale#fixers#eslint#ProcessEslintDOutput',
+ \ 'cwd': '',
+ \ 'command': ale#Escape('/bin/eslint_d')
+ \ . ' -c /foo.cfg'
+ \ . ' --stdin-filename %s --stdin --fix-to-stdout'
+ \ }
+
+ let b:ale_javascript_eslint_options = '--bar -c /foo.cfg'
+
+ AssertFixer
+ \ {
+ \ 'process_with': 'ale#fixers#eslint#ProcessEslintDOutput',
+ \ 'cwd': '',
+ \ 'command': ale#Escape('/bin/eslint_d')
+ \ . ' --bar -c /foo.cfg'
+ \ . ' --stdin-filename %s --stdin --fix-to-stdout'
+ \ }
+
+ let b:ale_javascript_eslint_options = '--config /foo.cfg'
+
+ AssertFixer
+ \ {
+ \ 'process_with': 'ale#fixers#eslint#ProcessEslintDOutput',
+ \ 'cwd': '',
+ \ 'command': ale#Escape('/bin/eslint_d')
+ \ . ' --config /foo.cfg'
+ \ . ' --stdin-filename %s --stdin --fix-to-stdout'
+ \ }
+
+ let b:ale_javascript_eslint_options = '--bar --config /foo.cfg'
+
+ AssertFixer
+ \ {
+ \ 'process_with': 'ale#fixers#eslint#ProcessEslintDOutput',
+ \ 'cwd': '',
+ \ 'command': ale#Escape('/bin/eslint_d')
+ \ . ' --bar --config /foo.cfg'
+ \ . ' --stdin-filename %s --stdin --fix-to-stdout'
+ \ }
+
+Execute(The ESLint fixer should use a config file option if set for new versions):
+ GivenCommandOutput ['4.9.0']
+ call ale#test#SetFilename('../no-configuration')
+ let b:ale_javascript_eslint_options = '-c /foo.cfg'
+
+ AssertFixer
+ \ {
+ \ 'process_with': 'ale#fixers#eslint#ProcessFixDryRunOutput',
+ \ 'cwd': '',
+ \ 'command': ale#Escape('eslint')
+ \ . ' -c /foo.cfg'
+ \ . ' --stdin-filename %s --stdin --fix-dry-run --format=json'
+ \ }
+
+ let b:ale_javascript_eslint_options = '--bar -c /foo.cfg'
+
+ AssertFixer
+ \ {
+ \ 'process_with': 'ale#fixers#eslint#ProcessFixDryRunOutput',
+ \ 'cwd': '',
+ \ 'command': ale#Escape('eslint')
+ \ . ' --bar -c /foo.cfg'
+ \ . ' --stdin-filename %s --stdin --fix-dry-run --format=json'
+ \ }
+
+ let b:ale_javascript_eslint_options = '--config /foo.cfg'
+
+ AssertFixer
+ \ {
+ \ 'process_with': 'ale#fixers#eslint#ProcessFixDryRunOutput',
+ \ 'cwd': '',
+ \ 'command': ale#Escape('eslint')
+ \ . ' --config /foo.cfg'
+ \ . ' --stdin-filename %s --stdin --fix-dry-run --format=json'
+ \ }
+
+ let b:ale_javascript_eslint_options = '--bar --config /foo.cfg'
+
+ AssertFixer
+ \ {
+ \ 'process_with': 'ale#fixers#eslint#ProcessFixDryRunOutput',
+ \ 'cwd': '',
+ \ 'command': ale#Escape('eslint')
+ \ . ' --bar --config /foo.cfg'
+ \ . ' --stdin-filename %s --stdin --fix-dry-run --format=json'
+ \ }
+
+Execute(The lower priority configuration file in a nested directory should be preferred):
+ call ale#test#SetFilename('../test-files/eslint/react-app/subdir-with-config/testfile.js')
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/react-app'),
+ \ 'command': (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js'))
+ \ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/subdir-with-config/.eslintrc'))
+ \ . ' --fix %t',
+ \ }
+
+Execute(--config in options should override configuration file detection for old versions):
+ call ale#test#SetFilename('../test-files/eslint/react-app/subdir-with-config/testfile.js')
+
+ let b:ale_javascript_eslint_options = '--config /foo.cfg'
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/react-app'),
+ \ 'command': (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js'))
+ \ . ' --config /foo.cfg'
+ \ . ' --fix %t',
+ \ }
+
+ let b:ale_javascript_eslint_options = '-c /foo.cfg'
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/react-app'),
+ \ 'command': (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js'))
+ \ . ' -c /foo.cfg'
+ \ . ' --fix %t',
+ \ }
+
+Execute(package.json should be used as a last resort):
+ call ale#test#SetFilename('../test-files/eslint/react-app/subdir-with-package-json/testfile.js')
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/react-app'),
+ \ 'command': (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js'))
+ \ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/.eslintrc.js'))
+ \ . ' --fix %t',
+ \ }
+
+ call ale#test#SetFilename('../test-files/eslint/package.json')
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint'),
+ \ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/node_modules/.bin/eslint'))
+ \ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/package.json'))
+ \ . ' --fix %t',
+ \ }
+
+Execute(The version check should be correct):
+ call ale#test#SetFilename('../test-files/eslint/react-app/subdir-with-config/testfile.js')
+
+ " We should run the command to get the version the first time.
+ GivenCommandOutput ['4.9.0']
+ AssertFixer [
+ \ (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js'))
+ \ . ' --version',
+ \ {
+ \ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/react-app'),
+ \ 'command': (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js'))
+ \ . ' --stdin-filename %s --stdin --fix-dry-run --format=json',
+ \ 'process_with': 'ale#fixers#eslint#ProcessFixDryRunOutput',
+ \ },
+ \]
+
+ AssertFixer [
+ \ {
+ \ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/react-app'),
+ \ 'command': (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js'))
+ \ . ' --stdin-filename %s --stdin --fix-dry-run --format=json',
+ \ 'process_with': 'ale#fixers#eslint#ProcessFixDryRunOutput',
+ \ },
+ \]
+
+Execute(--fix-dry-run should be used for 4.9.0 and up):
+ call ale#test#SetFilename('../test-files/eslint/react-app/subdir/testfile.js')
+
+ GivenCommandOutput ['4.9.0']
+ AssertFixer
+ \ {
+ \ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/react-app'),
+ \ 'command': (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js'))
+ \ . ' --stdin-filename %s --stdin --fix-dry-run --format=json',
+ \ 'process_with': 'ale#fixers#eslint#ProcessFixDryRunOutput',
+ \ }
+
+Execute(--fix-to-stdout should be used for eslint_d):
+ call ale#test#SetFilename('../test-files/eslint/app-with-eslint-d/testfile.js')
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/app-with-eslint-d'),
+ \ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/app-with-eslint-d/node_modules/.bin/eslint_d'))
+ \ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/package.json'))
+ \ . ' --fix %t',
+ \ }
+
+ " The option should be used when eslint_d is new enough.
+ " We look at the ESLint version instead of the eslint_d version.
+ GivenCommandOutput ['v3.19.0 (eslint_d v4.2.0)']
+ AssertFixer
+ \ {
+ \ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/app-with-eslint-d'),
+ \ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/app-with-eslint-d/node_modules/.bin/eslint_d'))
+ \ . ' --stdin-filename %s --stdin --fix-to-stdout',
+ \ 'process_with': 'ale#fixers#eslint#ProcessEslintDOutput',
+ \ }
+
+ " The option should be used for new versions too.
+ GivenCommandOutput ['4.9.0']
+ AssertFixer
+ \ {
+ \ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/app-with-eslint-d'),
+ \ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/app-with-eslint-d/node_modules/.bin/eslint_d'))
+ \ . ' --stdin-filename %s --stdin --fix-to-stdout',
+ \ 'process_with': 'ale#fixers#eslint#ProcessEslintDOutput',
+ \ }
+
+Execute(The --fix-dry-run post-processor should handle JSON output correctly):
+ AssertEqual
+ \ [],
+ \ ale#fixers#eslint#ProcessFixDryRunOutput(bufnr(''), [])
+ AssertEqual
+ \ [],
+ \ ale#fixers#eslint#ProcessFixDryRunOutput(bufnr(''), [''])
+ AssertEqual
+ \ [],
+ \ ale#fixers#eslint#ProcessFixDryRunOutput(bufnr(''), ['[{}]'])
+ AssertEqual
+ \ ['foo', 'bar'],
+ \ ale#fixers#eslint#ProcessFixDryRunOutput(bufnr(''), ['[{"output": "foo\nbar"}]'])
+
+Execute(The eslint_d post-processor should permit regular JavaScript content):
+ AssertEqual
+ \ [
+ \ 'const x = ''Error: foo''',
+ \ 'const y = 3',
+ \ ],
+ \ ale#fixers#eslint#ProcessEslintDOutput(bufnr(''), [
+ \ 'const x = ''Error: foo''',
+ \ 'const y = 3',
+ \ ])
+
+Execute(The eslint_d post-processor should handle error messages correctly):
+ AssertEqual
+ \ [],
+ \ ale#fixers#eslint#ProcessEslintDOutput(bufnr(''), [
+ \ 'Error: No ESLint configuration found.',
+ \ ])
+
+Execute(The eslint_d post-processor should handle failing to connect properly):
+ AssertEqual
+ \ [],
+ \ ale#fixers#eslint#ProcessEslintDOutput(bufnr(''), [
+ \ 'Could not connect',
+ \ ])
diff --git a/sources_non_forked/ale/test/fixers/test_fecs_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_fecs_fixer_callback.vader
new file mode 100644
index 00000000..146c0a87
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_fecs_fixer_callback.vader
@@ -0,0 +1,24 @@
+Before:
+ call ale#assert#SetUpFixerTest('javascript', 'fecs')
+ runtime autoload/ale/handlers/fecs.vim
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The fecs fixer should respect to g:ale_javascript_fecs_executable):
+ let g:ale_javascript_fecs_executable = '../test-files/fecs/fecs'
+ let g:ale_javascript_fecs_use_global = 1
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_javascript_fecs_executable) . ' format --replace=true %t',
+ \ 'read_temporary_file': 1,
+ \ },
+ \ ale#fixers#fecs#Fix(bufnr(''))
+
+Execute(The fecs fixer should return 0 when executable not found):
+ let g:ale_javascript_fecs_executable = 'fecs-invalid'
+ let g:ale_javascript_fecs_use_global = 1
+ AssertEqual
+ \ 0,
+ \ ale#fixers#fecs#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_fish_indent_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_fish_indent_fixer_callback.vader
new file mode 100644
index 00000000..3555a974
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_fish_indent_fixer_callback.vader
@@ -0,0 +1,40 @@
+Before:
+ Save g:ale_fish_fish_indent_executable
+ Save g:ale_fish_fish_indent_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_fish_fish_indent_executable = 'xxxinvalid'
+ let g:ale_fish_fish_indent_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The fish_indent callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/fish/testfile.fish')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' -w '
+ \ . ' %t',
+ \ },
+ \ ale#fixers#fish_indent#Fix(bufnr(''))
+
+Execute(The fish_indent callback should include custom fish_indent options):
+ let g:ale_fish_fish_indent_options = "-d"
+ call ale#test#SetFilename('../test-files/fish/testfile.fish')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' -w '
+ \ . ' -d'
+ \ . ' %t',
+ \ },
+ \ ale#fixers#fish_indent#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_fixjson_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_fixjson_fixer_callback.vader
new file mode 100644
index 00000000..2b023fad
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_fixjson_fixer_callback.vader
@@ -0,0 +1,50 @@
+Before:
+ Save g:ale_json_fixjson_executable
+ Save g:ale_json_fixjson_options
+
+ let g:ale_json_fixjson_executable = '/path/to/fixjson'
+ let g:ale_json_fixjson_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+Execute(The fixjson callback should return the correct default command):
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('/path/to/fixjson')
+ \ . ' --stdin-filename '
+ \ . ale#Escape(bufname(bufnr('')))
+ \ },
+ \ ale#fixers#fixjson#Fix(bufnr(''))
+
+Execute(The fixjson callback should set the buffer name as file name):
+ call ale#test#SetFilename('../test-files/json/testfile.json')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('/path/to/fixjson')
+ \ . ' --stdin-filename '
+ \ . ale#Escape(bufname(bufnr('')))
+ \ },
+ \ ale#fixers#fixjson#Fix(bufnr(''))
+
+ AssertNotEqual
+ \ stridx(
+ \ ale#fixers#fixjson#Fix(bufnr('')).command,
+ \ 'testfile.json',
+ \ ),
+ \ -1
+
+Execute(The fixjson callback should include additional options):
+ let g:ale_json_fixjson_options = '-i 2'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('/path/to/fixjson')
+ \ . ' --stdin-filename '
+ \ . ale#Escape(bufname(bufnr('')))
+ \ . ' -i 2'
+ \ },
+ \ ale#fixers#fixjson#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_floskell_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_floskell_fixer_callback.vader
new file mode 100644
index 00000000..66fe9200
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_floskell_fixer_callback.vader
@@ -0,0 +1,23 @@
+Before:
+ Save g:ale_haskell_floskell_executable
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_haskell_floskell_executable = 'xxxinvalid'
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The floskell callback should return the correct default values):
+ call ale#test#SetFilename('../haskell_files/testfile.hs')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' %t',
+ \ },
+ \ ale#fixers#floskell#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_gnatpp_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_gnatpp_fixer_callback.vader
new file mode 100644
index 00000000..7a3ed517
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_gnatpp_fixer_callback.vader
@@ -0,0 +1,28 @@
+Before:
+ call ale#assert#SetUpFixerTest('ada', 'gnatpp')
+
+After:
+ " Reset fixers, variables, etc.
+ "
+ " Vader's 'Restore' command will be called here.
+ call ale#assert#TearDownFixerTest()
+
+Execute(The default command should be correct):
+ call ale#test#SetFilename('../test-files/ada/testfile.adb')
+
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape(g:ale_ada_gnatpp_executable) .' %t',
+ \ 'read_temporary_file': 1,
+ \ }
+
+Execute(The version check should be correct):
+ call ale#test#SetFilename('../test-files/ada/testfile.adb')
+ let g:ale_ada_gnatpp_options = '--no-alignment'
+
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape(g:ale_ada_gnatpp_executable)
+ \ . ' --no-alignment %t',
+ \ 'read_temporary_file': 1,
+ \ }
diff --git a/sources_non_forked/ale/test/fixers/test_gofmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_gofmt_fixer_callback.vader
new file mode 100644
index 00000000..579dd3db
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_gofmt_fixer_callback.vader
@@ -0,0 +1,50 @@
+Before:
+ Save g:ale_go_gofmt_executable
+ Save g:ale_go_gofmt_options
+ Save g:ale_go_go111module
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_go_gofmt_executable = 'xxxinvalid'
+ let g:ale_go_gofmt_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ unlet! b:ale_go_go111module
+
+ call ale#test#RestoreDirectory()
+
+Execute(The gofmt callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/go/testfile.go')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid'),
+ \ },
+ \ ale#fixers#gofmt#Fix(bufnr(''))
+
+Execute(The gofmt callback should include custom gofmt options):
+ let g:ale_go_gofmt_options = "-r '(a) -> a'"
+
+ call ale#test#SetFilename('../test-files/go/testfile.go')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' ' . g:ale_go_gofmt_options,
+ \ },
+ \ ale#fixers#gofmt#Fix(bufnr(''))
+
+Execute(The gofmt callback should support Go environment variables):
+ let g:ale_go_go111module = 'off'
+
+ call ale#test#SetFilename('../test-files/go/testfile.go')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Env('GO111MODULE', 'off')
+ \ . ale#Escape('xxxinvalid')
+ \ },
+ \ ale#fixers#gofmt#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_gofumpt_fixer.vader b/sources_non_forked/ale/test/fixers/test_gofumpt_fixer.vader
new file mode 100644
index 00000000..63e04de8
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_gofumpt_fixer.vader
@@ -0,0 +1,27 @@
+Before:
+ call ale#assert#SetUpFixerTest('go', 'gofumpt')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The gofumpt callback should return the correct default values):
+ AssertFixer {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('gofumpt') . ' -w -- %t'
+ \}
+
+Execute(The gofumpt callback should allow custom gofumpt executables):
+ let g:ale_go_gofumpt_executable = 'foo/bar'
+
+ AssertFixer {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('foo/bar') . ' -w -- %t'
+ \}
+
+Execute(The gofumpt callback should allow custom gofumpt options):
+ let g:ale_go_gofumpt_options = '--foobar'
+
+ AssertFixer {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('gofumpt') . ' --foobar -w -- %t'
+ \}
diff --git a/sources_non_forked/ale/test/fixers/test_goimports_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_goimports_fixer_callback.vader
new file mode 100644
index 00000000..64c75b2d
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_goimports_fixer_callback.vader
@@ -0,0 +1,57 @@
+Before:
+ Save g:ale_go_goimports_executable
+ Save g:ale_go_goimports_options
+ Save g:ale_go_go111module
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_go_goimports_executable = 'xxxinvalid'
+ let g:ale_go_goimports_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+ call ale#test#SetFilename('../test-files/go/testfile.go')
+
+After:
+ Restore
+
+ unlet! b:ale_go_go111module
+
+ call ale#test#RestoreDirectory()
+
+Execute(The goimports callback should return 0 when the executable isn't executable):
+ AssertEqual
+ \ 0,
+ \ ale#fixers#goimports#Fix(bufnr(''))
+
+Execute(The goimports callback should the command when the executable test passes):
+ let g:ale_go_goimports_executable = has('win32') ? 'cmd' : 'echo'
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_go_goimports_executable) . ' -l -w -srcdir %s %t'
+ \ },
+ \ ale#fixers#goimports#Fix(bufnr(''))
+
+Execute(The goimports callback should include extra options):
+ let g:ale_go_goimports_executable = has('win32') ? 'cmd' : 'echo'
+ let g:ale_go_goimports_options = '--xxx'
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_go_goimports_executable) . ' -l -w -srcdir %s --xxx %t'
+ \ },
+ \ ale#fixers#goimports#Fix(bufnr(''))
+
+Execute(The goimports callback should support Go environment variables):
+ let g:ale_go_goimports_executable = has('win32') ? 'cmd' : 'echo'
+ let g:ale_go_go111module = 'on'
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Env('GO111MODULE', 'on')
+ \ . ale#Escape(g:ale_go_goimports_executable)
+ \ . ' -l -w -srcdir %s %t'
+ \ },
+ \ ale#fixers#goimports#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_golines_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_golines_fixer_callback.vader
new file mode 100644
index 00000000..87e53c88
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_golines_fixer_callback.vader
@@ -0,0 +1,54 @@
+Before:
+ Save g:ale_go_golines_executable
+ Save g:ale_go_golines_options
+ Save g:ale_go_go111module
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_go_golines_executable = 'xxxinvalid'
+ let g:ale_go_golines_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ unlet! b:ale_go_go111module
+
+ call ale#test#RestoreDirectory()
+
+Execute(The golines callback should return 0 when the executable isn't executable):
+ AssertEqual
+ \ 0,
+ \ ale#fixers#golines#Fix(bufnr(''))
+
+
+Execute(The golines callback should return the correct default values):
+ let g:ale_go_golines_executable = has('win32') ? 'cmd' : 'echo'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_go_golines_executable),
+ \ },
+ \ ale#fixers#golines#Fix(bufnr(''))
+
+Execute(The golines callback should include custom golines options):
+ let g:ale_go_golines_executable = has('win32') ? 'cmd' : 'echo'
+ let g:ale_go_golines_options = "--max-len --shorten-comments"
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_go_golines_executable)
+ \ . ' ' . g:ale_go_golines_options,
+ \ },
+ \ ale#fixers#golines#Fix(bufnr(''))
+
+Execute(The golines callback should support Go environment variables):
+ let g:ale_go_golines_executable = has('win32') ? 'cmd' : 'echo'
+ let g:ale_go_go111module = 'off'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Env('GO111MODULE', 'off')
+ \ . ale#Escape(g:ale_go_golines_executable)
+ \ },
+ \ ale#fixers#golines#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_gomod_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_gomod_fixer_callback.vader
new file mode 100644
index 00000000..56fb9854
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_gomod_fixer_callback.vader
@@ -0,0 +1,41 @@
+Before:
+ Save g:ale_go_go_executable
+ Save g:ale_go_go111module
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_go_go_executable = 'xxxinvalid'
+ let g:ale_go_go111module = ''
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ unlet! b:ale_go_go111module
+
+ call ale#test#RestoreDirectory()
+
+Execute(The gomod callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/go/go.mod')
+ setl filetype=gomod
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' mod edit -fmt'
+ \ . ' %t',
+ \ },
+ \ ale#fixers#gomod#Fix(bufnr(''))
+
+Execute(The gomod callback should support Go environment variables):
+ call ale#test#SetFilename('../test-files/go/go.mod')
+ setl filetype=gomod
+ let g:ale_go_go111module = 'on'
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Env('GO111MODULE', 'on')
+ \ . ale#Escape('xxxinvalid') . ' mod edit -fmt %t'
+ \ },
+ \ ale#fixers#gomod#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_goofle_java_format_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_goofle_java_format_fixer_callback.vader
new file mode 100644
index 00000000..4c28b330
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_goofle_java_format_fixer_callback.vader
@@ -0,0 +1,27 @@
+Before:
+ Save g:ale_java_google_java_format_executable
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_java_google_java_format_executable = 'xxxinvalid'
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The google-java-format callback should return 0 when the executable isn't executable):
+ AssertEqual
+ \ 0,
+ \ ale#fixers#google_java_format#Fix(bufnr(''))
+
+Execute(The google-java-format callback should run the command when the executable test passes):
+ let g:ale_java_google_java_format_executable = has('win32') ? 'cmd' : 'echo'
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(ale_java_google_java_format_executable) . ' --replace %t'
+ \ },
+ \ ale#fixers#google_java_format#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_hackfmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_hackfmt_fixer_callback.vader
new file mode 100644
index 00000000..d294c15e
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_hackfmt_fixer_callback.vader
@@ -0,0 +1,37 @@
+Before:
+ Save g:ale_hack_hackfmt_executable
+ Save g:ale_hack_hackfmt_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_hack_hackfmt_executable = 'xxxinvalid'
+ let g:ale_hack_hackfmt_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The hackfmt callback should return the correct default values):
+ call ale#test#SetFilename('../hack_files/testfile.hack')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' -i %t',
+ \ },
+ \ ale#fixers#hackfmt#Fix(bufnr(''))
+
+Execute(The hackfmt callback should include custom hackfmt options):
+ let g:ale_hack_hackfmt_options = "--some-option"
+ call ale#test#SetFilename('../hack_files/testfile.hack')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' -i --some-option %t',
+ \ },
+ \ ale#fixers#hackfmt#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_hfmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_hfmt_fixer_callback.vader
new file mode 100644
index 00000000..69cd03f8
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_hfmt_fixer_callback.vader
@@ -0,0 +1,24 @@
+Before:
+ Save g:ale_haskell_hfmt_executable
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_haskell_hfmt_executable = 'xxxinvalid'
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The hfmt callback should return the correct default values):
+ call ale#test#SetFilename('../haskell_files/testfile.hs')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' -w'
+ \ . ' %t',
+ \ },
+ \ ale#fixers#hfmt#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_hindent_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_hindent_fixer_callback.vader
new file mode 100644
index 00000000..2e5a8b9f
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_hindent_fixer_callback.vader
@@ -0,0 +1,18 @@
+Before:
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The hindent callback should return the correct default values):
+ call ale#test#SetFilename('../haskell_files/testfile.hs')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('hindent')
+ \ . ' %t',
+ \ },
+ \ ale#fixers#hindent#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_hlint_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_hlint_fixer_callback.vader
new file mode 100644
index 00000000..08f08fae
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_hlint_fixer_callback.vader
@@ -0,0 +1,20 @@
+Before:
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The hlint callback should return the correct default values):
+ call ale#test#SetFilename('../haskell_files/testfile.hs')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('hlint')
+ \ . ' --refactor'
+ \ . ' --refactor-options="--inplace"'
+ \ . ' %t',
+ \ },
+ \ ale#fixers#hlint#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_html_beautify_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_html_beautify_fixer_callback.vader
new file mode 100644
index 00000000..3012c7f1
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_html_beautify_fixer_callback.vader
@@ -0,0 +1,12 @@
+Before:
+ call ale#assert#SetUpFixerTest('html', 'html-beautify', 'beautify')
+
+After:
+ Restore
+
+ call ale#assert#TearDownFixerTest()
+
+Execute(The html-beautify callback should return the correct default command):
+ AssertEqual
+ \ {'command': ale#Escape('html-beautify') . ' -'},
+ \ ale#fixers#html_beautify#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_importjs_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_importjs_fixer_callback.vader
new file mode 100644
index 00000000..727e6a16
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_importjs_fixer_callback.vader
@@ -0,0 +1,35 @@
+Before:
+ Save g:ale_javascript_importjs_executable
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_javascript_importjs_executable = 'xxxinvalid'
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+ call ale#test#SetFilename('../test-files/javascript/test.js')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The importjs callback should return 0 when the executable isn't executable):
+ AssertEqual
+ \ 0,
+ \ ale#fixers#importjs#Fix(bufnr(''))
+
+Execute(The importjs callback should run the command when the executable test passes):
+ let g:ale_javascript_importjs_executable = has('win32') ? 'cmd' : 'echo'
+
+ AssertEqual
+ \ {
+ \ 'process_with': 'ale#fixers#importjs#ProcessOutput',
+ \ 'command': ale#Escape(g:ale_javascript_importjs_executable) . ' fix %s'
+ \ },
+ \ ale#fixers#importjs#Fix(bufnr(''))
+
+Execute(The ProcessOutput callback should return the expected output):
+ let g:testOutput = '{"messages":[],"fileContent":"one\ntwo","unresolvedImports":{}}'
+
+ AssertEqual
+ \ ['one', 'two'],
+ \ ale#fixers#importjs#ProcessOutput(bufnr(''), g:testOutput)
diff --git a/sources_non_forked/ale/test/fixers/test_isort_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_isort_fixer_callback.vader
new file mode 100644
index 00000000..8b665d6b
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_isort_fixer_callback.vader
@@ -0,0 +1,70 @@
+Before:
+ call ale#assert#SetUpFixerTest('python', 'isort')
+
+ let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+ unlet! g:dir
+ unlet! b:bin_dir
+
+Execute(The isort callback should return the correct default values):
+ silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
+
+ " --filename option exists only after 5.7.0
+ GivenCommandOutput ['VERSION 5.7.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/isort')) . ' --filename %s' . ' -',
+ \ }
+
+Execute(The isort callback should respect custom options):
+ let g:ale_python_isort_options = '--multi-line=3 --trailing-comma'
+
+ silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
+
+ " --filename option exists only after 5.7.0
+ GivenCommandOutput ['VERSION 5.7.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/isort'))
+ \ . ' --filename %s' . ' --multi-line=3 --trailing-comma -',
+ \ }
+
+Execute(Pipenv is detected when python_isort_auto_pipenv is set):
+ let g:ale_python_isort_auto_pipenv = 1
+
+ call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
+
+ GivenCommandOutput ['VERSION 5.7.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape('pipenv') . ' run isort' . ' --filename %s' . ' -'
+ \ }
+
+Execute(Poetry is detected when python_isort_auto_poetry is set):
+ let g:ale_python_isort_auto_poetry = 1
+
+ call ale#test#SetFilename('../test-files/python/poetry/whatever.py')
+
+ GivenCommandOutput ['VERSION 5.7.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape('poetry') . ' run isort' . ' --filename %s' . ' -'
+ \ }
+
+Execute(The isort callback should not use --filename for older versions):
+ silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
+
+ " --filename option exists only after 5.7.0
+ GivenCommandOutput ['VERSION 5.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/isort')) . ' -',
+ \ }
diff --git a/sources_non_forked/ale/test/fixers/test_jq_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_jq_fixer_callback.vader
new file mode 100644
index 00000000..74580d3b
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_jq_fixer_callback.vader
@@ -0,0 +1,26 @@
+Before:
+ Save g:ale_json_jq_executable
+ Save g:ale_json_jq_options
+ Save g:ale_json_jq_filters
+
+After:
+ Restore
+
+Execute(The jq fixer should use the options you set):
+ let g:ale_json_jq_executable = 'foo'
+ let g:ale_json_jq_options = '--bar'
+ let g:ale_json_jq_filters = '.baz'
+
+ AssertEqual
+ \ {'command': ale#Escape('foo') . ' .baz --bar'},
+ \ ale#fixers#jq#Fix(bufnr(''))
+
+Execute(The jq fixer should return 0 when there are no filters):
+ let g:ale_json_jq_executable = 'jq'
+ let g:ale_json_jq_options = ''
+
+ let g:ale_json_jq_filters = ''
+
+ AssertEqual
+ \ 0,
+ \ ale#fixers#jq#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_jsonnetfmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_jsonnetfmt_fixer_callback.vader
new file mode 100644
index 00000000..204d6583
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_jsonnetfmt_fixer_callback.vader
@@ -0,0 +1,38 @@
+Before:
+ Save g:ale_jsonnet_jsonnetfmt_executable
+ Save g:ale_jsonnet_jsonnetfmt_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_jsonnet_jsonnetfmt_executable = 'xxxinvalid'
+ let g:ale_jsonnet_jsonnetfmt_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+ call ale#assert#SetUpFixerTest('jsonnet', 'jsonnetfmt')
+
+After:
+ call ale#test#RestoreDirectory()
+ call ale#assert#TearDownFixerTest()
+
+Execute(The jsonnetfmt callback should return the correct default values):
+ call ale#test#SetFilename('../jsonnet_files/testfile.jsonnet')
+
+ AssertFixer {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_jsonnet_jsonnetfmt_executable)
+ \ . ' -i'
+ \ . ' %t',
+ \}
+
+Execute(The jsonnetfmt callback should include custom options):
+ let g:ale_jsonnet_jsonnetfmt_options = '--pad-arrays'
+
+ call ale#test#SetFilename('../jsonnet_files/testfile.jsonnet')
+
+ AssertFixer {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_jsonnet_jsonnetfmt_executable)
+ \ . ' -i'
+ \ . ' ' . g:ale_jsonnet_jsonnetfmt_options
+ \ . ' %t',
+ \}
+
diff --git a/sources_non_forked/ale/test/fixers/test_ktlint_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_ktlint_fixer_callback.vader
new file mode 100644
index 00000000..cfe39205
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_ktlint_fixer_callback.vader
@@ -0,0 +1,42 @@
+Before:
+ Save g:ale_kotlin_ktlint_executable
+ Save g:ale_kotlin_ktlint_options
+ Save g:ale_kotlin_ktlint_rulesets
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_kotlin_ktlint_executable = 'xxxinvalid'
+ let g:ale_kotlin_ktlint_options = ''
+ let g:ale_kotlin_ktlint_rulesets = []
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The ktlint callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/kotlin/testfile.kt')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' --stdin'
+ \ . ' --format',
+ \ },
+ \ ale#fixers#ktlint#Fix(bufnr(''))
+
+Execute(The ktlint callback should include custom ktlint options):
+ let g:ale_kotlin_ktlint_options = "--android"
+ let g:ale_kotlin_ktlint_rulesets = ['/path/to/custom/ruleset.jar']
+ call ale#test#SetFilename('../test-files/kotlin/testfile.kt')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' ' . g:ale_kotlin_ktlint_options
+ \ . ' --ruleset /path/to/custom/ruleset.jar'
+ \ . ' --stdin'
+ \ . ' --format',
+ \ },
+ \ ale#fixers#ktlint#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_latexindent_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_latexindent_fixer_callback.vader
new file mode 100644
index 00000000..bd4ac69a
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_latexindent_fixer_callback.vader
@@ -0,0 +1,36 @@
+Before:
+ Save g:ale_tex_latexindent_executable
+ Save g:ale_tex_latexindent_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_tex_latexindent_executable = 'xxxinvalid'
+ let g:ale_tex_latexindent_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The latexindent callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/tex/testfile.tex')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' -l'
+ \ },
+ \ ale#fixers#latexindent#Fix(bufnr(''))
+
+Execute(The latexindent callback should include custom gofmt options):
+ let g:ale_tex_latexindent_options = "-l '~/.indentconfig.yaml'"
+ call ale#test#SetFilename('../test-files/tex/testfile.tex')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' -l'
+ \ . ' ' . g:ale_tex_latexindent_options
+ \ },
+ \ ale#fixers#latexindent#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_lua_format_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_lua_format_fixer_callback.vader
new file mode 100644
index 00000000..29cafde6
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_lua_format_fixer_callback.vader
@@ -0,0 +1,35 @@
+Before:
+ Save g:ale_lua_lua_format_executable
+ Save g:ale_lua_lua_format_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_lua_lua_format_executable = 'xxxinvalid'
+ let g:ale_lua_lua_format_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The lua_format callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/lua/testfile.lua')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid') . ' -i',
+ \ },
+ \ ale#fixers#lua_format#Fix(bufnr(''))
+
+Execute(The lua_format callback should include custom lua_format options):
+ let g:ale_lua_lua_format_options = "--no-chop-down-table"
+ call ale#test#SetFilename('../test-files/lua/testfile.lua')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' ' . g:ale_lua_lua_format_options
+ \ . ' -i',
+ \ },
+ \ ale#fixers#lua_format#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_luafmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_luafmt_fixer_callback.vader
new file mode 100644
index 00000000..ef69f297
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_luafmt_fixer_callback.vader
@@ -0,0 +1,35 @@
+Before:
+ Save g:ale_lua_luafmt_executable
+ Save g:ale_lua_luafmt_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_lua_luafmt_executable = 'xxxinvalid'
+ let g:ale_lua_luafmt_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The luafmt callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/lua/testfile.lua')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid') . ' --stdin',
+ \ },
+ \ ale#fixers#luafmt#Fix(bufnr(''))
+
+Execute(The luafmt callback should include custom luafmt options):
+ let g:ale_lua_luafmt_options = "--skip-children"
+ call ale#test#SetFilename('../test-files/lua/testfile.lua')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' ' . g:ale_lua_luafmt_options
+ \ . ' --stdin',
+ \ },
+ \ ale#fixers#luafmt#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_mix_format_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_mix_format_fixer_callback.vader
new file mode 100644
index 00000000..cd492e81
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_mix_format_fixer_callback.vader
@@ -0,0 +1,36 @@
+Before:
+ Save g:ale_elixir_mix_executable
+ Save g:ale_elixir_mix_format_options
+
+ let g:ale_elixir_mix_executable = 'xxxinvalid'
+ let g:ale_elixir_mix_format_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The mix_format callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/elixir/testfile.ex')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' format %t',
+ \ },
+ \ ale#fixers#mix_format#Fix(bufnr(''))
+
+Execute(The mix_format callback should include the correct format options):
+ let g:ale_elixir_mix_format_options = 'invalid_options'
+ call ale#test#SetFilename('../test-files/elixir/testfile.ex')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' format invalid_options %t',
+ \ },
+ \ ale#fixers#mix_format#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_nimpretty_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_nimpretty_fixer_callback.vader
new file mode 100644
index 00000000..a26f649a
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_nimpretty_fixer_callback.vader
@@ -0,0 +1,23 @@
+Before:
+ call ale#assert#SetUpFixerTest('nim', 'nimpretty')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The nimpretty callback should return the correct default values):
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('nimpretty') . ' %t --maxLineLen:80'
+ \ },
+ \ ale#fixers#nimpretty#Fix(bufnr(''))
+
+Execute(The nimpretty callback should include any additional options):
+ let g:ale_nim_nimpretty_options = '--some-option'
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('nimpretty') . ' %t --some-option'
+ \ },
+ \ ale#fixers#nimpretty#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_nixfmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_nixfmt_fixer_callback.vader
new file mode 100644
index 00000000..880ac83e
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_nixfmt_fixer_callback.vader
@@ -0,0 +1,24 @@
+Before:
+ Save g:ale_nix_nixfmt_executable
+ Save g:ale_nix_nixfmt_options
+
+After:
+ Restore
+
+Execute(The nixfmt callback should return the correct default values):
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('nixfmt')
+ \ },
+ \ ale#fixers#nixfmt#Fix(bufnr(''))
+
+Execute(The nixfmt executable and options should be configurable):
+ let g:ale_nix_nixfmt_executable = '/path/to/nixfmt'
+ let g:ale_nix_nixfmt_options = '--help'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('/path/to/nixfmt')
+ \ . ' --help',
+ \ },
+ \ ale#fixers#nixfmt#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_nixpkgsfmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_nixpkgsfmt_fixer_callback.vader
new file mode 100644
index 00000000..0065f77b
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_nixpkgsfmt_fixer_callback.vader
@@ -0,0 +1,24 @@
+Before:
+ Save g:ale_nix_nixpkgsfmt_executable
+ Save g:ale_nix_nixpkgsfmt_options
+
+After:
+ Restore
+
+Execute(The nixpkgs-fmt callback should return the correct default values):
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('nixpkgs-fmt')
+ \ },
+ \ ale#fixers#nixpkgsfmt#Fix(bufnr(''))
+
+Execute(The nixpkgs-fmt executable and options should be configurable):
+ let g:ale_nix_nixpkgsfmt_executable = '/path/to/nixpkgs-fmt'
+ let g:ale_nix_nixpkgsfmt_options = '-h'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('/path/to/nixpkgs-fmt')
+ \ . ' -h',
+ \ },
+ \ ale#fixers#nixpkgsfmt#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_ocamlformat_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_ocamlformat_fixer_callback.vader
new file mode 100644
index 00000000..587fcf56
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_ocamlformat_fixer_callback.vader
@@ -0,0 +1,36 @@
+Before:
+ Save g:ale_ocaml_ocamlformat_executable
+ Save g:ale_ocaml_ocamlformat_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_ocaml_ocamlformat_executable = 'xxxinvalid'
+ let g:ale_ocaml_ocamlformat_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The ocamlformat callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/ocaml/testfile.re')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' --name=%s -',
+ \ },
+ \ ale#fixers#ocamlformat#Fix(bufnr(''))
+
+Execute(The ocamlformat callback should include custom ocamlformat options):
+ let g:ale_ocaml_ocamlformat_options = "-m 78"
+ call ale#test#SetFilename('../test-files/ocaml/testfile.re')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' ' . g:ale_ocaml_ocamlformat_options
+ \ . ' --name=%s -',
+ \ },
+ \ ale#fixers#ocamlformat#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_ocp_indent_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_ocp_indent_fixer_callback.vader
new file mode 100644
index 00000000..fc336b2d
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_ocp_indent_fixer_callback.vader
@@ -0,0 +1,34 @@
+Before:
+ Save g:ale_ocaml_ocp_indent_executable
+ Save g:ale_ocaml_ocpindent_options
+
+ " Use an invalid global executable
+ let g:ale_ocaml_ocp_indent_executable = 'xxxinvalid'
+ let g:ale_ocaml_ocp_indent_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The ocp_indent callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/ocaml/ocp_inden_testfile.re')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ },
+ \ ale#fixers#ocp_indent#Fix(bufnr(''))
+
+Execute(The ocp_indent callback should include custom ocp_indent options):
+ let g:ale_ocaml_ocp_indent_config = "base=4, type=4"
+ call ale#test#SetFilename('../test-files/ocaml/ocp_inden_testfile.re')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' --config=' . ale#Escape(g:ale_ocaml_ocp_indent_config)
+ \ },
+ \ ale#fixers#ocp_indent#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_opa_fmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_opa_fmt_fixer_callback.vader
new file mode 100644
index 00000000..3b112b2e
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_opa_fmt_fixer_callback.vader
@@ -0,0 +1,33 @@
+Before:
+ Save g:ale_opa_fmt_executable
+ Save g:ale_opa_fmt_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_opa_fmt_executable = 'xxxinvalid'
+ let g:ale_opa_fmt_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The opa fmt callback should return the correct default values):
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid') . ' fmt',
+ \ },
+ \ ale#fixers#opafmt#Fix(bufnr(''))
+
+Execute(The opa fmt callback should include custom options):
+ let g:ale_opa_fmt_options = "--list"
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' fmt'
+ \ . ' ' . g:ale_opa_fmt_options
+ \ },
+ \ ale#fixers#opafmt#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_ormolu_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_ormolu_fixer_callback.vader
new file mode 100644
index 00000000..8df3fca9
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_ormolu_fixer_callback.vader
@@ -0,0 +1,24 @@
+Before:
+ Save g:ale_haskell_ormolu_executable
+ Save g:ale_haskell_ormolu_options
+
+After:
+ Restore
+
+Execute(The ormolu callback should return the correct default values):
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('ormolu')
+ \ },
+ \ ale#fixers#ormolu#Fix(bufnr(''))
+
+Execute(The ormolu executable and options should be configurable):
+ let g:ale_nix_nixpkgsfmt_executable = '/path/to/ormolu'
+ let g:ale_nix_nixpkgsfmt_options = '-h'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('/path/to/ormolu')
+ \ . ' -h',
+ \ },
+ \ ale#fixers#nixpkgsfmt#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_packer_fmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_packer_fmt_fixer_callback.vader
new file mode 100644
index 00000000..2eb07ed4
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_packer_fmt_fixer_callback.vader
@@ -0,0 +1,34 @@
+Before:
+ Save g:ale_packer_fmt_executable
+ Save g:ale_packer_fmt_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_packer_fmt_executable = 'xxxinvalid'
+ let g:ale_packer_fmt_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The packer fmt callback should return the correct default values):
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid') . ' fmt -',
+ \ },
+ \ ale#fixers#packer#Fix(bufnr(''))
+
+Execute(The packer fmt callback should include custom options):
+ let g:ale_packer_fmt_options = "-list=true"
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' fmt'
+ \ . ' ' . g:ale_packer_fmt_options
+ \ . ' -',
+ \ },
+ \ ale#fixers#packer#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_pandoc_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_pandoc_fixer_callback.vader
new file mode 100644
index 00000000..a364ee56
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_pandoc_fixer_callback.vader
@@ -0,0 +1,23 @@
+Before:
+ Save g:ale_markdown_pandoc_executable
+ Save g:ale_markdown_pandoc_options
+
+After:
+ Restore
+
+Execute(The pandoc callback should return 'pandoc' as default command):
+ setlocal noexpandtab
+ Assert
+ \ ale#fixers#pandoc#Fix(bufnr('')).command =~# '^' . ale#Escape('pandoc'),
+ \ "Default command name is expected to be 'pandoc'"
+
+Execute(The pandoc executable and options should be configurable):
+ let g:ale_markdown_pandoc_executable = 'foobar'
+ let g:ale_markdown_pandoc_options = '--some-option'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('foobar')
+ \ . ' --some-option',
+ \ },
+ \ ale#fixers#pandoc#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_perltidy_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_perltidy_fixer_callback.vader
new file mode 100644
index 00000000..c7430bfa
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_perltidy_fixer_callback.vader
@@ -0,0 +1,40 @@
+Before:
+ Save g:ale_perl_perltidy_executable
+ Save g:ale_perl_perltidy_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_perl_perltidy_executable = 'xxxinvalid'
+ let g:ale_perl_perltidy_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The perltidy callback should return the correct default values):
+ call ale#test#SetFilename('../pl_files/testfile.pl')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' -b'
+ \ . ' %t',
+ \ },
+ \ ale#fixers#perltidy#Fix(bufnr(''))
+
+Execute(The perltidy callback should include custom perltidy options):
+ let g:ale_perl_perltidy_options = "-r '(a) -> a'"
+ call ale#test#SetFilename('../pl_files/testfile.pl')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' -b'
+ \ . ' ' . g:ale_perl_perltidy_options
+ \ . ' %t',
+ \ },
+ \ ale#fixers#perltidy#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_pgformatter_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_pgformatter_fixer_callback.vader
new file mode 100644
index 00000000..5baa6f6f
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_pgformatter_fixer_callback.vader
@@ -0,0 +1,24 @@
+Before:
+ Save g:ale_sql_pgformatter_executable
+ Save g:ale_sql_pgformatter_options
+
+After:
+ Restore
+
+Execute(The pgFormatter callback should return the correct default values):
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('pg_format')
+ \ },
+ \ ale#fixers#pgformatter#Fix(bufnr(''))
+
+Execute(The pgFormatter executable and options should be configurable):
+ let g:ale_sql_pgformatter_executable = '/path/to/pg_format'
+ let g:ale_sql_pgformatter_options = '-n'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('/path/to/pg_format')
+ \ . ' -n',
+ \ },
+ \ ale#fixers#pgformatter#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_php_cs_fixer.vader b/sources_non_forked/ale/test/fixers/test_php_cs_fixer.vader
new file mode 100644
index 00000000..eb4d78f8
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_php_cs_fixer.vader
@@ -0,0 +1,62 @@
+Before:
+ Save g:ale_php_cs_fixer_executable
+ Save g:ale_php_cs_fixer_options
+ let g:ale_php_cs_fixer_executable = 'php-cs-fixer'
+ let g:ale_php_cs_fixer_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+
+Execute(project with php-cs-fixer should use local by default):
+ call ale#test#SetFilename('../test-files/php/project-with-php-cs-fixer/test.php')
+
+ AssertEqual
+ \ ale#path#Simplify(g:dir . '/../test-files/php/project-with-php-cs-fixer/vendor/bin/php-cs-fixer'),
+ \ ale#fixers#php_cs_fixer#GetExecutable(bufnr(''))
+
+Execute(use-global should override local detection):
+ let g:ale_php_cs_fixer_use_global = 1
+ call ale#test#SetFilename('../test-files/php/project-with-php-cs-fixer/test.php')
+
+ AssertEqual
+ \ 'php-cs-fixer',
+ \ ale#fixers#php_cs_fixer#GetExecutable(bufnr(''))
+
+Execute(project without php-cs-fixer should use global):
+ call ale#test#SetFilename('../test-files/php/project-without-php-cs-fixer/test.php')
+
+ AssertEqual
+ \ 'php-cs-fixer',
+ \ ale#fixers#php_cs_fixer#GetExecutable(bufnr(''))
+
+
+
+
+Execute(The php-cs-fixer callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/php/project-without-php-cs-fixer/foo/test.php')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('php-cs-fixer')
+ \ . ' ' . g:ale_php_cs_fixer_options
+ \ . ' fix %t'
+ \ },
+ \ ale#fixers#php_cs_fixer#Fix(bufnr(''))
+
+Execute(The php-cs-fixer callback should include custom php-cs-fixer options):
+ let g:ale_php_cs_fixer_options = '--config="$HOME/.php_cs"'
+ call ale#test#SetFilename('../test-files/php/project-without-php-cs-fixer/test.php')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_php_cs_fixer_executable)
+ \ . ' --config="$HOME/.php_cs" fix %t',
+ \ 'read_temporary_file': 1,
+ \ },
+ \ ale#fixers#php_cs_fixer#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_phpcbf_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_phpcbf_fixer_callback.vader
new file mode 100644
index 00000000..45229a1b
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_phpcbf_fixer_callback.vader
@@ -0,0 +1,117 @@
+Before:
+ Save g:ale_php_phpcbf_executable
+ Save g:ale_php_phpcbf_standard
+ Save g:ale_php_phpcbf_use_global
+
+ let g:ale_php_phpcbf_executable = 'phpcbf_test'
+ let g:ale_php_phpcbf_standard = ''
+ let g:ale_php_phpcbf_options = ''
+ let g:ale_php_phpcbf_use_global = 0
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(project with phpcbf should use local by default):
+ call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
+
+ AssertEqual
+ \ ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf'),
+ \ ale#fixers#phpcbf#GetExecutable(bufnr(''))
+
+Execute(use-global should override local detection):
+ let g:ale_php_phpcbf_use_global = 1
+ call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
+
+ AssertEqual
+ \ 'phpcbf_test',
+ \ ale#fixers#phpcbf#GetExecutable(bufnr(''))
+
+Execute(project without phpcbf should use global):
+ call ale#test#SetFilename('../test-files/php/project-without-phpcbf/foo/test.php')
+
+ AssertEqual
+ \ 'phpcbf_test',
+ \ ale#fixers#phpcbf#GetExecutable(bufnr(''))
+
+Execute(The phpcbf callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
+
+ AssertEqual
+ \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' },
+ \ ale#fixers#phpcbf#Fix(bufnr(''))
+
+Execute(The phpcbf callback should include the phpcbf_standard option):
+ let g:ale_php_phpcbf_standard = 'phpcbf_ruleset.xml'
+ call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
+
+ AssertEqual
+ \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . '--standard=phpcbf_ruleset.xml' . ' -'},
+ \ ale#fixers#phpcbf#Fix(bufnr(''))
+
+Execute(User provided options should be used):
+ let g:ale_php_phpcbf_options = '--my-user-provided-option my-value'
+ call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
+
+ AssertEqual
+ \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . ale#Pad('--my-user-provided-option my-value') . ' -'},
+ \ ale#fixers#phpcbf#Fix(bufnr(''))
+
+
+Before:
+ Save g:ale_php_phpcbf_executable
+ Save g:ale_php_phpcbf_standard
+ Save g:ale_php_phpcbf_use_global
+
+ let g:ale_php_phpcbf_executable = 'phpcbf_test'
+ let g:ale_php_phpcbf_standard = ''
+ let g:ale_php_phpcbf_options = ''
+ let g:ale_php_phpcbf_use_global = 0
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(project with phpcbf should use local by default):
+ call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
+
+ AssertEqual
+ \ ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf'),
+ \ ale#fixers#phpcbf#GetExecutable(bufnr(''))
+
+Execute(use-global should override local detection):
+ let g:ale_php_phpcbf_use_global = 1
+ call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
+
+ AssertEqual
+ \ 'phpcbf_test',
+ \ ale#fixers#phpcbf#GetExecutable(bufnr(''))
+
+Execute(project without phpcbf should use global):
+ call ale#test#SetFilename('../test-files/php/project-without-phpcbf/foo/test.php')
+
+ AssertEqual
+ \ 'phpcbf_test',
+ \ ale#fixers#phpcbf#GetExecutable(bufnr(''))
+
+Execute(The phpcbf callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
+
+ AssertEqual
+ \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' },
+ \ ale#fixers#phpcbf#Fix(bufnr(''))
+
+Execute(The phpcbf callback should include the phpcbf_standard option):
+ let g:ale_php_phpcbf_standard = 'phpcbf_ruleset.xml'
+ call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
+
+ AssertEqual
+ \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . '--standard=phpcbf_ruleset.xml' . ' -'},
+ \ ale#fixers#phpcbf#Fix(bufnr(''))
+
diff --git a/sources_non_forked/ale/test/fixers/test_prettier_eslint_fixer.callback.vader b/sources_non_forked/ale/test/fixers/test_prettier_eslint_fixer.callback.vader
new file mode 100644
index 00000000..cfdd1c78
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_prettier_eslint_fixer.callback.vader
@@ -0,0 +1,97 @@
+Before:
+ call ale#assert#SetUpFixerTest('javascript', 'prettier_eslint')
+ Save g:ale_command_wrapper
+
+ let g:ale_command_wrapper = ''
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The default command should be correct):
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command':
+ \ ale#Escape('prettier-eslint')
+ \ . ' %t'
+ \ . ' --write'
+ \ }
+
+Execute(Additional options should be used when set):
+ let b:ale_javascript_prettier_eslint_options = '--foobar'
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command':
+ \ ale#Escape('prettier-eslint')
+ \ . ' %t'
+ \ . ' --foobar --write'
+ \ }
+
+Execute(--eslint-config-path should be set for 4.2.0 and up):
+ call ale#test#SetFilename('../test-files/eslint/react-app/foo/bar.js')
+
+ GivenCommandOutput ['4.2.0']
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command':
+ \ ale#Escape('prettier-eslint')
+ \ . ' %t'
+ \ . ' --eslint-config-path ' . ale#Escape(ale#test#GetFilename('../test-files/eslint/react-app/.eslintrc.js'))
+ \ . ' --write'
+ \ }
+
+Execute(--eslint-config-path shouldn't be used for older versions):
+ call ale#test#SetFilename('../test-files/eslint/react-app/foo/bar.js')
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command':
+ \ ale#Escape('prettier-eslint')
+ \ . ' %t'
+ \ . ' --write'
+ \ }
+
+Execute(The version check should be correct):
+ AssertFixer [
+ \ ale#Escape('prettier-eslint') . ' --version',
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command':
+ \ ale#Escape('prettier-eslint')
+ \ . ' %t'
+ \ . ' --write'
+ \ }
+ \]
+
+Execute(The new --stdin-filepath option should be used when the version is new enough):
+ call ale#test#SetFilename('../test-files/eslint/react-app/foo/bar.js')
+
+ GivenCommandOutput ['4.4.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape('prettier-eslint')
+ \ . ' --eslint-config-path ' . ale#Escape(ale#test#GetFilename('../test-files/eslint/react-app/.eslintrc.js'))
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(The version number should be cached):
+ GivenCommandOutput ['4.4.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape('prettier-eslint')
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+ GivenCommandOutput []
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape('prettier-eslint')
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
diff --git a/sources_non_forked/ale/test/fixers/test_prettier_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_prettier_fixer_callback.vader
new file mode 100644
index 00000000..8da13fcd
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_prettier_fixer_callback.vader
@@ -0,0 +1,337 @@
+Before:
+ call ale#assert#SetUpFixerTest('javascript', 'prettier')
+ Save g:ale_command_wrapper
+
+ let g:ale_command_wrapper = ''
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The prettier callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/prettier/testfile.js')
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' %t'
+ \ . ' --write',
+ \ }
+
+Execute(The --config option should not be set automatically):
+ let g:ale_javascript_prettier_use_local_config = 1
+ call ale#test#SetFilename('../test-files/prettier/with_config/testfile.js')
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' %t'
+ \ . ' --write',
+ \ }
+
+Execute(The prettier callback should include custom prettier options):
+ let g:ale_javascript_prettier_options = '--no-semi'
+ call ale#test#SetFilename('../test-files/prettier/with_config/testfile.js')
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' %t'
+ \ . ' --no-semi'
+ \ . ' --write',
+ \ }
+
+Execute(The version check should be correct):
+ call ale#test#SetFilename('../test-files/prettier/testfile.js')
+
+ AssertFixer [
+ \ ale#Escape('prettier') . ' --version',
+ \ {'read_temporary_file': 1, 'command': ale#Escape('prettier') . ' %t --write'}
+ \]
+
+Execute(--stdin-filepath should be used when prettier is new enough):
+ let g:ale_javascript_prettier_options = '--no-semi'
+ call ale#test#SetFilename('../test-files/prettier/with_config/testfile.js')
+
+ GivenCommandOutput ['1.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --no-semi'
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(The version number should be cached):
+ call ale#test#SetFilename('../test-files/prettier/with_config/testfile.js')
+
+ GivenCommandOutput ['1.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+ GivenCommandOutput []
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(Should set --parser to `babylon` by default, < 1.16.0):
+ call ale#test#SetFilename('../test-files/prettier/testfile')
+
+ set filetype=javascript
+
+ GivenCommandOutput ['1.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --parser babylon'
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(Should set --parser to `babel` by default, >= 1.16.0):
+ call ale#test#SetFilename('../test-files/prettier/testfile')
+
+ set filetype=javascript
+
+ GivenCommandOutput ['1.16.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --parser babel'
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(Should set --parser based on filetype, TypeScript):
+ call ale#test#SetFilename('../test-files/prettier/testfile')
+
+ set filetype=typescript
+
+ GivenCommandOutput ['1.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --parser typescript'
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(Should set --parser based on filetype, CSS):
+ call ale#test#SetFilename('../test-files/prettier/testfile')
+
+ set filetype=css
+
+ GivenCommandOutput ['1.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --parser css'
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(Should set --parser based on filetype, LESS):
+ call ale#test#SetFilename('../test-files/prettier/testfile')
+
+ set filetype=less
+
+ GivenCommandOutput ['1.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --parser less'
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(Should set --parser based on filetype, SCSS):
+ call ale#test#SetFilename('../test-files/prettier/testfile')
+
+ set filetype=scss
+
+ GivenCommandOutput ['1.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --parser scss'
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(Should set --parser based on filetype, JSON):
+ call ale#test#SetFilename('../test-files/prettier/testfile')
+
+ set filetype=json
+
+ GivenCommandOutput ['1.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --parser json'
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(Should set --parser based on filetype, JSON5):
+ call ale#test#SetFilename('../test-files/prettier/testfile')
+
+ set filetype=json5
+
+ GivenCommandOutput ['1.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --parser json5'
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(Should set --parser based on filetype, GraphQL):
+ call ale#test#SetFilename('../test-files/prettier/testfile')
+
+ set filetype=graphql
+
+ GivenCommandOutput ['1.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --parser graphql'
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(Should set --parser based on filetype, Markdown):
+ call ale#test#SetFilename('../test-files/prettier/testfile')
+
+ set filetype=markdown
+
+ GivenCommandOutput ['1.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --parser markdown'
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(Should set --parser based on filetype, Vue):
+ call ale#test#SetFilename('../test-files/prettier/testfile')
+
+ set filetype=vue
+
+ GivenCommandOutput ['1.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --parser vue'
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(Should set --parser based on filetype, YAML):
+ call ale#test#SetFilename('../test-files/prettier/testfile')
+
+ set filetype=yaml
+
+ GivenCommandOutput ['1.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --parser yaml'
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(Should set --parser based on filetype, HTML):
+ call ale#test#SetFilename('../test-files/prettier/testfile')
+
+ set filetype=html
+
+ GivenCommandOutput ['1.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --parser html'
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(Should set --parser based on filetype, Ruby):
+ call ale#test#SetFilename('../test-files/prettier/testfile')
+
+ set filetype=ruby
+
+ GivenCommandOutput ['1.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --parser ruby'
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(Should set --parser based on first filetype of multiple filetypes):
+ call ale#test#SetFilename('../test-files/prettier/testfile')
+
+ set filetype=css.scss
+
+ GivenCommandOutput ['1.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --parser css'
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(Should set --parser for experimental language, Handlebars):
+ call ale#test#SetFilename('../test-files/prettier/testfile.hbs')
+
+ set filetype=html.handlebars
+
+ GivenCommandOutput ['1.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --parser glimmer'
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(Changes to directory where .prettierignore is found):
+ call ale#test#SetFilename('../test-files/prettier/with_prettierignore/src/testfile.js')
+
+ GivenCommandOutput ['1.6.0']
+ AssertFixer
+ \ {
+ \ 'cwd': expand('%:p:h:h'),
+ \ 'command': ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --stdin-filepath %s --stdin',
+ \ }
+
+Execute(The prettier_d post-processor should permit regular JavaScript content):
+ AssertEqual
+ \ [
+ \ 'const x = ''Error: foo''',
+ \ 'const y = 3',
+ \ ],
+ \ ale#fixers#prettier#ProcessPrettierDOutput(bufnr(''), [
+ \ 'const x = ''Error: foo''',
+ \ 'const y = 3',
+ \ ])
+
+Execute(The prettier_d post-processor should handle error messages correctly):
+ AssertEqual
+ \ [],
+ \ ale#fixers#prettier#ProcessPrettierDOutput(bufnr(''), [
+ \ 'SyntaxError: Unexpected token, expected "," (36:28)',
+ \ ])
diff --git a/sources_non_forked/ale/test/fixers/test_prettier_standard_callback.vader b/sources_non_forked/ale/test/fixers/test_prettier_standard_callback.vader
new file mode 100644
index 00000000..f5037ed6
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_prettier_standard_callback.vader
@@ -0,0 +1,15 @@
+Before:
+ call ale#assert#SetUpFixerTest('javascript', 'prettier_standard')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The prettier callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/prettier/testfile.js')
+
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape(g:ale_javascript_prettier_standard_executable)
+ \ . ' --stdin'
+ \ . ' --stdin-filepath=%s ',
+ \ }
diff --git a/sources_non_forked/ale/test/fixers/test_protolint_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_protolint_fixer_callback.vader
new file mode 100644
index 00000000..5a6931d7
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_protolint_fixer_callback.vader
@@ -0,0 +1,28 @@
+Before:
+ call ale#assert#SetUpFixerTest('proto', 'protolint')
+ call ale#test#SetFilename('test.proto')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The default command should be correct):
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape('protolint')
+ \ . ' -fix'
+ \ . ' %t',
+ \ 'read_temporary_file': 1,
+ \ }
+
+Execute(The callback should include any additional options):
+ let b:ale_proto_protolint_executable = '/tmp/protolint'
+ let b:ale_proto_protolint_config = '/tmp/protolint.yaml'
+
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape('/tmp/protolint')
+ \ . ' -config_path=' . ale#Escape('/tmp/protolint.yaml')
+ \ . ' -fix'
+ \ . ' %t',
+ \ 'read_temporary_file': 1,
+ \ }
diff --git a/sources_non_forked/ale/test/fixers/test_ptop_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_ptop_fixer_callback.vader
new file mode 100644
index 00000000..7cf632e3
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_ptop_fixer_callback.vader
@@ -0,0 +1,38 @@
+Before:
+ Save g:ale_pascal_ptop_executable
+ Save g:ale_pascal_ptop_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_pascal_ptop_executable = 'xxxinvalid'
+ let g:ale_pascal_ptop_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The ptop callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/pascal/test.pas')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' %s %t',
+ \ },
+ \ ale#fixers#ptop#Fix(bufnr(''))
+
+Execute(The ptop callback should include custom ptop options):
+ let g:ale_pascal_ptop_options = "-i 2"
+ call ale#test#SetFilename('../test-files/pascal/test.pas')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' ' . g:ale_pascal_ptop_options
+ \ . ' %s %t',
+ \ },
+ \ ale#fixers#ptop#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_puppetlint_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_puppetlint_fixer_callback.vader
new file mode 100644
index 00000000..1a5a6cea
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_puppetlint_fixer_callback.vader
@@ -0,0 +1,24 @@
+Before:
+ Save g:ale_puppet_puppetlint_executable
+ Save g:ale_puppet_puppetlint_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_puppet_puppetlint_executable = 'xxxinvalid'
+ let g:ale_puppet_puppetlint_options = '--invalid'
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The puppetlint callback should return the correct default values):
+ silent execute 'file ' . fnameescape(g:dir . '/../test-files/puppet/dummy.pp')
+
+ AssertEqual
+ \ {'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_puppet_puppetlint_executable)
+ \ . ' ' . g:ale_puppet_puppetlint_options
+ \ . ' --fix %t' },
+ \ ale#fixers#puppetlint#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_purs_tidy_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_purs_tidy_fixer_callback.vader
new file mode 100644
index 00000000..fdeb3f21
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_purs_tidy_fixer_callback.vader
@@ -0,0 +1,20 @@
+Before:
+ Save g:ale_purescript_tidy_executable
+ Save g:ale_purescript_tidy_options
+
+ " Use an invalid global executable, so we don’t match it.
+ let g:ale_purescript_tidy_executable = 'odd-purs-tidy'
+ let g:ale_purescript_tidy_options = '--indent 3'
+
+ call ale#assert#SetUpFixerTest('purescript', 'purs-tidy')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The purs-tidy callback should return the correct custom options):
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape('odd-purs-tidy')
+ \ . ' format'
+ \ . ' --indent 3'
+ \ }
diff --git a/sources_non_forked/ale/test/fixers/test_purty_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_purty_fixer_callback.vader
new file mode 100644
index 00000000..e83b8c18
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_purty_fixer_callback.vader
@@ -0,0 +1,24 @@
+Before:
+ Save g:ale_purescript_purty_executable
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_purescript_purty_executable = 'my-special-purty'
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The purty callback should return the correct options):
+ call ale#test#SetFilename('../purescript_files/testfile.purs')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('my-special-purty')
+ \ . ' --write'
+ \ . ' %t',
+ \ 'read_temporary_file': 1,
+ \ },
+ \ ale#fixers#purty#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_python_add_blank_lines_fixer.vader b/sources_non_forked/ale/test/fixers/test_python_add_blank_lines_fixer.vader
new file mode 100644
index 00000000..7d042c8a
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_python_add_blank_lines_fixer.vader
@@ -0,0 +1,167 @@
+Before:
+ Save g:ale_fixers
+
+After:
+ Restore
+
+Given python(Some Python without blank lines):
+ def foo():
+ """ This is a simple test docstring """
+ return 1
+
+
+ def bar():
+ '''This is another simple test docstring'''
+ return 1
+ return 4
+
+
+ def bar():
+ """
+ This is a multi-line
+ docstring
+ """
+
+ if x:
+ pass
+ for l in x:
+ pass
+ for l in x:
+ pass
+ break
+ continue
+ elif x:
+ pass
+ while x:
+ pass
+ while x:
+ pass
+ else:
+ pass
+ if x:
+ pass
+ elif x:
+ pass
+ else:
+ pass
+
+Execute(Blank lines should be added appropriately):
+ let g:ale_fixers = {'python': ['add_blank_lines_for_python_control_statements']}
+ ALEFix
+
+Expect python(Newlines should be added):
+ def foo():
+ """ This is a simple test docstring """
+
+ return 1
+
+
+ def bar():
+ '''This is another simple test docstring'''
+
+ return 1
+
+ return 4
+
+
+ def bar():
+ """
+ This is a multi-line
+ docstring
+ """
+
+ if x:
+ pass
+
+ for l in x:
+ pass
+
+ for l in x:
+ pass
+
+ break
+
+ continue
+ elif x:
+ pass
+
+ while x:
+ pass
+
+ while x:
+ pass
+ else:
+ pass
+
+ if x:
+ pass
+ elif x:
+ pass
+ else:
+ pass
+
+Given python(A file with a main block):
+ import os
+
+
+ def main():
+ print('hello')
+
+
+ if __name__ == '__main__':
+ main()
+
+Execute(Fix the file):
+ let g:ale_fixers = {'python': ['add_blank_lines_for_python_control_statements']}
+ ALEFix
+
+Expect python(extra newlines shouldn't be added to the main block):
+ import os
+
+
+ def main():
+ print('hello')
+
+
+ if __name__ == '__main__':
+ main()
+
+
+Given python(A file with variables/docstring that start with a control statement):
+ def some():
+ """
+ This is a docstring that contains an
+ break control statement and also contains a
+ return something funny.
+ """
+
+ continue_some_var = True
+ forward_something = False
+
+ if (
+ continue_some_var and
+ forwarded_something
+ ):
+ return True
+
+
+Execute(Fix the file):
+ let g:ale_fixers = {'python': ['add_blank_lines_for_python_control_statements']}
+ ALEFix
+
+Expect python(Extra new lines are not added to the file):
+ def some():
+ """
+ This is a docstring that contains an
+ break control statement and also contains a
+ return something funny.
+ """
+
+ continue_some_var = True
+ forward_something = False
+
+ if (
+ continue_some_var and
+ forwarded_something
+ ):
+ return True
diff --git a/sources_non_forked/ale/test/fixers/test_qmlfmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_qmlfmt_fixer_callback.vader
new file mode 100644
index 00000000..e216f2e1
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_qmlfmt_fixer_callback.vader
@@ -0,0 +1,12 @@
+Before:
+ Save g:ale_qml_qmlfmt_executable
+
+After:
+ Restore
+
+Execute(The qmlfmt fixer should use the options you set):
+ let g:ale_qml_qmlfmt_executable = 'foo-exe'
+
+ AssertEqual
+ \ {'command': ale#Escape('foo-exe')},
+ \ ale#fixers#qmlfmt#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_refmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_refmt_fixer_callback.vader
new file mode 100644
index 00000000..01b56bee
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_refmt_fixer_callback.vader
@@ -0,0 +1,41 @@
+Before:
+ Save g:ale_reasonml_refmt_executable
+ Save g:ale_reasonml_refmt_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_reasonml_refmt_executable = 'xxxinvalid'
+ let g:ale_reasonml_refmt_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The refmt callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/reasonml/testfile.re')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' --in-place'
+ \ . ' %t',
+ \ },
+ \ ale#fixers#refmt#Fix(bufnr(''))
+
+Execute(The refmt callback should include custom refmt options):
+ let g:ale_reasonml_refmt_options = "-w 80"
+ call ale#test#SetFilename('../test-files/reasonml/testfile.re')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' ' . g:ale_reasonml_refmt_options
+ \ . ' --in-place'
+ \ . ' %t',
+ \ },
+ \ ale#fixers#refmt#Fix(bufnr(''))
+
diff --git a/sources_non_forked/ale/test/fixers/test_remark_lint_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_remark_lint_fixer_callback.vader
new file mode 100644
index 00000000..5e2e342d
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_remark_lint_fixer_callback.vader
@@ -0,0 +1,24 @@
+Before:
+ Save g:ale_markdown_remark_lint_executable
+ Save g:ale_markdown_remark_lint_options
+
+After:
+ Restore
+
+Execute(The remark callback should return the correct default values):
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('remark')
+ \ },
+ \ ale#fixers#remark_lint#Fix(bufnr(''))
+
+Execute(The remark executable and options should be configurable):
+ let g:ale_markdown_remark_lint_executable = '/path/to/remark'
+ let g:ale_markdown_remark_lint_options = '-h'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('/path/to/remark')
+ \ . ' -h',
+ \ },
+ \ ale#fixers#remark_lint#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_reorder_python_imports_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_reorder_python_imports_fixer_callback.vader
new file mode 100644
index 00000000..ead2da77
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_reorder_python_imports_fixer_callback.vader
@@ -0,0 +1,46 @@
+Before:
+ Save g:ale_python_reorder_python_imports_executable
+ Save g:ale_python_reorder_python_imports_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_python_reorder_python_imports_executable = 'xxxinvalid'
+ let g:ale_python_reorder_python_imports_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+ let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
+
+After:
+ Restore
+
+ unlet! b:bin_dir
+
+ call ale#test#RestoreDirectory()
+
+Execute(The reorder_python_imports callback should return the correct default values):
+ AssertEqual
+ \ 0,
+ \ ale#fixers#reorder_python_imports#Fix(bufnr(''))
+
+ silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/'
+ \ . b:bin_dir . '/reorder-python-imports')) . ' -',
+ \ },
+ \ ale#fixers#reorder_python_imports#Fix(bufnr(''))
+
+Execute(The reorder_python_imports callback should respect custom options):
+ let g:ale_python_reorder_python_imports_options = '--py3-plus'
+
+ AssertEqual
+ \ 0,
+ \ ale#fixers#reorder_python_imports#Fix(bufnr(''))
+
+ silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/'
+ \ . b:bin_dir . '/reorder-python-imports')) . ' --py3-plus -',
+ \ },
+ \ ale#fixers#reorder_python_imports#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_rubocop_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_rubocop_fixer_callback.vader
new file mode 100644
index 00000000..f7b0eb60
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_rubocop_fixer_callback.vader
@@ -0,0 +1,89 @@
+Before:
+ Save g:ale_ruby_rubocop_executable
+ Save g:ale_ruby_rubocop_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_ruby_rubocop_executable = 'xxxinvalid'
+ let g:ale_ruby_rubocop_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The rubocop callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/ruby/dummy.rb')
+
+ AssertEqual
+ \ {
+ \ 'process_with': 'ale#fixers#rubocop#PostProcess',
+ \ 'command': ale#Escape(g:ale_ruby_rubocop_executable)
+ \ . ' --auto-correct --force-exclusion --stdin %s',
+ \ },
+ \ ale#fixers#rubocop#Fix(bufnr(''))
+
+Execute(The rubocop callback should include custom rubocop options):
+ let g:ale_ruby_rubocop_options = '--except Lint/Debugger'
+ call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')
+
+ AssertEqual
+ \ {
+ \ 'process_with': 'ale#fixers#rubocop#PostProcess',
+ \ 'command': ale#Escape(g:ale_ruby_rubocop_executable)
+ \ . ' --except Lint/Debugger'
+ \ . ' --auto-correct --force-exclusion --stdin %s',
+ \ },
+ \ ale#fixers#rubocop#Fix(bufnr(''))
+
+Execute(The rubocop callback should use auto-correct-all option when set):
+ let g:ale_ruby_rubocop_auto_correct_all = 1
+ call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')
+
+ AssertEqual
+ \ {
+ \ 'process_with': 'ale#fixers#rubocop#PostProcess',
+ \ 'command': ale#Escape(g:ale_ruby_rubocop_executable)
+ \ . ' --auto-correct-all --force-exclusion --stdin %s'
+ \ },
+ \ ale#fixers#rubocop#Fix(bufnr(''))
+
+Execute(The rubocop post-processor should remove diagnostics content):
+ AssertEqual
+ \ [
+ \ 'class MyModel < ApplicationRecord',
+ \ ' # rubocop:disable Rails/InverseOf',
+ \ ' has_one :something',
+ \ ' # rubocop:enable Rails/InverseOf',
+ \ 'end',
+ \ '',
+ \ 'array = [1, 2, 3,',
+ \ ' 4, 5, 6]',
+ \ 'array = [''run'',',
+ \ ' ''forrest'',',
+ \ ' ''run'']',
+ \ ],
+ \ ale#fixers#rubocop#PostProcess(bufnr(''), [
+ \ 'Inspecting 1 file',
+ \ 'C',
+ \ '',
+ \ 'Offenses:',
+ \ 'app/models/my_model.rb:8:3: C: [Corrected] Layout/ArrayAlignment: ',
+ \ '4, 5, 6]',
+ \ '^',
+ \ '',
+ \ '1 file inspected, 3 offenses detected, 3 offenses corrected',
+ \ '====================',
+ \ 'class MyModel < ApplicationRecord',
+ \ ' # rubocop:disable Rails/InverseOf',
+ \ ' has_one :something',
+ \ ' # rubocop:enable Rails/InverseOf',
+ \ 'end',
+ \ '',
+ \ 'array = [1, 2, 3,',
+ \ ' 4, 5, 6]',
+ \ 'array = [''run'',',
+ \ ' ''forrest'',',
+ \ ' ''run'']',
+ \ ])
diff --git a/sources_non_forked/ale/test/fixers/test_rufo_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_rufo_fixer_callback.vader
new file mode 100644
index 00000000..3d539f7a
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_rufo_fixer_callback.vader
@@ -0,0 +1,30 @@
+Before:
+ Save g:ale_ruby_rufo_executable
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_ruby_rufo_executable = 'xxxinvalid'
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The rufo command should contain `bundle exec` when executable is `bundle`):
+ let g:ale_ruby_rufo_executable = 'bundle'
+ call ale#test#SetFilename('../test-files/ruby/dummy.rb')
+
+ AssertEqual
+ \ ale#Escape('bundle') . ' exec rufo %t',
+ \ ale#fixers#rufo#GetCommand(bufnr(''))
+
+Execute(The rufo callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/ruby/dummy.rb')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid') . ' %t'
+ \ },
+ \ ale#fixers#rufo#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_rustfmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_rustfmt_fixer_callback.vader
new file mode 100644
index 00000000..98761c94
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_rustfmt_fixer_callback.vader
@@ -0,0 +1,16 @@
+Before:
+ call ale#assert#SetUpFixerTest('rust', 'rustfmt')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The rustfmt callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/rust/testfile.rs')
+
+ AssertFixer {'command': ale#Escape('rustfmt')}
+
+Execute(The rustfmt callback should include custom rustfmt options):
+ let g:ale_rust_rustfmt_options = "--skip-children"
+ call ale#test#SetFilename('../test-files/rust/testfile.rs')
+
+ AssertFixer {'command': ale#Escape('rustfmt') . ' ' . g:ale_rust_rustfmt_options}
diff --git a/sources_non_forked/ale/test/fixers/test_scalafmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_scalafmt_fixer_callback.vader
new file mode 100644
index 00000000..2b8dc3eb
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_scalafmt_fixer_callback.vader
@@ -0,0 +1,66 @@
+Before:
+ Save g:ale_scala_scalafmt_executable
+ Save g:ale_scala_scalafmt_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_scala_scalafmt_executable = 'xxxinvalid'
+ let g:ale_scala_scalafmt_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The scalafmt callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/scala/dummy.scala')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_scala_scalafmt_executable)
+ \ . ' %t',
+ \ },
+ \ ale#fixers#scalafmt#Fix(bufnr(''))
+
+Execute(The scalafmt callback should use ng with scalafmt automatically):
+ let g:ale_scala_scalafmt_executable = 'ng'
+ call ale#test#SetFilename('../test-files/scala/dummy.scala')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('ng')
+ \ . ' scalafmt'
+ \ . ' %t',
+ \ },
+ \ ale#fixers#scalafmt#Fix(bufnr(''))
+
+Execute(The scalafmt callback should include custom scalafmt options):
+ let g:ale_scala_scalafmt_options = '--diff'
+ call ale#test#SetFilename('../test-files/scala/dummy.scala')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_scala_scalafmt_executable)
+ \ . ' --diff'
+ \ . ' %t',
+ \ },
+ \ ale#fixers#scalafmt#Fix(bufnr(''))
+
+Execute(The scalafmt callback should include custom scalafmt options and use ng with scalafmt):
+ let g:ale_scala_scalafmt_options = '--diff'
+ let g:ale_scala_scalafmt_executable = 'ng'
+ call ale#test#SetFilename('../test-files/scala/dummy.scala')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('ng')
+ \ . ' scalafmt'
+ \ . ' --diff'
+ \ . ' %t',
+ \ },
+ \ ale#fixers#scalafmt#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_shfmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_shfmt_fixer_callback.vader
new file mode 100644
index 00000000..99cb0987
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_shfmt_fixer_callback.vader
@@ -0,0 +1,59 @@
+Before:
+ Save g:ale_sh_shfmt_executable
+ Save g:ale_sh_shfmt_options
+ Save &l:expandtab
+ Save &l:shiftwidth
+ Save &l:tabstop
+
+After:
+ Restore
+
+Execute(The shfmt callback should return 'shfmt' as default command):
+ setlocal noexpandtab
+ Assert
+ \ ale#fixers#shfmt#Fix(bufnr('')).command =~# '^' . ale#Escape('shfmt'),
+ \ "Default command name is expected to be 'shfmt'"
+
+Execute(The shfmt callback should return the command with no option as default when noexpandtab is set):
+ let g:ale_sh_shfmt_executable = 'shfmt'
+ let g:ale_sh_shfmt_options = ''
+ setlocal noexpandtab
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('shfmt'),
+ \ },
+ \ ale#fixers#shfmt#Fix(bufnr(''))
+
+Execute(The shfmt callback should return the command specifying indent width by looking shiftwidth as default):
+ let g:ale_sh_shfmt_executable = 'shfmt'
+ let g:ale_sh_shfmt_options = ''
+ setlocal expandtab
+ setlocal shiftwidth=4
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('shfmt') . ' -i 4',
+ \ },
+ \ ale#fixers#shfmt#Fix(bufnr(''))
+
+Execute(The shfmt callback should return the command specifying indent width by looking tabstop when shiftwidth is 0 as default):
+ let g:ale_sh_shfmt_executable = 'shfmt'
+ let g:ale_sh_shfmt_options = ''
+ setlocal expandtab
+ setlocal shiftwidth=0
+ setlocal tabstop=8
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('shfmt') . ' -i 8',
+ \ },
+ \ ale#fixers#shfmt#Fix(bufnr(''))
+
+Execute(The shfmt executable and options should be configurable):
+ let g:ale_sh_shfmt_executable = 'foobar'
+ let g:ale_sh_shfmt_options = '--some-option'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('foobar')
+ \ . ' --some-option',
+ \ },
+ \ ale#fixers#shfmt#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_sorbet_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_sorbet_fixer_callback.vader
new file mode 100644
index 00000000..2694a3dc
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_sorbet_fixer_callback.vader
@@ -0,0 +1,38 @@
+Before:
+ Save g:ale_ruby_sorbet_executable
+ Save g:ale_ruby_sorbet_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_ruby_sorbet_executable = 'xxxinvalid'
+ let g:ale_ruby_sorbet_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The sorbet callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/ruby/dummy.rb')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_ruby_sorbet_executable)
+ \ . ' tc --autocorrect --file %t',
+ \ },
+ \ ale#fixers#sorbet#Fix(bufnr(''))
+
+Execute(The sorbet callback should include custom sorbet options):
+ let g:ale_ruby_sorbet_options = '--enable-experimental-lsp-hover'
+ call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_ruby_sorbet_executable)
+ \ . ' tc --enable-experimental-lsp-hover'
+ \ . ' --autocorrect --file %t',
+ \ },
+ \ ale#fixers#sorbet#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_sqlfmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_sqlfmt_fixer_callback.vader
new file mode 100644
index 00000000..3046edb3
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_sqlfmt_fixer_callback.vader
@@ -0,0 +1,26 @@
+Before:
+ Save g:ale_sql_sqlfmt_executable
+ Save g:ale_sql_sqlfmt_options
+
+After:
+ Restore
+
+Execute(The sqlfmt callback should return the correct default values):
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('sqlfmt')
+ \ . ' -w',
+ \ },
+ \ ale#fixers#sqlfmt#Fix(bufnr(''))
+
+Execute(The sqlfmt executable and options should be configurable):
+ let g:ale_sql_sqlfmt_executable = '/path/to/sqlfmt'
+ let g:ale_sql_sqlfmt_options = '-u'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('/path/to/sqlfmt')
+ \ . ' -w'
+ \ . ' -u',
+ \ },
+ \ ale#fixers#sqlfmt#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_sqlformat_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_sqlformat_fixer_callback.vader
new file mode 100644
index 00000000..4bace089
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_sqlformat_fixer_callback.vader
@@ -0,0 +1,24 @@
+Before:
+ Save g:ale_sql_sqlformat_executable
+ Save g:ale_sql_sqlformat_options
+
+After:
+ Restore
+
+Execute(The sqlformat callback should return the correct default values):
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('sqlformat') . ' -'
+ \ },
+ \ ale#fixers#sqlformat#Fix(bufnr(''))
+
+Execute(The sqlformat executable and options should be configurable):
+ let g:ale_sql_sqlformat_executable = '/path/to/sqlformat'
+ let g:ale_sql_sqlformat_options = '-a'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('/path/to/sqlformat')
+ \ . ' -a -'
+ \ },
+ \ ale#fixers#sqlformat#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_standard_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_standard_fixer_callback.vader
new file mode 100644
index 00000000..9f5eb0e9
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_standard_fixer_callback.vader
@@ -0,0 +1,31 @@
+Before:
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+ unlet! b:ale_javascript_standard_executable
+ unlet! b:ale_javascript_standard_options
+
+After:
+ call ale#test#RestoreDirectory()
+
+Execute(The executable path should be correct):
+ call ale#test#SetFilename('../test-files/eslint/react-app/subdir/testfile.js')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/standard/bin/cmd.js'))
+ \ . ' --fix --stdin < %s > %t',
+ \ },
+ \ ale#fixers#standard#Fix(bufnr(''))
+
+Execute(Custom options should be supported):
+ let b:ale_javascript_standard_use_global = 1
+ let b:ale_javascript_standard_options = '--foo-bar'
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('standard') . ' --foo-bar --fix --stdin < %s > %t',
+ \ },
+ \ ale#fixers#standard#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_standardrb_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_standardrb_fixer_callback.vader
new file mode 100644
index 00000000..ff82b8f1
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_standardrb_fixer_callback.vader
@@ -0,0 +1,51 @@
+Before:
+ Save g:ale_ruby_standardrb_executable
+ Save g:ale_ruby_standardrb_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_ruby_standardrb_executable = 'xxxinvalid'
+ let g:ale_ruby_standardrb_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The standardrb callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/ruby/dummy.rb')
+
+ AssertEqual
+ \ {
+ \ 'process_with': 'ale#fixers#rubocop#PostProcess',
+ \ 'command': ale#Escape(g:ale_ruby_standardrb_executable)
+ \ . ' --fix --force-exclusion --stdin %s',
+ \ },
+ \ ale#fixers#standardrb#Fix(bufnr(''))
+
+Execute(The standardrb callback should include configuration files):
+ call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')
+
+ AssertEqual
+ \ {
+ \ 'process_with': 'ale#fixers#rubocop#PostProcess',
+ \ 'command': ale#Escape(g:ale_ruby_standardrb_executable)
+ \ . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/ruby/with_config/.standard.yml'))
+ \ . ' --fix --force-exclusion --stdin %s',
+ \ },
+ \ ale#fixers#standardrb#Fix(bufnr(''))
+
+Execute(The standardrb callback should include custom rubocop options):
+ let g:ale_ruby_standardrb_options = '--except Lint/Debugger'
+ call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')
+
+ AssertEqual
+ \ {
+ \ 'process_with': 'ale#fixers#rubocop#PostProcess',
+ \ 'command': ale#Escape(g:ale_ruby_standardrb_executable)
+ \ . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/ruby/with_config/.standard.yml'))
+ \ . ' --except Lint/Debugger'
+ \ . ' --fix --force-exclusion --stdin %s',
+ \ },
+ \ ale#fixers#standardrb#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_statix_fixer.vader b/sources_non_forked/ale/test/fixers/test_statix_fixer.vader
new file mode 100644
index 00000000..c55365a6
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_statix_fixer.vader
@@ -0,0 +1,18 @@
+Before:
+ call ale#assert#SetUpFixerTest('nix', 'statix')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The callback should return the correct default values):
+ AssertFixer { 'command': ale#Escape('statix') . ' fix --stdin' }
+
+Execute(The callback should include a custom runtime):
+ let g:ale_nix_statix_fix_executable = 'foo/bar'
+
+ AssertFixer { 'command': ale#Escape('foo/bar') . ' fix --stdin' }
+
+Execute(The callback should include custom options):
+ let g:ale_nix_statix_fix_options = '--foobar'
+
+ AssertFixer { 'command': ale#Escape('statix') . ' fix --stdin --foobar' }
diff --git a/sources_non_forked/ale/test/fixers/test_stylelint_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_stylelint_fixer_callback.vader
new file mode 100644
index 00000000..ee7cfdd4
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_stylelint_fixer_callback.vader
@@ -0,0 +1,34 @@
+Before:
+ Save g:ale_stylelint_options
+
+ let g:ale_stylelint_options = ''
+
+ call ale#assert#SetUpFixerTest('css', 'stylelint')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The stylelint callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/eslint/react-app/subdir/testfile.css')
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 0,
+ \ 'cwd': '%s:h',
+ \ 'command': (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/stylelint/bin/stylelint.js'))
+ \ . ' --fix --stdin --stdin-filename %s',
+ \ }
+
+Execute(The stylelint callback should include custom stylelint options):
+ let g:ale_stylelint_options = '--cache'
+ call ale#test#SetFilename('../test-files/eslint/react-app/subdir/testfile.css')
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 0,
+ \ 'cwd': '%s:h',
+ \ 'command': (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/stylelint/bin/stylelint.js'))
+ \ . ' --cache --fix --stdin --stdin-filename %s',
+ \ }
diff --git a/sources_non_forked/ale/test/fixers/test_styler_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_styler_fixer_callback.vader
new file mode 100644
index 00000000..79f71ba9
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_styler_fixer_callback.vader
@@ -0,0 +1,21 @@
+Before:
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The styler callback should include custom styler options):
+ let g:ale_r_styler_options = "a_custom_option"
+
+ AssertEqual
+ \ {
+ \ 'command': 'Rscript --vanilla -e '
+ \ . '"suppressPackageStartupMessages(library(styler));'
+ \ . 'style_file(commandArgs(TRUE), transformers = '
+ \ . 'a_custom_option)"'
+ \ . ' %t',
+ \ 'read_temporary_file': 1,
+ \ },
+ \ ale#fixers#styler#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_stylish_haskell_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_stylish_haskell_fixer_callback.vader
new file mode 100644
index 00000000..755d3430
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_stylish_haskell_fixer_callback.vader
@@ -0,0 +1,24 @@
+Before:
+ Save g:ale_haskell_stylish_haskell_executable
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_haskell_stylish_haskell_executable = 'xxxinvalid'
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The stylish-haskell callback should return the correct default values):
+ call ale#test#SetFilename('../haskell_files/testfile.hs')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' --inplace'
+ \ . ' %t',
+ \ },
+ \ ale#fixers#stylish_haskell#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_stylua_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_stylua_fixer_callback.vader
new file mode 100644
index 00000000..8621c498
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_stylua_fixer_callback.vader
@@ -0,0 +1,19 @@
+Before:
+ call ale#assert#SetUpFixerTest('lua', 'stylua')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The default command should be correct):
+ AssertFixer {'command': ale#Escape('stylua') . ' -'}
+
+Execute(The stylua callback should include custom stylua options):
+ let g:ale_lua_stylua_executable = 'xxxinvalid'
+ let g:ale_lua_stylua_options = '--search-parent-directories'
+
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' ' . g:ale_lua_stylua_options
+ \ . ' -',
+ \ }
diff --git a/sources_non_forked/ale/test/fixers/test_swiftformat_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_swiftformat_fixer_callback.vader
new file mode 100644
index 00000000..755c30f6
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_swiftformat_fixer_callback.vader
@@ -0,0 +1,35 @@
+Before:
+ Save g:ale_swift_swiftformat_executable
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_swift_swiftformat_executable = 'xxxinvalid'
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The swiftformat callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/swift/dummy.swift')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_swift_swiftformat_executable)
+ \ . ' %t ',
+ \ },
+ \ ale#fixers#swiftformat#Fix(bufnr(''))
+
+Execute(The swiftformat callback should include any additional options):
+ call ale#test#SetFilename('../test-files/swift/dummy.swift')
+ let g:ale_swift_swiftformat_options = '--some-option'
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_swift_swiftformat_executable)
+ \ . ' %t --some-option',
+ \ },
+ \ ale#fixers#swiftformat#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_terraform_fmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_terraform_fmt_fixer_callback.vader
new file mode 100644
index 00000000..15377a7e
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_terraform_fmt_fixer_callback.vader
@@ -0,0 +1,34 @@
+Before:
+ Save g:ale_terraform_fmt_executable
+ Save g:ale_terraform_fmt_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_terraform_fmt_executable = 'xxxinvalid'
+ let g:ale_terraform_fmt_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The terraform fmt callback should return the correct default values):
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid') . ' fmt -',
+ \ },
+ \ ale#fixers#terraform#Fix(bufnr(''))
+
+Execute(The terraform fmt callback should include custom options):
+ let g:ale_terraform_fmt_options = "-list=true"
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' fmt'
+ \ . ' ' . g:ale_terraform_fmt_options
+ \ . ' -',
+ \ },
+ \ ale#fixers#terraform#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_textlint_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_textlint_fixer_callback.vader
new file mode 100644
index 00000000..5b6c5b7a
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_textlint_fixer_callback.vader
@@ -0,0 +1,42 @@
+Before:
+ Save g:ale_textlint_executable
+ Save g:ale_textlint_options
+ Save g:ale_textlint_use_global
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_textlint_executable = 'xxxinvalid'
+ let g:ale_textlint_options = ''
+ let g:ale_textlint_use_global = 0
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The textlint callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/markdown/testfile.md')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' --fix'
+ \ . ' %t',
+ \ },
+ \ ale#fixers#textlint#Fix(bufnr(''))
+
+Execute(The textlint callback should include custom textlint options):
+ let g:ale_textlint_options = "--quiet"
+ call ale#test#SetFilename('../test-files/markdown/testfile.md')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' --fix'
+ \ . ' ' . g:ale_textlint_options
+ \ . ' %t',
+ \ },
+ \ ale#fixers#textlint#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_tidy_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_tidy_fixer_callback.vader
new file mode 100644
index 00000000..25d3d6c3
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_tidy_fixer_callback.vader
@@ -0,0 +1,25 @@
+Before:
+ Save g:ale_html_tidy_executable
+
+ let g:ale_html_tidy_executable = '../test-files/tidy/tidy'
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The tidy callback should return 0 if tidy not found):
+ let g:ale_html_tidy_executable = 'xxxinvalidpath'
+ AssertEqual
+ \ 0,
+ \ ale#fixers#tidy#Fix(bufnr(''))
+
+Execute(The tidy callback should return the correct default command):
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('../test-files/tidy/tidy')
+ \ . ' -q --tidy-mark no --show-errors 0 --show-warnings 0'
+ \ },
+ \ ale#fixers#tidy#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_trim_whitespace.vader b/sources_non_forked/ale/test/fixers/test_trim_whitespace.vader
new file mode 100644
index 00000000..2ffbcb04
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_trim_whitespace.vader
@@ -0,0 +1,28 @@
+Before:
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ call ale#test#RestoreDirectory()
+
+Execute(Should delete all whitespace at the end of different lines):
+ AssertEqual
+ \ [
+ \ 'def foo():',
+ \ ' some_variable = this_is_a_longer_function(',
+ \ 'first_argument,',
+ \ ' second_argument,',
+ \ ' third_with_function_call(',
+ \ 'foo,',
+ \ ' bar,',
+ \ '))',
+ \ ],
+ \ ale#fixers#generic#TrimWhitespace(bufnr(''), [
+ \ 'def foo():',
+ \ ' some_variable = this_is_a_longer_function(',
+ \ 'first_argument,',
+ \ ' second_argument,',
+ \ ' third_with_function_call(',
+ \ 'foo,',
+ \ ' bar,',
+ \ '))',
+ \ ])
diff --git a/sources_non_forked/ale/test/fixers/test_tslint_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_tslint_fixer_callback.vader
new file mode 100644
index 00000000..43fcc5a4
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_tslint_fixer_callback.vader
@@ -0,0 +1,42 @@
+Before:
+ Save g:ale_typescript_tslint_executable
+ Save g:ale_typescript_tslint_config_path
+
+ unlet! g:ale_typescript_tslint_executable
+ unlet! g:ale_typescript_tslint_config_path
+ unlet! b:ale_typescript_tslint_executable
+ unlet! b:ale_typescript_tslint_config_path
+
+ call ale#handlers#tslint#InitVariables()
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The tslint callback should return the correct default values):
+ let g:ale_typescript_tslint_config_path = 'tslint.json'
+ call ale#test#SetFilename('../test-files/prettier/testfile.ts')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('tslint')
+ \ . ' -c ' . ale#Escape('tslint.json')
+ \ . ' --outputAbsolutePaths --fix %t',
+ \ },
+ \ ale#fixers#tslint#Fix(bufnr(''))
+
+Execute(The tslint callback should include custom tslint config option):
+ let g:ale_typescript_tslint_config_path = '.tslintrc'
+ call ale#test#SetFilename('../test-files/prettier/testfile.ts')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('tslint')
+ \ . ' -c ' . ale#Escape('.tslintrc')
+ \ . ' --outputAbsolutePaths --fix %t',
+ \ },
+ \ ale#fixers#tslint#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_uncrustify_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_uncrustify_fixer_callback.vader
new file mode 100644
index 00000000..c101a31a
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_uncrustify_fixer_callback.vader
@@ -0,0 +1,108 @@
+Before:
+ Save g:ale_c_uncrustify_executable
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_c_uncrustify_executable = 'xxxinvalid'
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The clang-format callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/c/dummy.c')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l C'
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+Execute(The uncrustify callback should include any additional options):
+ call ale#test#SetFilename('../test-files/c/dummy.c')
+ let b:ale_c_uncrustify_options = '--some-option'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l C --some-option',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+Execute(The uncrustify callback should set proper language):
+ unlet b:ale_c_uncrustify_options
+
+ set filetype=c
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l C',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+ set filetype=cpp
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l CPP',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+ set filetype=cs
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l CS',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+ set filetype=objc
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l OC',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+ set filetype=objcpp
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l OC+',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+ set filetype=d
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l D',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+ set filetype=java
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l JAVA',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+ set filetype=vala
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l VALA',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
+
+ set filetype=p
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape(g:ale_c_uncrustify_executable)
+ \ . ' --no-backup -l PAWN',
+ \ },
+ \ ale#fixers#uncrustify#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_vfmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_vfmt_fixer_callback.vader
new file mode 100644
index 00000000..cbab1189
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_vfmt_fixer_callback.vader
@@ -0,0 +1,44 @@
+Before:
+ Save g:ale_v_v_executable
+ Save g:ale_v_vfmt_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_v_v_executable = 'xxxinvalid'
+ let g:ale_v_vfmt_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The vfmt callback should return the correct default values):
+ call ale#test#SetFilename('../v_files/testfile.v')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid') . ' fmt',
+ \ },
+ \ ale#fixers#vfmt#Fix(bufnr(''))
+
+Execute(The vfmt callback should include custom vfmt options):
+ let g:ale_v_vfmt_options = "-r '(a) -> a'"
+
+ call ale#test#SetFilename('../v_files/testfile.v')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' fmt ' . g:ale_v_vfmt_options,
+ \ },
+ \ ale#fixers#vfmt#Fix(bufnr(''))
+
+Execute(The vfmt callback should support Go environment variables):
+ call ale#test#SetFilename('../v_files/testfile.v')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid') . ' fmt',
+ \ },
+ \ ale#fixers#vfmt#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_vim_help_tags_alignment_fixer.vader b/sources_non_forked/ale/test/fixers/test_vim_help_tags_alignment_fixer.vader
new file mode 100644
index 00000000..7e18a771
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_vim_help_tags_alignment_fixer.vader
@@ -0,0 +1,19 @@
+Before:
+ Save g:ale_fixers
+
+After:
+ Restore
+
+Given help(A vim help file with badly aligned tags):
+ foo *foo*
+ bar *bar*
+ baz *bar*
+
+Execute(Tags should be aligned at the right margin):
+ let g:ale_fixers = {'help': ['align_help_tags']}
+ ALEFix
+
+Expect help(Tags should be aligned):
+ foo *foo*
+ bar *bar*
+ baz *bar*
diff --git a/sources_non_forked/ale/test/fixers/test_xmllint_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_xmllint_fixer_callback.vader
new file mode 100644
index 00000000..54fe05bd
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_xmllint_fixer_callback.vader
@@ -0,0 +1,46 @@
+Before:
+ Save g:ale_xml_xmllint_executable
+ Save g:ale_xml_xmllint_indentsize
+ Save g:ale_xml_xmllint_options
+
+ let g:ale_xml_xmllint_executable = '/path/to/xmllint'
+ let g:ale_xml_xmllint_indentsize = ''
+ let g:ale_xml_xmllint_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+Execute(The xmllint callback should return the correct default command):
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('/path/to/xmllint')
+ \ . ' --format '
+ \ . ale#Escape(bufname(bufnr('')))
+ \ },
+ \ ale#fixers#xmllint#Fix(bufnr(''))
+
+Execute(The xmllint callback should include the XMLLINT_INDENT variable):
+ let g:ale_xml_xmllint_indentsize = 2
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Env('XMLLINT_INDENT', ' ')
+ \ . ale#Escape('/path/to/xmllint')
+ \ . ' --format '
+ \ . ale#Escape(bufname(bufnr('')))
+ \ },
+ \ ale#fixers#xmllint#Fix(bufnr(''))
+
+Execute(The xmllint callback should include additional options):
+ let g:ale_xml_xmllint_options = '--nonet'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('/path/to/xmllint')
+ \ . ' --format '
+ \ . ale#Escape(bufname(bufnr('')))
+ \ . ' --nonet'
+ \ },
+ \ ale#fixers#xmllint#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_xo_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_xo_fixer_callback.vader
new file mode 100644
index 00000000..fe2da8cc
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_xo_fixer_callback.vader
@@ -0,0 +1,45 @@
+Before:
+ call ale#assert#SetUpFixerTest('javascript', 'xo')
+ runtime autoload/ale/handlers/xo.vim
+ set filetype=javascript
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The xo callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/xo/monorepo/packages/a/index.js')
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/xo/monorepo/node_modules/xo/cli.js'))
+ \ . ' --fix %t',
+ \ }
+
+Execute(The xo callback should include custom xo options):
+ let g:ale_javascript_xo_options = '--space'
+ call ale#test#SetFilename('../test-files/xo/monorepo/packages/a/index.js')
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/xo/monorepo/node_modules/xo/cli.js'))
+ \ . ' --fix %t'
+ \ . ' --space',
+ \ }
+
+Execute(--stdin should be used when xo is new enough):
+ let g:ale_javascript_xo_options = '--space'
+ call ale#test#SetFilename('../test-files/xo/monorepo/packages/a/index.js')
+
+ GivenCommandOutput ['0.30.0']
+ AssertFixer
+ \ {
+ \ 'command': (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/xo/monorepo/node_modules/xo/cli.js'))
+ \ . ' --stdin --stdin-filename %s'
+ \ . ' --fix'
+ \ . ' --space',
+ \ }
diff --git a/sources_non_forked/ale/test/fixers/test_xots_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_xots_fixer_callback.vader
new file mode 100644
index 00000000..61a22e62
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_xots_fixer_callback.vader
@@ -0,0 +1,45 @@
+Before:
+ call ale#assert#SetUpFixerTest('typescript', 'xo')
+ runtime autoload/ale/handlers/xo.vim
+ set filetype=typescript
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The xo callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/xo/monorepo/packages/a/index.ts')
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/xo/monorepo/node_modules/xo/cli.js'))
+ \ . ' --fix %t',
+ \ }
+
+Execute(The xo callback should include custom xo options):
+ let g:ale_typescript_xo_options = '--space'
+ call ale#test#SetFilename('../test-files/xo/monorepo/packages/a/index.ts')
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/xo/monorepo/node_modules/xo/cli.js'))
+ \ . ' --fix %t'
+ \ . ' --space',
+ \ }
+
+Execute(--stdin should be used when xo is new enough):
+ let g:ale_typescript_xo_options = '--space'
+ call ale#test#SetFilename('../test-files/xo/monorepo/packages/a/index.ts')
+
+ GivenCommandOutput ['0.30.0']
+ AssertFixer
+ \ {
+ \ 'command': (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/xo/monorepo/node_modules/xo/cli.js'))
+ \ . ' --stdin --stdin-filename %s'
+ \ . ' --fix'
+ \ . ' --space',
+ \ }
diff --git a/sources_non_forked/ale/test/fixers/test_yamlfix_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_yamlfix_fixer_callback.vader
new file mode 100644
index 00000000..1ae5e335
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_yamlfix_fixer_callback.vader
@@ -0,0 +1,33 @@
+Before:
+ call ale#assert#SetUpFixerTest('yaml', 'yamlfix')
+
+ let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
+
+After:
+ unlet! b:bin_dir
+ call ale#assert#TearDownFixerTest()
+
+Execute(The yamlfix callback should return the correct default values):
+ AssertEqual
+ \ 0,
+ \ ale#fixers#yamlfix#Fix(bufnr(''))
+
+ silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.yaml')
+ AssertEqual
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/yamlfix')) . ' -',
+ \ },
+ \ ale#fixers#yamlfix#Fix(bufnr(''))
+
+Execute(The yamlfix callback should respect custom options):
+ let g:ale_yaml_yamlfix_options = '--multi-line=3 --trailing-comma'
+
+ silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.yaml')
+ AssertEqual
+ \ {
+ \ 'cwd': '%s:h',
+ \ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/yamlfix'))
+ \ . ' --multi-line=3 --trailing-comma -',
+ \ },
+ \ ale#fixers#yamlfix#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_yapf_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_yapf_fixer_callback.vader
new file mode 100644
index 00000000..a7fcc07b
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_yapf_fixer_callback.vader
@@ -0,0 +1,39 @@
+Before:
+ Save g:ale_python_yapf_executable
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_python_yapf_executable = 'xxxinvalid'
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+ let b:bin_dir = has('win32') ? 'Scripts' : 'bin'
+
+After:
+ Restore
+
+ unlet! b:bin_dir
+
+ call ale#test#RestoreDirectory()
+
+Execute(The yapf callback should return the correct default values):
+ AssertEqual
+ \ 0,
+ \ ale#fixers#yapf#Fix(bufnr(''))
+
+ call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
+
+ AssertEqual
+ \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/yapf'))},
+ \ ale#fixers#yapf#Fix(bufnr(''))
+ \
+Execute(The yapf should include the .style.yapf file if present):
+ call ale#test#SetFilename('../test-files/python/with_virtualenv/dir_with_yapf_config/foo/bar.py')
+
+ AssertEqual
+ \ {
+ \ 'command':
+ \ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/yapf'))
+ \ . ' --no-local-style'
+ \ . ' --style ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/dir_with_yapf_config/.style.yapf')),
+ \ },
+ \ ale#fixers#yapf#Fix(bufnr(''))
diff --git a/sources_non_forked/ale/test/fixers/test_zigfmt_fixer_callback.vader b/sources_non_forked/ale/test/fixers/test_zigfmt_fixer_callback.vader
new file mode 100644
index 00000000..47e3ddee
--- /dev/null
+++ b/sources_non_forked/ale/test/fixers/test_zigfmt_fixer_callback.vader
@@ -0,0 +1,20 @@
+Before:
+ call ale#assert#SetUpFixerTest('zig', 'zigfmt')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The zig callback should return the correct default values):
+ AssertFixer {
+ \ 'command': ale#Escape('zig') . ' fmt %t',
+ \ 'read_temporary_file': 1,
+ \}
+
+Execute(The zig callback should allow custom zig executables):
+ let g:ale_zig_zigfmt_executable = 'foo/bar'
+
+ AssertFixer {
+ \ 'command': ale#Escape('foo/bar') . ' fmt %t',
+ \ 'read_temporary_file': 1,
+ \}
+
diff --git a/sources_non_forked/ale/test/handler/test_actionlint_handler.vader b/sources_non_forked/ale/test/handler/test_actionlint_handler.vader
new file mode 100644
index 00000000..557cff02
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_actionlint_handler.vader
@@ -0,0 +1,28 @@
+Before:
+ runtime! ale/handlers/actionlint.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(Problems should be parsed correctly for actionlint):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 1,
+ \ 'type': 'E',
+ \ 'text': '"jobs" section is missing in workflow',
+ \ 'code': 'syntax-check',
+ \ },
+ \ {
+ \ 'lnum': 56,
+ \ 'col': 23,
+ \ 'type': 'E',
+ \ 'text': 'property "unknown_input" is not defined in object type {input7: bool; input0: any; input1: any; input2: string; input3: any; input4: any; input5: number; input6: number}',
+ \ 'code': 'expression',
+ \ },
+ \ ],
+ \ ale#handlers#actionlint#Handle(bufnr(''), [
+ \ '.codecov.yaml:2:1: "jobs" section is missing in workflow [syntax-check]',
+ \ 'workflow_call_event.yaml:56:23: property "unknown_input" is not defined in object type {input7: bool; input0: any; input1: any; input2: string; input3: any; input4: any; input5: number; input6: number} [expression]',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_ada_gcc_handler.vader b/sources_non_forked/ale/test/handler/test_ada_gcc_handler.vader
new file mode 100644
index 00000000..06ddfe1f
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_ada_gcc_handler.vader
@@ -0,0 +1,36 @@
+Before:
+ runtime ale_linters/ada/gcc.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The gcc handler for Ada should parse input correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'bufnr': 0,
+ \ 'lnum': 8,
+ \ 'col': 5,
+ \ 'type': 'W',
+ \ 'text': 'variable "X" is assigned but never read',
+ \ },
+ \ {
+ \ 'bufnr': 0,
+ \ 'lnum': 6,
+ \ 'col': 22,
+ \ 'type': 'E',
+ \ 'text': 'type definition expected',
+ \ },
+ \ {
+ \ 'bufnr': 0,
+ \ 'lnum': 8,
+ \ 'col': 9,
+ \ 'type': 'E',
+ \ 'text': 'aspect specifications not allowed here',
+ \ },
+ \ ],
+ \ ale_linters#ada#gcc#Handle(0, [
+ \ 'foobar.adb:8:05: warning: variable "X" is assigned but never read',
+ \ 'foobar.ads:6:22: type definition expected',
+ \ 'foobar.ads:8:09: aspect specifications not allowed here',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_alex_handler.vader b/sources_non_forked/ale/test/handler/test_alex_handler.vader
new file mode 100644
index 00000000..eb241f80
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_alex_handler.vader
@@ -0,0 +1,54 @@
+Execute(The alex handler should handle the example from the alex README):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 5,
+ \ 'end_lnum': 1,
+ \ 'end_col': 13,
+ \ 'type': 'W',
+ \ 'text': '`boogeyman` may be insensitive, use `boogey` instead (retext-equality)',
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 42,
+ \ 'end_lnum': 1,
+ \ 'end_col': 47,
+ \ 'type': 'W',
+ \ 'text': '`master` / `slaves` may be insensitive, use `primary` / `replica` instead (retext-equality)',
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 69,
+ \ 'end_lnum': 1,
+ \ 'end_col': 74,
+ \ 'type': 'W',
+ \ 'text': 'Don’t use “slaves”, it’s profane (retext-profanities)',
+ \ },
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 52,
+ \ 'end_lnum': 2,
+ \ 'end_col': 53,
+ \ 'type': 'W',
+ \ 'text': '`he` may be insensitive, use `they`, `it` instead (retext-equality)',
+ \ },
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 61,
+ \ 'end_lnum': 2,
+ \ 'end_col': 67,
+ \ 'type': 'W',
+ \ 'text': '`cripple` may be insensitive, use `person with a limp` instead (retext-equality)',
+ \ },
+ \ ],
+ \ ale#handlers#alex#Handle(bufnr(''), [
+ \ 'example.md',
+ \ ' 1:5-1:14 warning `boogeyman` may be insensitive, use `boogey` instead boogeyman-boogeywoman retext-equality',
+ \ ' 1:42-1:48 warning `master` / `slaves` may be insensitive, use `primary` / `replica` instead master-slave retext-equality',
+ \ ' 1:69-1:75 warning Don’t use “slaves”, it’s profane slaves retext-profanities',
+ \ ' 2:52-2:54 warning `he` may be insensitive, use `they`, `it` instead he-she retext-equality',
+ \ ' 2:61-2:68 warning `cripple` may be insensitive, use `person with a limp` instead cripple retext-equality',
+ \ '',
+ \ '⚠ 5 warnings',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_ameba_handler.vader b/sources_non_forked/ale/test/handler/test_ameba_handler.vader
new file mode 100644
index 00000000..a6f43170
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_ameba_handler.vader
@@ -0,0 +1,44 @@
+Before:
+ runtime ale_linters/crystal/ameba.vim
+
+After:
+ unlet! g:lines
+ call ale#linter#Reset()
+
+Execute(The ameba handler should parse lines correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 24,
+ \ 'col': 28,
+ \ 'end_col': 29,
+ \ 'text': 'Trailing whitespace detected',
+ \ 'code': 'Layout/TrailingWhitespace',
+ \ 'type': 'W',
+ \ },
+ \ ],
+ \ ale_linters#crystal#ameba#HandleAmebaOutput(123, [
+ \ '{"sources":[{"path":"my_file_with_issues.cr","issues":[{"rule_name":"Layout/TrailingWhitespace","message":"Trailing whitespace detected","location":{"line":24,"column":28},"end_location":{"line":null,"column":null}}]},{"path":"my_file_without_issues.cr","issues":[]}],"metadata":{"ameba_version":"0.8.1","crystal_version":"0.26.1"},"summary":{"target_sources_count":2,"issues_count":1}}'
+ \ ])
+
+Execute(The ameba handler should handle when files are checked and no offenses are found):
+ AssertEqual
+ \ [],
+ \ ale_linters#crystal#ameba#HandleAmebaOutput(123, [
+ \ '{"sources":[{"path":"my_file_with_issues.cr",issues":[]},{"path":"my_file_without_issues.cr",issues":[]}],"metadata":{ameba_version":"0.8.1",crystal_version":"0.26.1"},"summary":{target_sources_count":2,issues_count":0}}'
+ \ ])
+
+Execute(The ameba handler should handle when no files are checked):
+ AssertEqual
+ \ [],
+ \ ale_linters#crystal#ameba#HandleAmebaOutput(123, [
+ \ '{"sources":[],"metadata":{ameba_version":"0.8.1",crystal_version":"0.26.1"},"summary":{target_sources_count":0,issues_count":0}}'
+ \ ])
+
+Execute(The ameba handler should handle blank output without any errors):
+ AssertEqual
+ \ [],
+ \ ale_linters#crystal#ameba#HandleAmebaOutput(123, ['{}'])
+ AssertEqual
+ \ [],
+ \ ale_linters#crystal#ameba#HandleAmebaOutput(123, [])
diff --git a/sources_non_forked/ale/test/handler/test_ansible_lint_handler.vader b/sources_non_forked/ale/test/handler/test_ansible_lint_handler.vader
new file mode 100644
index 00000000..28dbba30
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_ansible_lint_handler.vader
@@ -0,0 +1,95 @@
+Before:
+ runtime ale_linters/ansible/ansible_lint.vim
+ call ale#test#SetFilename('test_playbook.yml')
+
+ let b:ale_warn_about_trailing_whitespace = 1
+
+After:
+ unlet! b:ale_warn_about_trailing_whitespace
+ call ale#linter#Reset()
+
+Execute(The ansible-lint handler for version group <5 should handle basic errors):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 35,
+ \ 'col': 0,
+ \ 'type': 'E',
+ \ 'text': 'Trailing whitespace',
+ \ 'code': 'EANSIBLE0002',
+ \ },
+ \ ],
+ \ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [4, 1, 2], [
+ \ fnamemodify(tempname(), ':h') . '/test_playbook.yml:35: [EANSIBLE0002] Trailing whitespace',
+ \ ])
+
+Execute(The ansible-lint handler for version group <5 should supress trailing whitespace output when the option is used):
+ let b:ale_warn_about_trailing_whitespace = 0
+
+ AssertEqual
+ \ [
+ \ ],
+ \ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [4, 1, 2], [
+ \ fnamemodify(tempname(), ':h') . '/test_playbook.yml:35: [EANSIBLE0002] Trailing whitespace',
+ \ ])
+
+
+Execute(The ansible-lint handler for version group >=5 should handle basic errors):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 35,
+ \ 'col': 0,
+ \ 'type': 'E',
+ \ 'text': 'File permissions unset or incorrect',
+ \ 'code': 'risky-file-permissions',
+ \ },
+ \ ],
+ \ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [5, 1, 2], [
+ \ fnamemodify(tempname(), ':h') . '/test_playbook.yml:35: [risky-file-permissions] [VERY_HIGH] File permissions unset or incorrect',
+ \ ])
+
+Before:
+ runtime ale_linters/ansible/ansible_lint.vim
+ call ale#test#SetFilename('test playbook.yml')
+
+After:
+ call ale#linter#Reset()
+
+Execute (The ansible-lint handler for version group <5 should handle names with spaces):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 6,
+ \ 'type': 'E',
+ \ 'text': 'indentation is not a multiple of four',
+ \ 'code': 'E111',
+ \ },
+ \ ],
+ \ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [4, 1, 2], [
+ \ fnamemodify(tempname(), ':h') . '/test playbook.yml:6:6: E111 indentation is not a multiple of four',
+ \ ])
+
+Execute (The ansible-lint handler for version group >=5 should handle names with spaces):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 3,
+ \ 'col': 148,
+ \ 'type': 'E',
+ \ 'text': "'var' is not a valid attribute for a Play",
+ \ 'code': 'syntax-check',
+ \ },
+ \ ],
+ \ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [5, 1, 2], [
+ \ fnamemodify(tempname(), ':h') . "/test playbook.yml:3:148: [syntax-check] [VERY_HIGH] 'var' is not a valid attribute for a Play",
+ \ ])
+
+Execute (The ansible-lint handler should ignore errors from other files):
+ AssertEqual
+ \ [
+ \ ],
+ \ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [5, 1, 2], [
+ \ '/foo/bar/roles/test_playbook.yml:6: [command-instead-of-module] [VERY_LOW] curl used in place of get_url or uri module',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_appleswiftformat_handler.vader b/sources_non_forked/ale/test/handler/test_appleswiftformat_handler.vader
new file mode 100644
index 00000000..818bd9c5
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_appleswiftformat_handler.vader
@@ -0,0 +1,28 @@
+Before:
+ runtime ale_linters/swift/appleswiftformat.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The appleswiftformat handler should parse lines correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 4,
+ \ 'col': 21,
+ \ 'type': 'W',
+ \ 'code': 'DoNotUseSemicolons',
+ \ 'text': 'remove '';'' and move the next statement to the new line',
+ \ },
+ \ {
+ \ 'lnum': 3,
+ \ 'col': 12,
+ \ 'type': 'W',
+ \ 'code': 'Spacing',
+ \ 'text': 'remove 1 space'
+ \ },
+ \ ],
+ \ ale_linters#swift#appleswiftformat#Handle(bufnr(''), [
+ \ 'Sources/main.swift:4:21: warning: [DoNotUseSemicolons] remove '';'' and move the next statement to the new line',
+ \ 'Sources/main.swift:3:12: warning: [Spacing] remove 1 space',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_asm_handler.vader b/sources_non_forked/ale/test/handler/test_asm_handler.vader
new file mode 100644
index 00000000..4ab99992
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_asm_handler.vader
@@ -0,0 +1,26 @@
+Before:
+ runtime ale_linters/asm/gcc.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The asm GCC handler should parse lines from GCC 6.3.1 correctly):
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 38,
+ \ 'text': "too many memory references for `mov'",
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 42,
+ \ 'text': "incorrect register `%ax' used with `l' suffix",
+ \ 'type': 'E',
+ \ },
+ \ ],
+ \ ale_linters#asm#gcc#Handle(357, [
+ \ "{standard input}: Assembler messages:",
+ \ "{standard_input}:38: Error: too many memory references for `mov'",
+ \ "{standard input}:42: Error: incorrect register `%ax' used with `l' suffix",
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_atools_handler.vader b/sources_non_forked/ale/test/handler/test_atools_handler.vader
new file mode 100644
index 00000000..1bb9ca00
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_atools_handler.vader
@@ -0,0 +1,85 @@
+Before:
+ runtime autoload/ale/handlers/atools.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The atools handler should handle basic errors or warings):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 2,
+ \ 'text': 'trailing whitespace',
+ \ 'type': 'E',
+ \ 'code': 'AL8',
+ \ },
+ \ {
+ \ 'lnum': 15,
+ \ 'text': '$pkgname should not be used in the source url',
+ \ 'type': 'W',
+ \ 'code': 'AL29',
+ \ },
+ \ ],
+ \ ale#handlers#atools#Handle(bufnr(''), [
+ \ 'IC:[AL8]:APKBUILD:2:trailing whitespace',
+ \ 'MC:[AL29]:APKBUILD:15:$pkgname should not be used in the source url',
+ \ ])
+
+" Regardless of the severity, if the certainty is [P]ossible and not [C]ertain
+" or if regardless of the Certainity the Severity is not [I]mportant or [S]erious
+" then it must be a [W]arning
+Execute(If we are not Certain or Importantly Serious, be a Warning):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 3,
+ \ 'text': 'This violation is Serious but Possible false positive, I am a Warning!',
+ \ 'type': 'W',
+ \ 'code': 'AL',
+ \ },
+ \ {
+ \ 'lnum': 4,
+ \ 'text': 'This violation is Important but Possible false positive, I am a Warning!',
+ \ 'type': 'W',
+ \ 'code': 'AL',
+ \ },
+ \ {
+ \ 'lnum': 5,
+ \ 'text': 'This violation is Minor, I am a Warning!',
+ \ 'type': 'W',
+ \ 'code': 'AL',
+ \ },
+ \ {
+ \ 'lnum': 6,
+ \ 'text': 'This violation is Style, I am a Warning!',
+ \ 'type': 'W',
+ \ 'code': 'AL',
+ \ },
+ \ ],
+ \ ale#handlers#atools#Handle(bufnr(''), [
+ \ 'SP:[AL]:APKBUILD:3:This violation is Serious but Possible false positive, I am a Warning!',
+ \ 'IP:[AL]:APKBUILD:4:This violation is Important but Possible false positive, I am a Warning!',
+ \ 'MC:[AL]:APKBUILD:5:This violation is Minor, I am a Warning!',
+ \ 'TC:[AL]:APKBUILD:6:This violation is Style, I am a Warning!',
+ \ ])
+
+Execute(We should be error if we are Certain it is Serious or Important):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 7,
+ \ 'text': 'This is Certainly Serious, I am an Error!',
+ \ 'type': 'E',
+ \ 'code': 'AL',
+ \ },
+ \ {
+ \ 'lnum': 8,
+ \ 'text': 'This is Certainly Important, I am an Error!',
+ \ 'type': 'E',
+ \ 'code': 'AL',
+ \ },
+ \ ],
+ \ ale#handlers#atools#Handle(bufnr(''), [
+ \ 'SC:[AL]:APKBUILD:7:This is Certainly Serious, I am an Error!',
+ \ 'IC:[AL]:APKBUILD:8:This is Certainly Important, I am an Error!',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_avra_handler.vader b/sources_non_forked/ale/test/handler/test_avra_handler.vader
new file mode 100644
index 00000000..0de83fb8
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_avra_handler.vader
@@ -0,0 +1,24 @@
+Before:
+ runtime ale_linters/avra/avra.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The avra handler should parse errors correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 3,
+ \ 'text': "Unknown device: atmega3228p",
+ \ 'type': 'E'
+ \ },
+ \ {
+ \ 'lnum': 12,
+ \ 'text': "Unknown directive: .EQ",
+ \ 'type': 'E'
+ \ }
+ \ ],
+ \ ale_linters#avra#avra#Handle(bufnr(''), [
+ \ "main.asm(3) : Error : Unknown device: atmega3228p",
+ \ "main.asm(12) : Error : Unknown directive: .EQ"
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_bandit_handler.vader b/sources_non_forked/ale/test/handler/test_bandit_handler.vader
new file mode 100644
index 00000000..a2793a46
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_bandit_handler.vader
@@ -0,0 +1,42 @@
+Before:
+ runtime ale_linters/python/bandit.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The bandit handler for Python should parse input correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'bufnr': 0,
+ \ 'lnum': 2,
+ \ 'code': 'B404',
+ \ 'type': 'I',
+ \ 'text': 'Consider possible security implications associated with subprocess module.',
+ \ },
+ \ {
+ \ 'bufnr': 0,
+ \ 'lnum': 4,
+ \ 'code': 'B305',
+ \ 'type': 'W',
+ \ 'text': 'Use of insecure cipher mode cryptography.hazmat.primitives.ciphers.modes.ECB.',
+ \ },
+ \ {
+ \ 'bufnr': 0,
+ \ 'lnum': 6,
+ \ 'code': 'B609',
+ \ 'type': 'E',
+ \ 'text': 'Possible wildcard injection in call: subprocess.Popen',
+ \ },
+ \ ],
+ \ ale_linters#python#bandit#Handle(0, [
+ \ '[main] INFO profile include tests: None',
+ \ '[main] INFO profile exclude tests: None',
+ \ '[main] INFO cli include tests: None',
+ \ '[main] INFO cli exclude tests: None',
+ \ '[main] INFO running on Python 3.7.2',
+ \ '[node_visitor] INFO Unable to find qualified name for module: ',
+ \ '2:B404:LOW:Consider possible security implications associated with subprocess module.',
+ \ '4:B305:MEDIUM:Use of insecure cipher mode cryptography.hazmat.primitives.ciphers.modes.ECB.',
+ \ '6:B609:HIGH:Possible wildcard injection in call: subprocess.Popen',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_bashate_handler.vader b/sources_non_forked/ale/test/handler/test_bashate_handler.vader
new file mode 100644
index 00000000..b61bb956
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_bashate_handler.vader
@@ -0,0 +1,36 @@
+Before:
+ runtime ale_linters/sh/bashate.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The bashate handler should handle basic errors):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 777,
+ \ 'col': 1,
+ \ 'text': 'E003 Indent not multiple of 4',
+ \ },
+ \ {
+ \ 'lnum': 783,
+ \ 'col': 1,
+ \ 'text': 'E020 Function declaration not in format ^function name {$',
+ \ },
+ \ {
+ \ 'lnum': 786,
+ \ 'col': 1,
+ \ 'text': 'E010 The "do" should be on same line as for',
+ \ },
+ \ {
+ \ 'lnum': 791,
+ \ 'col': 1,
+ \ 'text': 'E006 Line too long',
+ \ },
+ \ ],
+ \ ale_linters#sh#bashate#Handle(bufnr(''), [
+ \ 'run:777:1: E003 Indent not multiple of 4',
+ \ 'run:783:1: E020 Function declaration not in format ^function name {$',
+ \ 'run:786:1: E010 The "do" should be on same line as for',
+ \ 'run:791:1: E006 Line too long',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_bibclean_handler.vader b/sources_non_forked/ale/test/handler/test_bibclean_handler.vader
new file mode 100644
index 00000000..9da52a92
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_bibclean_handler.vader
@@ -0,0 +1,88 @@
+Before:
+ runtime ale_linters/bib/bibclean.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The bibclean handler should parse lines from bibclean <= v2.11.4 correctly):
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': '60',
+ \ 'type': 'W',
+ \ 'text': 'Unexpected value in ``month = "09"''''.',
+ \ 'col': '17'
+ \ },
+ \ {
+ \ 'lnum': '63',
+ \ 'type': 'E',
+ \ 'text': 'Expected comma after last field ``keywords''''.',
+ \ 'col': ' 1'
+ \ },
+ \ {
+ \ 'lnum': '176',
+ \ 'type': 'W',
+ \ 'text': 'Unexpected DOI in URL value ``"https://doi.org/DOI"'''': move to separate DOI = "..." key/value in this entry.',
+ \ 'col': '14'
+ \ }
+ \ ],
+ \ ale_linters#bib#bibclean#Handle(255, [
+ \ "%% \"stdin\", line 60: Unexpected value in ``month = \"09\"''.",
+ \ "%% File positions: input [main.bib] output [stdout]",
+ \ "%% Entry input byte=1681 line=50 column= 1 output byte=1680 line=50 column= 0",
+ \ "%% Value input byte=2137 line=60 column=17 output byte=2137 line=60 column=17",
+ \ "%% Current input byte=2139 line=60 column=19 output byte=2137 line=60 column=17",
+ \ "?? \"stdin\", line 71: Expected comma after last field ``keywords''.",
+ \ "?? File positions: input [main.bib] output [stdout]",
+ \ "?? Entry input byte=2145 line=63 column= 1 output byte=2146 line=63 column= 0",
+ \ "?? Value input byte=2528 line=71 column= 2 output byte=2527 line=70 column=49",
+ \ "?? Current input byte=2529 line=71 column= 3 output byte=2528 line=70 column=50",
+ \ "%% \"stdin\", line 176: Unexpected DOI in URL value ``\"https://doi.org/DOI\"'': move to separate DOI = \"...\" key/value in this entry.",
+ \ "%% File positions: input [stdin] output [stdout]",
+ \ "%% Entry input byte=6813 line=174 column= 1 output byte=8543 line=227 column= 0",
+ \ "%% Value input byte=6890 line=176 column=14 output byte=8641 line=229 column=17",
+ \ "%% Current input byte=6938 line=176 column=62 output byte=8641 line=229 column=17"
+ \ ])
+
+Execute(The bibclean handler should parse lines of bibclean > v2.11.4 correctly):
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': '60',
+ \ 'type': 'W',
+ \ 'text': 'Unexpected value in ``month = "09"''''.',
+ \ 'col': '17'
+ \ },
+ \ {
+ \ 'lnum': '63',
+ \ 'type': 'E',
+ \ 'text': 'Expected comma after last field ``keywords''''.',
+ \ 'col': ' 1'
+ \ },
+ \ {
+ \ 'lnum': '176',
+ \ 'type': 'W',
+ \ 'text': 'Unexpected DOI in URL value ``"https://doi.org/DOI"'''': move to separate DOI = "..." key/value in this entry.',
+ \ 'col': '14'
+ \ }
+ \ ],
+ \ ale_linters#bib#bibclean#Handle(255, [
+ \ "%% stdin:60:Unexpected value in ``month = \"09\"''.",
+ \ "%% File positions: input [main.bib] output [stdout]",
+ \ "%% Entry input byte=1681 line=50 column= 1 output byte=1680 line=50 column= 0",
+ \ "%% Value input byte=2137 line=60 column=17 output byte=2137 line=60 column=17",
+ \ "%% Current input byte=2139 line=60 column=19 output byte=2137 line=60 column=17",
+ \ "?? stdin:71:Expected comma after last field ``keywords''.",
+ \ "?? File positions: input [main.bib] output [stdout]",
+ \ "?? Entry input byte=2145 line=63 column= 1 output byte=2146 line=63 column= 0",
+ \ "?? Value input byte=2528 line=71 column= 2 output byte=2527 line=70 column=49",
+ \ "?? Current input byte=2529 line=71 column= 3 output byte=2528 line=70 column=50",
+ \ "%% stdin:176:Unexpected DOI in URL value ``\"https://doi.org/DOI\"'': move to separate DOI = \"...\" key/value in this entry.",
+ \ "%% File positions: input [stdin] output [stdout]",
+ \ "%% Entry input byte=6813 line=174 column= 1 output byte=8543 line=227 column= 0",
+ \ "%% Value input byte=6890 line=176 column=14 output byte=8641 line=229 column=17",
+ \ "%% Current input byte=6938 line=176 column=62 output byte=8641 line=229 column=17"
+ \ ])
+
diff --git a/sources_non_forked/ale/test/handler/test_bitbake_oelint_adv_handler.vader b/sources_non_forked/ale/test/handler/test_bitbake_oelint_adv_handler.vader
new file mode 100644
index 00000000..a52e8810
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_bitbake_oelint_adv_handler.vader
@@ -0,0 +1,28 @@
+Before:
+ runtime ale_linters/bitbake/oelint_adv.vim
+
+After:
+ Restore
+
+ call ale#linter#Reset()
+
+Execute(The oelint_adv handler should handle warnings):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1234,
+ \ 'type': 'I',
+ \ 'code': 'oelint.var.suggestedvar.BUGTRACKER',
+ \ 'text': 'Variable ''BUGTRACKER'' should be set',
+ \ },
+ \ {
+ \ 'lnum': 17,
+ \ 'type': 'E',
+ \ 'code': 'oelint.var.mandatoryvar.DESCRIPTION',
+ \ 'text': 'Variable ''DESCRIPTION'' should be set',
+ \ },
+ \ ],
+ \ ale_linters#bitbake#oelint_adv#Handle(1, [
+ \ '/meta-x/recipes-y/example/example_1.0.bb:1234:info:oelint.var.suggestedvar.BUGTRACKER:Variable ''BUGTRACKER'' should be set',
+ \ '[31mexample2_1.1.bb:17:error:oelint.var.mandatoryvar.DESCRIPTION:Variable ''DESCRIPTION'' should be set[0m',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_brakeman_handler.vader b/sources_non_forked/ale/test/handler/test_brakeman_handler.vader
new file mode 100644
index 00000000..ad5376f7
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_brakeman_handler.vader
@@ -0,0 +1,83 @@
+Before:
+ call ale#test#SetDirectory('/testplugin/test/handler')
+
+ runtime ale_linters/ruby/brakeman.vim
+
+After:
+ call ale#test#RestoreDirectory()
+ call ale#linter#Reset()
+
+Execute(The brakeman handler should parse JSON correctly):
+ call ale#test#SetFilename('../test-files/ruby/valid_rails_app/app/models/thing.rb')
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'filename': expand('%:p'),
+ \ 'lnum': 84,
+ \ 'text': 'SQL Injection Possible SQL injection (Medium)',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'filename': expand('%:p'),
+ \ 'lnum': 1,
+ \ 'text': 'Mass Assignment Potentially dangerous attribute available for mass assignment (Weak)',
+ \ 'type': 'W',
+ \ }
+ \ ],
+ \ ale_linters#ruby#brakeman#Handle(bufnr(''), [
+ \ '{',
+ \ '"warnings": [',
+ \ '{',
+ \ '"warning_type": "SQL Injection",',
+ \ '"warning_code": 0,',
+ \ '"fingerprint": "1234",',
+ \ '"check_name": "SQL",',
+ \ '"message": "Possible SQL injection",',
+ \ '"file": "' . substitute(ale#path#Simplify('app/models/thing.rb'), '\\', '\\\\', 'g') . '",',
+ \ '"line": 84,',
+ \ '"link": "http://brakemanscanner.org/docs/warning_types/sql_injection/",',
+ \ '"code": "Thing.connection.execute(params[:data])",',
+ \ '"render_path": null,',
+ \ '"location": {',
+ \ '"type": "method",',
+ \ '"class": "Thing",',
+ \ '"method": "run_raw_sql_from_internet"',
+ \ '},',
+ \ '"user_input": "whatever",',
+ \ '"confidence": "Medium"',
+ \ '},',
+ \ '{',
+ \ '"warning_type": "Mass Assignment",',
+ \ '"warning_code": 60,',
+ \ '"fingerprint": "1235",',
+ \ '"check_name": "ModelAttrAccessible",',
+ \ '"message": "Potentially dangerous attribute available for mass assignment",',
+ \ '"file": "' . substitute(ale#path#Simplify('app/models/thing.rb'), '\\', '\\\\', 'g') . '",',
+ \ '"line": null,',
+ \ '"link": "http://brakemanscanner.org/docs/warning_types/mass_assignment/",',
+ \ '"code": ":name",',
+ \ '"render_path": null,',
+ \ '"location": {',
+ \ '"type": "model",',
+ \ '"model": "Thing"',
+ \ '},',
+ \ '"user_input": null,',
+ \ '"confidence": "Weak"',
+ \ '}',
+ \ ']',
+ \ '}'
+ \ ])
+
+Execute(The brakeman handler should parse JSON correctly when there is no output from brakeman):
+ AssertEqual
+ \ [],
+ \ ale_linters#ruby#brakeman#Handle(347, [
+ \ ])
+ \
+Execute(The brakeman handler should handle garbage output):
+ AssertEqual
+ \ [],
+ \ ale_linters#ruby#brakeman#Handle(347, [
+ \ 'No such command in 2.4.1 of ruby',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_cfn_python_lint_handler.vader b/sources_non_forked/ale/test/handler/test_cfn_python_lint_handler.vader
new file mode 100644
index 00000000..2c7ddc62
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_cfn_python_lint_handler.vader
@@ -0,0 +1,33 @@
+Before:
+ runtime! ale_linters/cloudformation/cfn_python_lint.vim
+ call ale#test#SetFilename('sample.template.yaml')
+
+After:
+ call ale#linter#Reset()
+
+Execute(The cfn_python_lint handler should parse items correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': '96',
+ \ 'col': '7',
+ \ 'end_lnum': '96',
+ \ 'end_col': '15',
+ \ 'text': 'Property Resources/Sample/Properties/FromPort should be of type Integer',
+ \ 'code': 'E3012',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': '97',
+ \ 'col': '7',
+ \ 'end_lnum': '97',
+ \ 'end_col': '15',
+ \ 'text': 'AllowedPattern and/or AllowedValues for Parameter should be specified at Parameters/SampleIpAddress. Example for AllowedPattern "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$"',
+ \ 'code': 'W2509',
+ \ 'type': 'W',
+ \ },
+ \ ],
+ \ ale_linters#cloudformation#cfn_python_lint#Handle(bufnr(''), [
+ \ fnamemodify(tempname(), ':h') . '/sample.template.yaml:96:7:96:15:E3012:Property Resources/Sample/Properties/FromPort should be of type Integer',
+ \ fnamemodify(tempname(), ':h') . '/sample.template.yaml:97:7:97:15:W2509:AllowedPattern and/or AllowedValues for Parameter should be specified at Parameters/SampleIpAddress. Example for AllowedPattern "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$"',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_checkmake_handler.vader b/sources_non_forked/ale/test/handler/test_checkmake_handler.vader
new file mode 100644
index 00000000..e2e18425
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_checkmake_handler.vader
@@ -0,0 +1,23 @@
+Before:
+ runtime ale_linters/make/checkmake.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(Parsing checkmake errors should work):
+ silent file Makefile
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'bufnr': 42,
+ \ 'lnum': 1,
+ \ 'type': 'E',
+ \ 'code': 'woops',
+ \ 'text': 'an error has occurred',
+ \ }
+ \ ],
+ \ ale_linters#make#checkmake#Handle(42, [
+ \ 'This shouldnt match',
+ \ '1:woops:an error has occurred',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_checkov_handler.vader b/sources_non_forked/ale/test/handler/test_checkov_handler.vader
new file mode 100644
index 00000000..9884113c
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_checkov_handler.vader
@@ -0,0 +1,66 @@
+Before:
+ runtime ale_linters/terraform/checkov.vim
+ call ale#test#SetFilename('main.tf')
+
+After:
+ call ale#linter#Reset()
+
+Execute(The JSON output of checkov should be handled correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'filename': '/main.tf',
+ \ 'lnum': 22,
+ \ 'end_lnum': 27,
+ \ 'text': 'Enable VPC Flow Logs and Intranode Visibility [CKV_GCP_61]',
+ \ 'detail': "CKV_GCP_61: Enable VPC Flow Logs and Intranode Visibility\n" .
+ \ 'For more information, see: https://docs.bridgecrew.io/docs/enable-vpc-flow-logs-and-intranode-visibility',
+ \ 'type': 'W',
+ \ }
+ \ ],
+ \ ale_linters#terraform#checkov#Handle(bufnr(''), [
+ \'{',
+ \' "check_type": "terraform",',
+ \' "results": {',
+ \' "failed_checks": [',
+ \' {',
+ \' "check_id": "CKV_GCP_61",',
+ \' "bc_check_id": "BC_GCP_KUBERNETES_18",',
+ \' "check_name": "Enable VPC Flow Logs and Intranode Visibility",',
+ \' "check_result": {',
+ \' "result": "FAILED",',
+ \' "evaluated_keys": [',
+ \' "enable_intranode_visibility"',
+ \' ]',
+ \' },',
+ \' "file_path": "/main.tf",',
+ \' "repo_file_path": "/main.tf",',
+ \' "file_line_range": [',
+ \' 22,',
+ \' 27',
+ \' ],',
+ \' "resource": "google_container_cluster.cluster-name",',
+ \' "evaluations": null,',
+ \' "check_class": "checkov.terraform.checks.resource.gcp.GKEEnableVPCFlowLogs",',
+ \' "entity_tags": null,',
+ \' "resource_address": null,',
+ \' "guideline": "https://docs.bridgecrew.io/docs/enable-vpc-flow-logs-and-intranode-visibility"',
+ \' }',
+ \' ]',
+ \' }',
+ \'}'
+ \ ])
+
+Execute(Handle output for no findings correctly):
+ AssertEqual
+ \ [],
+ \ ale_linters#terraform#checkov#Handle(bufnr(''), [
+ \'{',
+ \' "passed": 0,',
+ \' "failed": 0,',
+ \' "skipped": 0,',
+ \' "parsing_errors": 0,',
+ \' "resource_count": 0,',
+ \' "checkov_version": "2.0.632"',
+ \'}'
+ \])
diff --git a/sources_non_forked/ale/test/handler/test_checkstyle_handler.vader b/sources_non_forked/ale/test/handler/test_checkstyle_handler.vader
new file mode 100644
index 00000000..ea90db3f
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_checkstyle_handler.vader
@@ -0,0 +1,53 @@
+Before:
+ runtime ale_linters/java/checkstyle.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The checkstyle handler should parse lines correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 101,
+ \ 'col': 0,
+ \ 'text': '''method def rcurly'' has incorrect indentation level 4, expected level should be 2.',
+ \ 'code': 'Indentation',
+ \ 'type': 'W',
+ \ 'sub_type': 'style',
+ \ },
+ \ {
+ \ 'lnum': 63,
+ \ 'col': 3,
+ \ 'text': 'Missing a Javadoc comment.',
+ \ 'code': 'JavadocMethod',
+ \ 'type': 'W',
+ \ 'sub_type': 'style',
+ \ },
+ \ {
+ \ 'lnum': 11,
+ \ 'col': 7,
+ \ 'text': 'WhitespaceAround: ''if'' is not followed by whitespace.',
+ \ 'code': 'WhitespaceAround',
+ \ 'type': 'W',
+ \ 'sub_type': 'style',
+ \ },
+ \ ],
+ \ ale_linters#java#checkstyle#Handle(666, [
+ \ '[WARN] whatever:101: ''method def rcurly'' has incorrect indentation level 4, expected level should be 2. [Indentation]',
+ \ '[WARN] whatever:63:3: Missing a Javadoc comment. [JavadocMethod]',
+ \ '[WARN] whatever:11:7: WhitespaceAround: ''if'' is not followed by whitespace. [WhitespaceAround]',
+ \ ])
+
+Execute(The checkstyle handler should parse lines from older checkstyle versions correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 289,
+ \ 'text': '''method def modifier'' have incorrect indentation level 4, expected level should be 2.',
+ \ 'type': 'W',
+ \ 'sub_type': 'style',
+ \ },
+ \ ],
+ \ ale_linters#java#checkstyle#Handle(666, [
+ \ '/home/languitar/src/rsb-java/rsb-java/src/main/java/rsb/Listener.java:289: warning: ''method def modifier'' have incorrect indentation level 4, expected level should be 2.',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_circleci_handler.vader b/sources_non_forked/ale/test/handler/test_circleci_handler.vader
new file mode 100644
index 00000000..8ffba360
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_circleci_handler.vader
@@ -0,0 +1,39 @@
+Before:
+ runtime ale_linters/yaml/circleci.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The circlei handler should return nothing when configs are valid):
+ AssertEqual
+ \ [],
+ \ ale_linters#yaml#circleci#Handle(0, [
+ \ 'Config input is valid.',
+ \ ])
+
+Execute(The circlei handler put errors at the top when something is wrong):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'type': 'E',
+ \ 'text': '[#/jobs] expected type: Mapping, found: Integer',
+ \ 'detail': join([
+ \ '[#/jobs] expected type: Mapping, found: Integer',
+ \ 'Jobs is a map',
+ \ 'SCHEMA:',
+ \ ' type: object',
+ \ 'INPUT:',
+ \ ' 4',
+ \ ], "\n"),
+ \ },
+ \ ],
+ \ ale_linters#yaml#circleci#Handle(0, [
+ \ 'Error: ERROR IN CONFIG FILE:',
+ \ '[#/jobs] expected type: Mapping, found: Integer',
+ \ 'Jobs is a map',
+ \ 'SCHEMA:',
+ \ ' type: object',
+ \ 'INPUT:',
+ \ ' 4',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_clang_handler.vader b/sources_non_forked/ale/test/handler/test_clang_handler.vader
new file mode 100644
index 00000000..cc8eabd0
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_clang_handler.vader
@@ -0,0 +1,30 @@
+Execute(clang errors from included files should be parsed correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 1,
+ \ 'filename': './b.h',
+ \ 'type': 'E',
+ \ 'text': 'expected identifier or ''(''',
+ \ },
+ \ {
+ \ 'lnum': 3,
+ \ 'text': 'Error found in header. See :ALEDetail',
+ \ 'detail': join([
+ \ 'In file included from :3:',
+ \ 'In file included from ./a.h:1:',
+ \ './b.h:1:1: error: expected identifier or ''(''',
+ \ '{{{',
+ \ '^',
+ \ ], "\n"),
+ \ },
+ \ ],
+ \ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
+ \ 'In file included from :3:',
+ \ 'In file included from ./a.h:1:',
+ \ './b.h:1:1: error: expected identifier or ''(''',
+ \ '{{{',
+ \ '^',
+ \ '1 error generated.',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_clojure_clj_kondo_handler.vader b/sources_non_forked/ale/test/handler/test_clojure_clj_kondo_handler.vader
new file mode 100644
index 00000000..9ae70668
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_clojure_clj_kondo_handler.vader
@@ -0,0 +1,89 @@
+Before:
+ runtime ale_linters/clojure/clj_kondo.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(the clojure clj-kondo handler should be able to handle errors):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 123,
+ \ 'col': 44,
+ \ 'type': 'E',
+ \ 'text': 'error: Unexpected )',
+ \ },
+ \ ],
+ \ ale_linters#clojure#clj_kondo#HandleCljKondoFormat(0, [
+ \ 'test.clj:123:44: error: Unexpected )',
+ \ ])
+
+Execute(the clojure clj-kondo handler should be able to handle warnings):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 654,
+ \ 'col': 321,
+ \ 'type': 'W',
+ \ 'text': 'warning: inline def',
+ \ }
+ \ ],
+ \ ale_linters#clojure#clj_kondo#HandleCljKondoFormat(0, [
+ \ 'test.clj:654:321: warning: inline def'
+ \ ])
+
+Execute(the clojure clj-kondo handler should be able to handle exceptions):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 123,
+ \ 'col': 321,
+ \ 'type': 'E',
+ \ 'text': 'Exception: something horrible happen',
+ \ }
+ \ ],
+ \ ale_linters#clojure#clj_kondo#HandleCljKondoFormat(0, [
+ \ 'test.clj:123:321: Exception: something horrible happen'
+ \ ])
+
+Execute(the clojure clj-kondo handler should be able to handle errors from stdin):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 16,
+ \ 'col': 1,
+ \ 'type': 'E',
+ \ 'text': 'error: Unexpected )',
+ \ },
+ \ ],
+ \ ale_linters#clojure#clj_kondo#HandleCljKondoFormat(0, [
+ \ ':16:1: error: Unexpected )',
+ \ ])
+
+Execute(the clojure clj-kondo handler should be able to handle windows files):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 123,
+ \ 'col': 44,
+ \ 'type': 'E',
+ \ 'text': 'error: Unexpected )',
+ \ }
+ \ ],
+ \ ale_linters#clojure#clj_kondo#HandleCljKondoFormat(0, [
+ \ 'C:\my\operating\system\is\silly\core.clj:123:44: error: Unexpected )',
+ \ ])
+
+Execute(the clojure clj-kondo handler should be able to lines without row/col):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 0,
+ \ 'col': 0,
+ \ 'type': 'E',
+ \ 'text': 'error: Unexpected )',
+ \ },
+ \ ],
+ \ ale_linters#clojure#clj_kondo#HandleCljKondoFormat(0, [
+ \ 'test.clj::: error: Unexpected )',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_clojure_joker_handler.vader b/sources_non_forked/ale/test/handler/test_clojure_joker_handler.vader
new file mode 100644
index 00000000..460c62e8
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_clojure_joker_handler.vader
@@ -0,0 +1,75 @@
+Before:
+ runtime ale_linters/clojure/joker.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(the clojure joker handler should be able to handle errors):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 123,
+ \ 'col': 44,
+ \ 'type': 'E',
+ \ 'text': 'Read error: Unexpected )',
+ \ },
+ \ ],
+ \ ale_linters#clojure#joker#HandleJokerFormat(0, [
+ \ 'test.clj:123:44: Read error: Unexpected )',
+ \ ])
+
+Execute(the clojure joker handler should be able to handle warnings):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 654,
+ \ 'col': 321,
+ \ 'type': 'W',
+ \ 'text': 'Parse warning: let form with empty body',
+ \ }
+ \ ],
+ \ ale_linters#clojure#joker#HandleJokerFormat(0, [
+ \ 'test.clj:654:321: Parse warning: let form with empty body'
+ \ ])
+
+Execute(the clojure joker handler should be able to handle exceptions):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 123,
+ \ 'col': 321,
+ \ 'type': 'E',
+ \ 'text': 'Exception: something horrible happen',
+ \ }
+ \ ],
+ \ ale_linters#clojure#joker#HandleJokerFormat(0, [
+ \ 'test.clj:123:321: Exception: something horrible happen'
+ \ ])
+
+Execute(the clojure joker handler should be able to handle errors from stdin):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 16,
+ \ 'col': 1,
+ \ 'type': 'E',
+ \ 'text': 'Read error: Unexpected )',
+ \ },
+ \ ],
+ \ ale_linters#clojure#joker#HandleJokerFormat(0, [
+ \ ':16:1: Read error: Unexpected )',
+ \ ])
+
+Execute(the clojure joker handler should be able to handle windows files):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 123,
+ \ 'col': 44,
+ \ 'type': 'E',
+ \ 'text': 'Read error: Unexpected )',
+ \ }
+ \ ],
+ \ ale_linters#clojure#joker#HandleJokerFormat(0, [
+ \ 'C:\my\operating\system\is\silly\core.clj:123:44: Read error: Unexpected )',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_cmake_lint_handler.vader b/sources_non_forked/ale/test/handler/test_cmake_lint_handler.vader
new file mode 100644
index 00000000..26fb8c1d
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_cmake_lint_handler.vader
@@ -0,0 +1,30 @@
+Before:
+ runtime ale_linters/cmake/cmake_lint.vim
+
+After:
+ Restore
+
+ call ale#linter#Reset()
+
+Execute(The cmake_lint handler should handle basic warnings):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 126,
+ \ 'col': 0,
+ \ 'type': 'W',
+ \ 'code': 'C0301',
+ \ 'text': 'Line too long (136/80)',
+ \ },
+ \ {
+ \ 'lnum': 139,
+ \ 'col': 4,
+ \ 'type': 'W',
+ \ 'code': 'C0113',
+ \ 'text': 'Missing COMMENT in statement which allows it',
+ \ },
+ \ ],
+ \ ale_linters#cmake#cmake_lint#Handle(1, [
+ \ 'CMakeLists.txt:126: [C0301] Line too long (136/80)',
+ \ 'CMakeLists.txt:139,04: [C0113] Missing COMMENT in statement which allows it',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_coffeelint_handler.vader b/sources_non_forked/ale/test/handler/test_coffeelint_handler.vader
new file mode 100644
index 00000000..a061f3a9
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_coffeelint_handler.vader
@@ -0,0 +1,20 @@
+Before:
+ runtime ale_linters/coffee/coffeelint.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The coffeelint handler should parse lines correctly):
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 125,
+ \ 'text': "Line exceeds maximum allowed length Length is 122, max is 120.",
+ \ 'type': 'E',
+ \ },
+ \ ],
+ \ ale_linters#coffee#coffeelint#Handle(347, [
+ \ "path,lineNumber,lineNumberEnd,level,message",
+ \ "stdin,125,,error,Line exceeds maximum allowed length Length is 122, max is 120.",
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_common_handlers.vader b/sources_non_forked/ale/test/handler/test_common_handlers.vader
new file mode 100644
index 00000000..ee29da36
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_common_handlers.vader
@@ -0,0 +1,181 @@
+Execute(HandleCSSLintFormat should handle CSS errors):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 1,
+ \ 'type': 'E',
+ \ 'text': 'Expected RBRACE at line 2, col 1.',
+ \ 'code': 'errors',
+ \ },
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 5,
+ \ 'type': 'W',
+ \ 'text': 'Expected ... but found ''wat''.',
+ \ 'code': 'known-properties',
+ \ },
+ \ ],
+ \ ale#handlers#css#HandleCSSLintFormat(42, [
+ \ 'something.css: line 2, col 1, Error - Expected RBRACE at line 2, col 1. (errors)',
+ \ 'something.css: line 2, col 5, Warning - Expected ... but found ''wat''. (known-properties)',
+ \ ])
+
+Execute(HandleCSSLintFormat should handle CSS errors without groups):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 7,
+ \ 'col': 3,
+ \ 'type': 'W',
+ \ 'text': 'Unknown property ''fill''.',
+ \ },
+ \ {
+ \ 'lnum': 8,
+ \ 'col': 3,
+ \ 'type': 'W',
+ \ 'text': 'Unknown property ''fill-opacity''.',
+ \ },
+ \ ],
+ \ ale#handlers#css#HandleCSSLintFormat(42, [
+ \ 'something.css: line 7, col 3, Warning - Unknown property ''fill''.',
+ \ 'something.css: line 8, col 3, Warning - Unknown property ''fill-opacity''.',
+ \ ])
+
+Execute (HandleGCCFormat should handle the correct lines of output):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 8,
+ \ 'col': 5,
+ \ 'type': 'W',
+ \ 'text': 'conversion lacks type at end of format [-Wformat=]',
+ \ },
+ \ {
+ \ 'lnum': 10,
+ \ 'col': 27,
+ \ 'type': 'E',
+ \ 'text': 'invalid operands to binary - (have ''int'' and ''char *'')',
+ \ },
+ \ ],
+ \ ale#handlers#gcc#HandleGCCFormat(42, [
+ \ ':8:5: warning: conversion lacks type at end of format [-Wformat=]',
+ \ ':10:27: error: invalid operands to binary - (have ‘int’ and ‘char *’)',
+ \ ])
+
+Execute (HandleGCCFormat should replace Unicode quotes):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 8,
+ \ 'col': 5,
+ \ 'type': 'W',
+ \ 'text': "'''' \"\"",
+ \ },
+ \ ],
+ \ ale#handlers#gcc#HandleGCCFormat(42, [':8:5: warning: `´‘’ “”'])
+
+Execute (HandleUnixFormatAsError should handle some example lines of output):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 27,
+ \ 'col': 0,
+ \ 'type': 'E',
+ \ 'text': 'missing argument for Printf("%s"): format reads arg 2, have only 1 args',
+ \ },
+ \ {
+ \ 'lnum': 53,
+ \ 'col': 10,
+ \ 'type': 'E',
+ \ 'text': 'if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)',
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 1,
+ \ 'type': 'E',
+ \ 'text': '".b" is not a valid class name. Class names must begin with "-", "_" or a letter and can only contain "_", "-", a-z and 0-9.',
+ \ },
+ \ ],
+ \ ale#handlers#unix#HandleAsError(42, [
+ \ 'file.go:27: missing argument for Printf("%s"): format reads arg 2, have only 1 args',
+ \ 'file.go:53:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)',
+ \ 'test.pug:1:1 ".b" is not a valid class name. Class names must begin with "-", "_" or a letter and can only contain "_", "-", a-z and 0-9.',
+ \ ])
+
+Execute (HandleUnixFormatAsError should handle lines with no space after the colon):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 27,
+ \ 'col': 0,
+ \ 'type': 'E',
+ \ 'text': 'foo',
+ \ },
+ \ {
+ \ 'lnum': 53,
+ \ 'col': 10,
+ \ 'type': 'E',
+ \ 'text': 'bar',
+ \ },
+ \ ],
+ \ ale#handlers#unix#HandleAsError(42, [
+ \ 'some_file.xyz:27:foo',
+ \ 'some_file.xyz:53:10:bar',
+ \ ])
+
+Execute (HandleUnixFormatAsError should handle names with spaces):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 13,
+ \ 'col': 90,
+ \ 'type': 'E',
+ \ 'text': 'leonard.exclamation.30ppm More than 30 ppm of exclamations. Keep them under control.',
+ \ },
+ \ ],
+ \ ale#handlers#unix#HandleAsError(42, [
+ \ '/Users/rrj/Notes/Astro/Taurus December SM.txt:13:90: leonard.exclamation.30ppm More than 30 ppm of exclamations. Keep them under control.',
+ \ ])
+
+Execute (HandleUnixFormatAsWarning should handle some example lines of output):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 27,
+ \ 'col': 0,
+ \ 'type': 'W',
+ \ 'text': 'missing argument for Printf("%s"): format reads arg 2, have only 1 args',
+ \ },
+ \ {
+ \ 'lnum': 53,
+ \ 'col': 10,
+ \ 'type': 'W',
+ \ 'text': 'if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)',
+ \ },
+ \ ],
+ \ ale#handlers#unix#HandleAsWarning(42, [
+ \ 'file.go:27: missing argument for Printf("%s"): format reads arg 2, have only 1 args',
+ \ 'file.go:53:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)',
+ \ ])
+
+Execute (Unix format functions should handle Windows paths):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 27,
+ \ 'col': 0,
+ \ 'type': 'E',
+ \ 'text': 'foo',
+ \ },
+ \ {
+ \ 'lnum': 53,
+ \ 'col': 10,
+ \ 'type': 'E',
+ \ 'text': 'foo',
+ \ },
+ \ ],
+ \ ale#handlers#unix#HandleAsError(42, [
+ \ 'C:\Users\w0rp\AppData\Local\Temp\Xyz123.go:27: foo',
+ \ 'C:\Users\w0rp\AppData\Local\Temp\Xyz123.go:53:10: foo',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_cookstyle_handler.vader b/sources_non_forked/ale/test/handler/test_cookstyle_handler.vader
new file mode 100644
index 00000000..7d705a19
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_cookstyle_handler.vader
@@ -0,0 +1,22 @@
+Before:
+ runtime ale_linters/chef/cookstyle.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(Basic warnings should be handled):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 58,
+ \ 'col': 24,
+ \ 'code': 'Style/UnneededInterpolation',
+ \ 'type': 'W',
+ \ 'end_col': 40,
+ \ 'text': 'Style/UnneededInterpolation: Prefer `to_s` over string interpolation.',
+ \ }
+ \ ],
+ \ ale_linters#chef#cookstyle#Handle(bufnr(''), [
+ \ '{"metadata":{"rubocop_version":"0.62.0","ruby_engine":"ruby","ruby_version":"2.6.0","ruby_patchlevel":"0","ruby_platform":"x86_64-linux"},"files":[{"path":"recipes/default.rb","offenses":[{"severity":"convention","message":"Style/UnneededInterpolation: Prefer `to_s` over string interpolation.","cop_name":"Style/UnneededInterpolation","corrected":false,"location":{"start_line":58,"start_column":24,"last_line":58,"last_column":40,"length":17,"line":58,"column":24}}]}],"summary":{"offense_count":1,"target_file_count":1,"inspected_file_count":1}}'
+ \ ])
+
diff --git a/sources_non_forked/ale/test/handler/test_cppcheck_handler.vader b/sources_non_forked/ale/test/handler/test_cppcheck_handler.vader
new file mode 100644
index 00000000..ef161f44
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_cppcheck_handler.vader
@@ -0,0 +1,93 @@
+Before:
+ call ale#test#SetDirectory('/testplugin/test/handler')
+
+After:
+ call ale#test#RestoreDirectory()
+
+Execute(Basic errors should be handled by cppcheck):
+ call ale#test#SetFilename('test.cpp')
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 974,
+ \ 'col' : 6,
+ \ 'type': 'E',
+ \ 'sub_type': '',
+ \ 'text': 'Array ''n[3]'' accessed at index 3, which is out of bounds.',
+ \ 'code': 'arrayIndexOutOfBounds'
+ \ },
+ \ {
+ \ 'lnum': 1185,
+ \ 'col' : 10,
+ \ 'type': 'W',
+ \ 'sub_type': 'style',
+ \ 'text': 'The scope of the variable ''indxStr'' can be reduced.',
+ \ 'code': 'variableScope'
+ \ },
+ \ ],
+ \ ale#handlers#cppcheck#HandleCppCheckFormat(bufnr(''), [
+ \ 'test.cpp:974:6: error: Array ''n[3]'' accessed at index 3, which is out of bounds. [arrayIndexOutOfBounds]\',
+ \ ' n[3]=3;',
+ \ ' ^',
+ \ 'test.cpp:1185:10: style: The scope of the variable ''indxStr'' can be reduced. [variableScope]\',
+ \ ' char indxStr[16];',
+ \ ' ^',
+ \ ])
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 974,
+ \ 'col' : 1,
+ \ 'type': 'E',
+ \ 'sub_type': '',
+ \ 'text': 'inconclusive Array ''n[3]'' accessed at index 3, which is out of bounds.',
+ \ 'code': 'arrayIndexOutOfBounds'
+ \ },
+ \ {
+ \ 'lnum': 1185,
+ \ 'col' : 1,
+ \ 'type': 'W',
+ \ 'sub_type': 'style',
+ \ 'text': 'The scope of the variable ''indxStr'' can be reduced.',
+ \ 'code': 'variableScope'
+ \ },
+ \ ],
+ \ ale#handlers#cppcheck#HandleCppCheckFormat(bufnr(''), [
+ \ 'test.cpp:974:{column}: error:inconclusive Array ''n[3]'' accessed at index 3, which is out of bounds. [arrayIndexOutOfBounds]\',
+ \ ' n[3]=3;',
+ \ ' ^',
+ \ 'test.cpp:1185:{column}: style:{inconclusive:inconclusive} The scope of the variable ''indxStr'' can be reduced. [variableScope]\',
+ \ ' char indxStr[16];',
+ \ ' ^',
+ \ ])
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col' : 16,
+ \ 'type': 'W',
+ \ 'sub_type': 'style',
+ \ 'text': 'misra violation (use --rule-texts= to get proper output)',
+ \ 'code': 'misra-c2012-2.7'
+ \ },
+ \ ],
+ \ ale#handlers#cppcheck#HandleCppCheckFormat(bufnr(''), [
+ \ 'test.cpp:1:16: style: misra violation (use --rule-texts= to get proper output) [misra-c2012-2.7]\',
+ \ 'void test( int parm ) {}',
+ \ ' ^',
+ \ ])
+
+Execute(Problems from other files should be ignored by cppcheck):
+ call ale#test#SetFilename('test.cpp')
+
+ AssertEqual
+ \ [
+ \ ],
+ \ ale#handlers#cppcheck#HandleCppCheckFormat(bufnr(''), [
+ \ 'bar.cpp:974:6: error: Array ''n[3]'' accessed at index 3, which is out of bounds. [arrayIndexOutOfBounds]\',
+ \ ' n[3]=3;',
+ \ ' ^',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_cpplint_handler.vader b/sources_non_forked/ale/test/handler/test_cpplint_handler.vader
new file mode 100644
index 00000000..d8d7b8b7
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_cpplint_handler.vader
@@ -0,0 +1,29 @@
+Before:
+ runtime ale_linters/cpp/cpplint.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(cpplint warnings from included files should be parsed correctly):
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 5,
+ \ 'col': 0,
+ \ 'text': 'Extra space after ( in function call',
+ \ 'code': 'whitespace/parents',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'lnum': 120,
+ \ 'col': 0,
+ \ 'text': 'At least two spaces is best between code and comments',
+ \ 'code': 'whitespace/comments',
+ \ 'type': 'W',
+ \ },
+ \ ],
+ \ ale#handlers#cpplint#HandleCppLintFormat(347, [
+ \ 'test.cpp:5: Extra space after ( in function call [whitespace/parents] [4]',
+ \ 'keymap_keys.hpp:120: At least two spaces is best between code and comments [whitespace/comments] [2]',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_credo_handler.vader b/sources_non_forked/ale/test/handler/test_credo_handler.vader
new file mode 100644
index 00000000..1fd54bb5
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_credo_handler.vader
@@ -0,0 +1,53 @@
+Before:
+ runtime ale_linters/elixir/credo.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The credo handler should parse lines correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'bufnr': 347,
+ \ 'lnum': 1,
+ \ 'col': 24,
+ \ 'text': 'This code can be refactored',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'bufnr': 347,
+ \ 'lnum': 1,
+ \ 'col': 4,
+ \ 'text': 'There is no whitespace around parentheses/brackets most of the time, but here there is.',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'bufnr': 347,
+ \ 'lnum': 5,
+ \ 'col': 21,
+ \ 'text': 'TODO comment',
+ \ 'type': 'I',
+ \ },
+ \ {
+ \ 'bufnr': 347,
+ \ 'lnum': 26,
+ \ 'col': 0,
+ \ 'text': 'If/else blocks should not have a negated condition in `if`.',
+ \ 'type': 'I',
+ \ },
+ \ {
+ \ 'bufnr': 347,
+ \ 'lnum': 15,
+ \ 'col': 1,
+ \ 'text': 'Warning in the code',
+ \ 'type': 'W',
+ \ },
+ \ ],
+ \ ale_linters#elixir#credo#Handle(347, [
+ \ 'This line should be ignored completely',
+ \ 'lib/my_code/test.ex:1:24: F: This code can be refactored',
+ \ 'lib/filename.ex:1:4: C: There is no whitespace around parentheses/brackets most of the time, but here there is.',
+ \ 'lib/my_code/test.ex:5:21: D: TODO comment',
+ \ 'lib/phoenix/channel.ex:26: R: If/else blocks should not have a negated condition in `if`.',
+ \ 'lib/my_code/test.ex:15:1: W: Warning in the code',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_crystal_handler.vader b/sources_non_forked/ale/test/handler/test_crystal_handler.vader
new file mode 100644
index 00000000..209632e9
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_crystal_handler.vader
@@ -0,0 +1,28 @@
+Before:
+ runtime ale_linters/crystal/crystal.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The crystal handler should parse lines correctly and add the column if it can):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 1,
+ \ 'text': 'unexpected token: EOF'
+ \ }
+ \ ],
+ \ ale_linters#crystal#crystal#Handle(255, [
+ \ '[{"file":"/tmp/test.cr","line":2,"column":1,"size":null,"message":"unexpected token: EOF"}]'
+ \ ])
+
+Execute(The crystal handler should not fail when a missing file is required):
+ AssertEqual
+ \ [ { 'lnum':1, 'col': 1, 'text': 'while requiring "./nonexistent.cr"' } ],
+ \ ale_linters#crystal#crystal#Handle(255,
+ \ json_encode([
+ \ { "file":"/tmp/file.cr","line":1,"column":1,"size":0,"message":"while requiring \"./nonexistent.cr\"" },
+ \ { "message": "can't find file './nonexistent.cr' relative to '/tmp'" },
+ \ ])
+ \ )
diff --git a/sources_non_forked/ale/test/handler/test_csc_handler.vader b/sources_non_forked/ale/test/handler/test_csc_handler.vader
new file mode 100644
index 00000000..3db5b6fd
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_csc_handler.vader
@@ -0,0 +1,98 @@
+Before:
+ Save g:ale_cs_csc_source
+
+ unlet! g:ale_cs_csc_source
+
+ call ale#test#SetDirectory('/testplugin/test/handler')
+ call ale#test#SetFilename('Test.cs')
+
+ runtime ale_linters/cs/csc.vim
+
+After:
+ unlet! g:ale_cs_csc_source
+
+ call ale#test#RestoreDirectory()
+ call ale#linter#Reset()
+
+Execute(The csc handler should work with the default of the buffer's directory):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 12,
+ \ 'col' : 29,
+ \ 'text': '; expected',
+ \ 'code': 'CS1001',
+ \ 'type': 'E',
+ \ 'filename': ale#path#Simplify(g:dir . '/Test.cs'),
+ \ },
+ \ ],
+ \ ale_linters#cs#csc#Handle(bufnr(''), [
+ \ 'Test.cs(12,29): error CS1001: ; expected',
+ \ 'Compilation failed: 2 error(s), 1 warnings',
+ \ ])
+
+Execute(The csc handler should handle cannot find symbol errors):
+ let g:ale_cs_csc_source = '/home/foo/project/bar'
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 12,
+ \ 'col' : 29,
+ \ 'text': '; expected',
+ \ 'code': 'CS1001',
+ \ 'type': 'E',
+ \ 'filename': ale#path#Simplify('/home/foo/project/bar/Test.cs'),
+ \ },
+ \ {
+ \ 'lnum': 101,
+ \ 'col': 0,
+ \ 'text': 'Unexpected processor directive (no #if for this #endif)',
+ \ 'code': 'CS1028',
+ \ 'type': 'E',
+ \ 'filename': ale#path#Simplify('/home/foo/project/bar/Test.cs'),
+ \ },
+ \ {
+ \ 'lnum': 10,
+ \ 'col': 12,
+ \ 'text': 'some warning',
+ \ 'code': 'CS0123',
+ \ 'type': 'W',
+ \ 'filename': ale#path#Simplify('/home/foo/project/bar/Test.cs'),
+ \ },
+ \ ],
+ \ ale_linters#cs#csc#Handle(bufnr(''), [
+ \ 'Test.cs(12,29): error CS1001: ; expected',
+ \ 'Test.cs(101,0): error CS1028: Unexpected processor directive (no #if for this #endif)',
+ \ 'Test.cs(10,12): warning CS0123: some warning',
+ \ 'Compilation failed: 2 error(s), 1 warnings',
+ \ ])
+
+Execute(The csc handler should handle non file specific compiler errors without reporting overal status report as error):
+ let g:ale_cs_csc_source = '/home/foo/project/bar'
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': -1,
+ \ 'col' : -1,
+ \ 'text': 'No source files specified.',
+ \ 'code': 'CS2008',
+ \ 'type': 'W',
+ \ 'filename': '',
+ \ },
+ \ {
+ \ 'lnum': -1,
+ \ 'col': -1,
+ \ 'text': 'Outputs without source must have the /out option specified',
+ \ 'code': 'CS1562',
+ \ 'type': 'E',
+ \ 'filename': '',
+ \ },
+ \ ],
+ \ ale_linters#cs#csc#Handle(bufnr(''), [
+ \ 'Microsoft (R) Visual C# Compiler version 2.8.2.62916 (2ad4aabc)',
+ \ 'Copyright (C) Microsoft Corporation. All rights reserved.',
+ \ 'warning CS2008: No source files specified.',
+ \ 'error CS1562: Outputs without source must have the /out option specified',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_cspell_handler.vader b/sources_non_forked/ale/test/handler/test_cspell_handler.vader
new file mode 100644
index 00000000..b74b8d22
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_cspell_handler.vader
@@ -0,0 +1,13 @@
+Execute(The cspell handler should handle cspell output):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 721,
+ \ 'col': 18,
+ \ 'type': 'W',
+ \ 'text': 'Unknown word (stylelint)',
+ \ },
+ \ ],
+ \ ale#handlers#cspell#Handle(bufnr(''),
+ \ '/:721:18 - Unknown word (stylelint)'
+ \)
diff --git a/sources_non_forked/ale/test/handler/test_cucumber_handler.vader b/sources_non_forked/ale/test/handler/test_cucumber_handler.vader
new file mode 100644
index 00000000..2b69a784
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_cucumber_handler.vader
@@ -0,0 +1,18 @@
+Before:
+ runtime ale_linters/cucumber/cucumber.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The cucumber handler parses JSON correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 13,
+ \ 'code': 'E',
+ \ 'text': 'Undefined step'
+ \ }
+ \ ],
+ \ ale_linters#cucumber#cucumber#Handle(bufnr(''), [
+ \ '[{"elements": [{"steps": [{"result": {"status": "undefined"},"match": {"location": "features/cuke.feature:13"},"line": 13,"name": "Something undefined","keyword": "Given "},{"result": {"status": "skipped"},"match": {"location": "/var/lib/gems/2.3.0/gems/cucumber-3.1.0/lib/cucumber/step_match.rb:103"},"line": 14,"name": "I visit the profile page for Alice","keyword": "When "}],"type": "scenario","line": 12,"description": "","name": "Another scenario","keyword": "Scenario","id": "a-user-can-view-another-users-profile;another-scenario"}],"line": 1,"description": "","name": "A user can view another users profile","keyword": "Feature","id": "a-user-can-view-another-users-profile","uri": "features/cuke.feature"}]'
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_cuda_nvcc_handler.vader b/sources_non_forked/ale/test/handler/test_cuda_nvcc_handler.vader
new file mode 100644
index 00000000..40e31922
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_cuda_nvcc_handler.vader
@@ -0,0 +1,41 @@
+Before:
+ runtime ale_linters/cuda/nvcc.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The cuda nvcc handler should parse errors from multiple files for NVCC 8.0):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'type': 'E',
+ \ 'text': 'this declaration has no storage class or type specifier',
+ \ 'filename': has('win32')
+ \ ? 'C:\tmp\cudatest\test.cu'
+ \ : '/tmp/cudatest/test.cu',
+ \ },
+ \ {
+ \ 'lnum': 2,
+ \ 'type': 'E',
+ \ 'text': 'attribute "global" does not apply here',
+ \ 'filename': has('win32')
+ \ ? 'C:\tmp\cudatest\common.h'
+ \ : '/tmp/cudatest/common.h',
+ \ },
+ \ {
+ \ 'lnum': 2,
+ \ 'type': 'E',
+ \ 'text': 'expected a ";"',
+ \ 'filename': has('win32')
+ \ ? 'C:\tmp\cudatest\common.h'
+ \ : '/tmp/cudatest/common.h',
+ \ },
+ \ ],
+ \ ale_linters#cuda#nvcc#HandleNVCCFormat(0, [
+ \ '/tmp/cudatest/test.cu(1): error: this declaration has no storage class or type specifier',
+ \ '/tmp/cudatest/common.h(2): error: attribute "global" does not apply here',
+ \ '/tmp/cudatest/common.h(2): error: expected a ";"',
+ \ 'At end of source: warning: parsing restarts here after previous syntax error',
+ \ '3 errors detected in the compilation of "/tmp/tmpxft_00003a9f_00000000-7_test.cpp1.ii".',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_cypher_lint_handler.vader b/sources_non_forked/ale/test/handler/test_cypher_lint_handler.vader
new file mode 100644
index 00000000..066adae4
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_cypher_lint_handler.vader
@@ -0,0 +1,21 @@
+Before:
+ runtime ale_linters/cypher/cypher_lint.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The cypher-lint handler should handle errors for the current file correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 75,
+ \ 'type': 'E',
+ \ 'text': "Invalid input ',': expected an identifier, shortestPath, allShortestPaths or '('",
+ \ },
+ \ ],
+ \ ale_linters#cypher#cypher_lint#Handle(bufnr(''), [
+ \ "shakespeare.cql:1:75: Invalid input ',': expected an identifier, shortestPath, allShortestPaths or '('",
+ \ "CREATE (shakespeare:Author {firstname:'William', lastname:'Shakespeare'}),,",
+ \ " ^",
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_dafny_handler.vader b/sources_non_forked/ale/test/handler/test_dafny_handler.vader
new file mode 100644
index 00000000..4ca288d2
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_dafny_handler.vader
@@ -0,0 +1,36 @@
+Before:
+ runtime ale_linters/dafny/dafny.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The Dafny handler should parse output correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'filename': 'File.dfy',
+ \ 'col': 45,
+ \ 'lnum': 123,
+ \ 'text': 'A precondition for this call might not hold.',
+ \ 'type': 'E'
+ \ },
+ \ {
+ \ 'filename': 'File.dfy',
+ \ 'col': 90,
+ \ 'lnum': 678,
+ \ 'text': 'This is the precondition that might not hold.',
+ \ 'type': 'W'
+ \ },
+ \ {
+ \ 'filename': 'File.dfy',
+ \ 'col': 45,
+ \ 'lnum': 123,
+ \ 'text': "Verification of 'Impl$$_22_Proof.__default.PutKeepsMapsFull' timed out after 2 seconds",
+ \ 'type': 'E'
+ \ },
+ \ ],
+ \ ale_linters#dafny#dafny#Handle(0, [
+ \ 'File.dfy(123,45): Error BP5002: A precondition for this call might not hold.',
+ \ 'File.dfy(678,90): Related location: This is the precondition that might not hold.',
+ \ "File.dfy(123,45): Verification of 'Impl$$_22_Proof.__default.PutKeepsMapsFull' timed out after 2 seconds",
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_dart_analyze_handler.vader b/sources_non_forked/ale/test/handler/test_dart_analyze_handler.vader
new file mode 100644
index 00000000..b3f20fb8
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_dart_analyze_handler.vader
@@ -0,0 +1,28 @@
+Before:
+ runtime ale_linters/dart/dart_analyze.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(Basic problems should be parsed correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'type': 'E',
+ \ 'text': 'expected_token: Expected to find ''}''',
+ \ 'lnum': 5,
+ \ 'col': 1,
+ \ },
+ \ {
+ \ 'type': 'W',
+ \ 'text': 'invalid_assignment: A value of type ''String'' can''t be assigned to a variable of type ''int''',
+ \ 'lnum': 2,
+ \ 'col': 16,
+ \ },
+ \ ],
+ \ ale_linters#dart#dart_analyze#Handle(bufnr(''), [
+ \ 'Analyzing main.dart...',
+ \ ' error - main.dart:5:1 - Expected to find ''}'' - expected_token',
+ \ ' warning - main.dart:2:16 - A value of type ''String'' can''t be assigned to a variable of type ''int'' - invalid_assignment',
+ \ '1 error and 1 warning found.',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_debride_handler.vader b/sources_non_forked/ale/test/handler/test_debride_handler.vader
new file mode 100644
index 00000000..62851468
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_debride_handler.vader
@@ -0,0 +1,27 @@
+Before:
+ runtime ale_linters/ruby/debride.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The debride linter parses output correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 2,
+ \ 'text': 'Possible unused method: image_tags',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'lnum': 7,
+ \ 'text': 'Possible unused method: not_deleted',
+ \ 'type': 'W',
+ \ }
+ \ ],
+ \ ale_linters#ruby#debride#HandleOutput(0, [
+ \ 'These methods MIGHT not be called:',
+ \ '',
+ \ 'Image',
+ \ ' image_tags app/models/image.rb:2',
+ \ ' not_deleted app/models/image.rb:7'
+ \])
diff --git a/sources_non_forked/ale/test/handler/test_desktop_file_validate_handler.vader b/sources_non_forked/ale/test/handler/test_desktop_file_validate_handler.vader
new file mode 100644
index 00000000..88163433
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_desktop_file_validate_handler.vader
@@ -0,0 +1,26 @@
+Before:
+ runtime ale_linters/desktop/desktop_file_validate.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The desktop-file-validate handler should parse lines correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 1,
+ \ 'type': 'W',
+ \ 'text': 'key "TerminalOptions" in group "Desktop Entry" is deprecated',
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 1,
+ \ 'type': 'E',
+ \ 'text': 'action "new-private-window" is defined, but there is no matching "Desktop Action new-private-window" group',
+ \ },
+ \ ],
+ \ ale_linters#desktop#desktop_file_validate#Handle(bufnr(''), [
+ \ 'foo.desktop: warning: key "TerminalOptions" in group "Desktop Entry" is deprecated',
+ \ 'foo.desktop: error: action "new-private-window" is defined, but there is no matching "Desktop Action new-private-window" group',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_dmd_handler.vader b/sources_non_forked/ale/test/handler/test_dmd_handler.vader
new file mode 100644
index 00000000..32a04982
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_dmd_handler.vader
@@ -0,0 +1,41 @@
+Before:
+ runtime ale_linters/d/dmd.vim
+ call ale#test#SetDirectory('/testplugin/test/dmd')
+ call ale#test#SetFilename('test.d')
+
+After:
+ call ale#linter#Reset()
+ call ale#test#RestoreDirectory()
+
+Execute(Basic errors should be handled by dmd):
+ AssertEqual
+ \ [
+ \ {
+ \ 'filename': ale#path#Simplify(g:dir . '/test.d'),
+ \ 'lnum': '5',
+ \ 'col' : '8',
+ \ 'type': 'E',
+ \ 'text': 'module weak_reference is in file ''dstruct/weak_reference.d'' which cannot be read'
+ \ },
+ \ {
+ \ 'filename': ale#path#Simplify(g:dir . '/test.d'),
+ \ 'lnum': '20',
+ \ 'col' : '10',
+ \ 'type': 'W',
+ \ 'text': 'function test.thisoldfunc is deprecated'
+ \ },
+ \ {
+ \ 'filename': ale#path#Simplify(g:dir . '/foo.d'),
+ \ 'lnum': '230',
+ \ 'col' : '9',
+ \ 'type': 'W',
+ \ 'text': 'statement is not reachable'
+ \ }
+ \ ],
+ \ ale_linters#d#dmd#Handle(bufnr(''), [
+ \ 'test.d(5,8): Error: module weak_reference is in file ''dstruct/weak_reference.d'' which cannot be read',
+ \ 'import path[0] = source',
+ \ 'import path[1] = /usr/include/dlang/dmd',
+ \ ale#path#Simplify(g:dir . '/test.d') . '(20,10): Deprecation: function test.thisoldfunc is deprecated',
+ \ 'foo.d(230,9): Warning: statement is not reachable',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_dockerfile_lint_handler.vader b/sources_non_forked/ale/test/handler/test_dockerfile_lint_handler.vader
new file mode 100644
index 00000000..a73db8cd
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_dockerfile_lint_handler.vader
@@ -0,0 +1,112 @@
+Before:
+ runtime ale_linters/dockerfile/dockerfile_lint.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The dockerfile_lint handler should handle broken JSON):
+ AssertEqual
+ \ [],
+ \ ale_linters#dockerfile#dockerfile_lint#Handle(bufnr(''), ["{asdf"])
+
+Execute(The dockerfile_lint handler should handle an empty string response):
+ AssertEqual
+ \ [],
+ \ ale_linters#dockerfile#dockerfile_lint#Handle(bufnr(''), [])
+
+Execute(The dockerfile_lint handler should handle an empty result, even if it shouldn't happen):
+ AssertEqual
+ \ [],
+ \ ale_linters#dockerfile#dockerfile_lint#Handle(bufnr(''), ["{}"])
+
+Execute(The dockerfile_lint handler should handle a normal example):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': -1,
+ \ 'type': 'E',
+ \ 'text': "Required LABEL name/key 'Name' is not defined",
+ \ 'detail': "Required LABEL name/key 'Name' is not defined\n\nhttp://docs.projectatomic.io/container-best-practices/#_recommended_labels_for_your_project",
+ \ },
+ \ {
+ \ 'lnum': -1,
+ \ 'type': 'E',
+ \ 'text': "Required LABEL name/key 'Version' is not defined",
+ \ 'detail': "Required LABEL name/key 'Version' is not defined\n\nhttp://docs.projectatomic.io/container-best-practices/#_recommended_labels_for_your_project",
+ \ },
+ \ {
+ \ 'lnum': 3,
+ \ 'type': 'I',
+ \ 'text': "the MAINTAINER command is deprecated",
+ \ 'detail': "the MAINTAINER command is deprecated\n\nMAINTAINER is deprecated in favor of using LABEL since Docker v1.13.0\n\nhttps://github.com/docker/cli/blob/master/docs/deprecated.md#maintainer-in-dockerfile",
+ \ },
+ \ {
+ \ 'lnum': -1,
+ \ 'type': 'I',
+ \ 'text': "There is no 'CMD' instruction",
+ \ 'detail': "There is no 'CMD' instruction\n\nhttps://docs.docker.com/engine/reference/builder/#cmd",
+ \ },
+ \ ],
+ \ ale_linters#dockerfile#dockerfile_lint#Handle(bufnr(''), [
+ \ '{',
+ \ ' "error": {',
+ \ ' "count": 2,',
+ \ ' "data": [',
+ \ ' {',
+ \ " \"message\": \"Required LABEL name/key 'Name' is not defined\",",
+ \ ' "line": -1,',
+ \ ' "level": "error",',
+ \ ' "lineContent": "",',
+ \ ' "reference_url": [',
+ \ ' "http://docs.projectatomic.io/container-best-practices/#",',
+ \ ' "_recommended_labels_for_your_project"',
+ \ ' ]',
+ \ ' },',
+ \ ' {',
+ \ " \"message\": \"Required LABEL name/key 'Version' is not defined\",",
+ \ ' "line": -1,',
+ \ ' "level": "error",',
+ \ ' "lineContent": "",',
+ \ ' "reference_url": [',
+ \ ' "http://docs.projectatomic.io/container-best-practices/#",',
+ \ ' "_recommended_labels_for_your_project"',
+ \ ' ]',
+ \ ' }',
+ \ ' ]',
+ \ ' },',
+ \ ' "warn": {',
+ \ ' "count": 0,',
+ \ ' "data": []',
+ \ ' },',
+ \ ' "info": {',
+ \ ' "count": 2,',
+ \ ' "data": [',
+ \ ' {',
+ \ ' "label": "maintainer_deprecated",',
+ \ ' "regex": {},',
+ \ ' "level": "info",',
+ \ ' "message": "the MAINTAINER command is deprecated",',
+ \ ' "description": "MAINTAINER is deprecated in favor of using LABEL since Docker v1.13.0",',
+ \ ' "reference_url": [',
+ \ ' "https://github.com/docker/cli/blob/master/docs/deprecated.md",',
+ \ ' "#maintainer-in-dockerfile"',
+ \ ' ],',
+ \ ' "lineContent": "MAINTAINER Alexander Olofsson ",',
+ \ ' "line": 3',
+ \ ' },',
+ \ ' {',
+ \ ' "instruction": "CMD",',
+ \ ' "count": 1,',
+ \ ' "level": "info",',
+ \ " \"message\": \"There is no 'CMD' instruction\",",
+ \ ' "description": "None",',
+ \ ' "reference_url": [',
+ \ ' "https://docs.docker.com/engine/reference/builder/",',
+ \ ' "#cmd"',
+ \ ' ]',
+ \ ' }',
+ \ ' ]',
+ \ ' },',
+ \ ' "summary": []',
+ \ '}',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_dogma_handler.vader b/sources_non_forked/ale/test/handler/test_dogma_handler.vader
new file mode 100644
index 00000000..ead6d09f
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_dogma_handler.vader
@@ -0,0 +1,30 @@
+Before:
+ runtime ale_linters/elixir/dogma.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The dogma handler should parse lines correctly):
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'bufnr': 347,
+ \ 'lnum': 18,
+ \ 'col': 5,
+ \ 'text': 'Some error',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'bufnr': 347,
+ \ 'lnum': 19,
+ \ 'col': 7,
+ \ 'text': 'Some warning',
+ \ 'type': 'W',
+ \ },
+ \ ],
+ \ ale_linters#elixir#dogma#Handle(347, [
+ \ 'This line should be ignored completely',
+ \ 'lib/filename.ex:18:5: C: Some error',
+ \ 'lib/filename.ex:19:7: R: Some warning',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_drafter_handler.vader b/sources_non_forked/ale/test/handler/test_drafter_handler.vader
new file mode 100644
index 00000000..1524dde1
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_drafter_handler.vader
@@ -0,0 +1,37 @@
+Before:
+ runtime! ale_linters/apiblueprint/drafter.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(drafter handler should handle errors output):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 25,
+ \ 'col': 3,
+ \ 'text': "unable to parse response signature, expected 'response [] [()]'",
+ \ 'type': "W",
+ \ },
+ \ {
+ \ 'lnum': 25,
+ \ 'col': 3,
+ \ 'text': "missing response HTTP status code, assuming 'Response 200'",
+ \ 'type': "W",
+ \ },
+ \ {
+ \ 'lnum': 30,
+ \ 'col': 7,
+ \ 'end_lnum': 32,
+ \ 'end_col': 7,
+ \ 'text': "message-body asset is expected to be a pre-formatted code block, separate it by a newline and indent every of its line by 12 spaces or 3 tabs",
+ \ 'type': "W",
+ \ },
+ \ ],
+ \ ale_linters#apiblueprint#drafter#HandleErrors(bufnr(''), [
+ \ "",
+ \ "OK.",
+ \ "warning: (3) unable to parse response signature, expected 'response [] [()]'; line 25, column 3 - line 25, column 29",
+ \ "warning: (6) missing response HTTP status code, assuming 'Response 200'; line 25, column 3 - line 25, column 29",
+ \ "warning: (10) message-body asset is expected to be a pre-formatted code block, separate it by a newline and indent every of its line by 12 spaces or 3 tabs; line 30, column 7 - line 30, column 11; line 31, column 6 - line 31, column 7; line 32, column 6 - line 32, column 7"
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_elmmake_handler.vader b/sources_non_forked/ale/test/handler/test_elmmake_handler.vader
new file mode 100644
index 00000000..f5906a8b
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_elmmake_handler.vader
@@ -0,0 +1,299 @@
+Before:
+ runtime ale_linters/elm/make.vim
+
+After:
+ unlet! g:config_error_lines
+
+ call ale#linter#Reset()
+
+
+" Elm 0.19
+
+Execute(The elm-make handler should parse Elm 0.19 general problems correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'type': 'E',
+ \ 'text': "error details\n\nstyled details"
+ \ }
+ \ ],
+ \ ale_linters#elm#make#Handle(347, [
+ \ json_encode({
+ \ 'type': 'error',
+ \ 'path': ale#util#Tempname() . '/Module.elm',
+ \ 'title': 'UNKNOWN IMPORT',
+ \ 'message': ["error details\n\n", { 'string': 'styled details' }]
+ \ }),
+ \ ])
+
+Execute(The elm-make handler should parse Elm 0.19 compilation errors correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 404,
+ \ 'col': 1,
+ \ 'end_lnum': 408,
+ \ 'end_col': 18,
+ \ 'type': 'E',
+ \ 'text': "error details 1\n\nstyled details"
+ \ },
+ \ {
+ \ 'lnum': 406,
+ \ 'col': 5,
+ \ 'end_lnum': 407,
+ \ 'end_col': 17,
+ \ 'type': 'E',
+ \ 'text': 'error details 2',
+ \ },
+ \ {
+ \ 'lnum': 406,
+ \ 'col': 5,
+ \ 'end_lnum': 406,
+ \ 'end_col': 93,
+ \ 'type': 'E',
+ \ 'text': 'error details 3',
+ \ },
+ \ ],
+ \ ale_linters#elm#make#Handle(347, [
+ \ json_encode({
+ \ 'type': 'compile-errors',
+ \ 'errors': [
+ \ {
+ \ 'path': ale#util#Tempname() . '/Module.elm',
+ \ 'problems': [
+ \ {
+ \ 'title': 'TYPE MISMATCH',
+ \ 'message': ["error details 1\n\n", { 'string': 'styled details' }],
+ \ 'region': { 'start': { 'line': 404, 'column': 1 }, 'end': { 'line': 408, 'column': 18 } }
+ \ },
+ \ {
+ \ 'title': 'TYPE MISMATCH',
+ \ 'message': ['error details 2'],
+ \ 'region': { 'start': {'line': 406, 'column': 5}, 'end': {'line': 407, 'column': 17 } }
+ \ },
+ \ {
+ \ 'title': 'TYPE MISMATCH',
+ \ 'message': ['error details 3'],
+ \ 'region': { 'start': { 'line': 406, 'column': 5}, 'end': {'line': 406, 'column': 93 } }
+ \ }
+ \ ]
+ \ }
+ \ ]
+ \ }),
+ \ ])
+
+Execute(The elm-make handler should handle errors in Elm 0.19 imported modules):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'type': 'E',
+ \ 'text': "src/Module.elm - error details\n\nstyled details",
+ \ 'detail': "src/Module.elm ----------\n\nerror details\n\nstyled details"
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'type': 'E',
+ \ 'text': "Elm - error details\n\nstyled details",
+ \ 'detail': "Elm ----------\n\nerror details\n\nstyled details"
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'type': 'E',
+ \ 'text': "src/Module.elm:404 - error details\n\nstyled details",
+ \ 'detail': "src/Module.elm:404 ----------\n\nerror details\n\nstyled details"
+ \ },
+ \ ],
+ \ ale_linters#elm#make#Handle(347, [
+ \ json_encode({
+ \ 'type': 'error',
+ \ 'path': 'src/Module.elm',
+ \ 'title': 'UNKNOWN IMPORT',
+ \ 'message': ["error details\n\n", { 'string': 'styled details' }]
+ \ }),
+ \ json_encode({
+ \ 'type': 'error',
+ \ 'path': v:null,
+ \ 'title': 'UNKNOWN IMPORT',
+ \ 'message': ["error details\n\n", { 'string': 'styled details' }]
+ \ }),
+ \ json_encode({
+ \ 'type': 'compile-errors',
+ \ 'errors': [
+ \ {
+ \ 'path': 'src/Module.elm',
+ \ 'problems': [
+ \ {
+ \ 'title': 'TYPE MISMATCH',
+ \ 'message': ["error details\n\n", { 'string': 'styled details' }],
+ \ 'region': { 'start': { 'line': 404, 'column': 1 }, 'end': { 'line': 408, 'column': 18 } }
+ \ }
+ \ ]
+ \ }
+ \ ]
+ \ }),
+ \ ])
+
+
+" Elm 0.18
+
+Execute(The elm-make handler should parse Elm 0.18 compilation errors correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 33,
+ \ 'col': 1,
+ \ 'end_lnum': 33,
+ \ 'end_col': 19,
+ \ 'type': 'W',
+ \ 'text': 'warning overview',
+ \ 'detail': "warning overview\n\nwarning details",
+ \ },
+ \ {
+ \ 'lnum': 404,
+ \ 'col': 1,
+ \ 'end_lnum': 408,
+ \ 'end_col': 18,
+ \ 'type': 'E',
+ \ 'text': 'error overview 1',
+ \ 'detail': "error overview 1\n\nerror details 1",
+ \ },
+ \ {
+ \ 'lnum': 406,
+ \ 'col': 5,
+ \ 'end_lnum': 407,
+ \ 'end_col': 17,
+ \ 'type': 'E',
+ \ 'text': 'error overview 2',
+ \ 'detail': "error overview 2\n\nerror details 2",
+ \ },
+ \ {
+ \ 'lnum': 406,
+ \ 'col': 5,
+ \ 'end_lnum': 406,
+ \ 'end_col': 93,
+ \ 'type': 'E',
+ \ 'text': 'error overview 3',
+ \ 'detail': "error overview 3\n\nerror details 3",
+ \ },
+ \ ],
+ \ ale_linters#elm#make#Handle(347, [
+ \ json_encode([
+ \ {
+ \ 'tag': 'unused import',
+ \ 'overview': 'warning overview',
+ \ 'details': 'warning details',
+ \ 'region': {'start': { 'line': 33, 'column': 1 }, 'end': { 'line': 33, 'column': 19 } },
+ \ 'type': 'warning',
+ \ 'file': ale#util#Tempname() . '/Module.elm',
+ \ }
+ \ ]),
+ \ json_encode([
+ \ {
+ \ 'tag': 'TYPE MISMATCH',
+ \ 'overview': 'error overview 1',
+ \ 'subregion': { 'start': { 'line': 406, 'column': 5 }, 'end': { 'line': 408, 'column': 18 } },
+ \ 'details': 'error details 1',
+ \ 'region': { 'start': { 'line': 404, 'column': 1 }, 'end': { 'line': 408, 'column': 18 } },
+ \ 'type': 'error',
+ \ 'file': ale#util#Tempname() . '/Module.elm',
+ \ },
+ \ {
+ \ 'tag': 'TYPE MISMATCH',
+ \ 'overview': 'error overview 2',
+ \ 'subregion': { 'start': { 'line': 407, 'column': 12 }, 'end': { 'line': 407, 'column': 17 } },
+ \ 'details': 'error details 2',
+ \ 'region': { 'start': { 'line': 406, 'column': 5}, 'end': { 'line': 407, 'column': 17 } },
+ \ 'type':'error',
+ \ 'file': ale#util#Tempname() . '/Module.elm',
+ \ },
+ \ {
+ \ 'tag': 'TYPE MISMATCH',
+ \ 'overview': 'error overview 3',
+ \ 'subregion': { 'start': { 'line': 406, 'column': 88 }, 'end': { 'line': 406, 'column': 93 } },
+ \ 'details': 'error details 3',
+ \ 'region': { 'start': { 'line': 406, 'column': 5 }, 'end': { 'line': 406, 'column': 93 } },
+ \ 'type':'error',
+ \ 'file': ale#util#Tempname() . '/Module.elm',
+ \ }
+ \ ]),
+ \ ])
+
+Execute(The elm-make handler should handle errors in Elm 0.18 imported modules):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'type': 'E',
+ \ 'text': 'src/Module.elm:33 - error overview',
+ \ 'detail': "src/Module.elm:33 ----------\n\nerror overview\n\nerror details"
+ \ }
+ \ ],
+ \ ale_linters#elm#make#Handle(347, [
+ \ json_encode([
+ \ {
+ \ 'tag': 'unused import',
+ \ 'overview': 'warning overview',
+ \ 'details': 'warning details',
+ \ 'region': {'start': { 'line': 33, 'column': 1 }, 'end': { 'line': 33, 'column': 19 } },
+ \ 'type': 'warning',
+ \ 'file': 'src/Module.elm',
+ \ },
+ \ {
+ \ 'tag': 'type error',
+ \ 'overview': 'error overview',
+ \ 'details': 'error details',
+ \ 'region': {'start': { 'line': 33, 'column': 1 }, 'end': { 'line': 33, 'column': 19 } },
+ \ 'type': 'error',
+ \ 'file': 'src/Module.elm',
+ \ }
+ \ ]),
+ \ ])
+
+" Generic
+
+Execute(The elm-make handler should put an error on the first line if a line cannot be parsed):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 404,
+ \ 'col': 1,
+ \ 'end_lnum': 408,
+ \ 'end_col': 18,
+ \ 'type': 'E',
+ \ 'text': "error details 1\n\nstyled details"
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'type': 'E',
+ \ 'text': 'Not JSON',
+ \ 'detail': "Not JSON\nAlso not JSON",
+ \ },
+ \ ],
+ \ ale_linters#elm#make#Handle(347, [
+ \ json_encode({
+ \ 'type': 'compile-errors',
+ \ 'errors': [
+ \ {
+ \ 'path': ale#util#Tempname() . '/Module.elm',
+ \ 'problems': [
+ \ {
+ \ 'title': 'TYPE MISMATCH',
+ \ 'message': ["error details 1\n\n", { 'string': 'styled details' }],
+ \ 'region': { 'start': { 'line': 404, 'column': 1 }, 'end': { 'line': 408, 'column': 18 } }
+ \ }
+ \ ]
+ \ }
+ \ ]
+ \ }),
+ \ 'Not JSON',
+ \ 'Also not JSON',
+ \ ])
+
+Execute(The elm-make handler should ignore success lines):
+ AssertEqual
+ \ [],
+ \ ale_linters#elm#make#Handle(347, [
+ \ 'Successfully generated /dev/null',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_embertemplatelint_handler.vader b/sources_non_forked/ale/test/handler/test_embertemplatelint_handler.vader
new file mode 100644
index 00000000..97ca4390
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_embertemplatelint_handler.vader
@@ -0,0 +1,81 @@
+" Author: Adrian Zalewski
+Before:
+ runtime ale_linters/handlebars/embertemplatelint.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The ember-template-lint handler should parse lines correctly):
+ let input_lines = split('{
+ \ "/ember-project/app/templates/application.hbs": [
+ \ {
+ \ "moduleId": "app/templates/application",
+ \ "rule": "bare-strings",
+ \ "severity": 2,
+ \ "message": "Non-translated string used",
+ \ "line": 1,
+ \ "column": 10,
+ \ "source": " Bare String\n"
+ \ },
+ \ {
+ \ "moduleId": "app/templates/application",
+ \ "rule": "invalid-interactive",
+ \ "severity": 1,
+ \ "message": "Interaction added to non-interactive element",
+ \ "line": 3,
+ \ "column": 6,
+ \ "source": ""
+ \ }
+ \ ]
+ \ }', '\n')
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 10,
+ \ 'text': 'bare-strings: Non-translated string used',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 3,
+ \ 'col': 6,
+ \ 'text': 'invalid-interactive: Interaction added to non-interactive element',
+ \ 'type': 'W',
+ \ },
+ \ ],
+ \ ale_linters#handlebars#embertemplatelint#Handle(347, input_lines)
+
+Execute(The ember-template-lint handler should handle template parsing error correctly):
+ let input_lines = split('{
+ \ "/ember-project/app/templates/application.hbs": [
+ \ {
+ \ "fatal": true,
+ \ "moduleId": "app/templates/application",
+ \ "message": "Parse error on line 5 ...",
+ \ "line": 5,
+ \ "column": 3,
+ \ "source": "Error: Parse error on line 5 ...",
+ \ "severity": 2
+ \ }
+ \ ]
+ \ }', '\n')
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 5,
+ \ 'col': 3,
+ \ 'text': 'Parse error on line 5 ...',
+ \ 'type': 'E',
+ \ },
+ \ ],
+ \ ale_linters#handlebars#embertemplatelint#Handle(347, input_lines)
+
+Execute(The ember-template-lint handler should handle no lint errors/warnings):
+ AssertEqual
+ \ [],
+ \ ale_linters#handlebars#embertemplatelint#Handle(347, [])
+ AssertEqual
+ \ [],
+ \ ale_linters#handlebars#embertemplatelint#Handle(347, ['{}'])
diff --git a/sources_non_forked/ale/test/handler/test_erblint_handler.vader b/sources_non_forked/ale/test/handler/test_erblint_handler.vader
new file mode 100644
index 00000000..01d4c0ab
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_erblint_handler.vader
@@ -0,0 +1,70 @@
+Before:
+ runtime ale_linters/eruby/erblint.vim
+
+After:
+ unlet! g:lines
+ call ale#linter#Reset()
+
+Execute(The erblint handler should parse lines correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 3,
+ \ 'col': 0,
+ \ 'end_col': 0,
+ \ 'text': 'Extra blank line detected.',
+ \ 'code': 'ExtraNewline',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 0,
+ \ 'end_col': 0,
+ \ 'text': 'Remove multiple trailing newline at the end of the file.',
+ \ 'code': 'FinalNewline',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'lnum': 4,
+ \ 'col': 9,
+ \ 'end_col': 11,
+ \ 'text': 'Use 1 space after `<%=` instead of 2 spaces.',
+ \ 'code': 'SpaceAroundErbTag',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'lnum': 4,
+ \ 'col': 9,
+ \ 'end_col': 11,
+ \ 'text': 'Use 1 space before `%>` instead of 2 spaces.',
+ \ 'code': 'SpaceAroundErbTag',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'lnum': 5,
+ \ 'col': 6,
+ \ 'end_col': 10,
+ \ 'text': 'Extra whitespace detected at end of line.',
+ \ 'code': 'TrailingWhitespace',
+ \ 'type': 'W',
+ \ },
+ \ ],
+ \ ale_linters#eruby#erblint#Handle(347, [
+ \ '{"metadata":{"erb_lint_version":"0.1.1","ruby_engine":"ruby","ruby_version":"3.0.2","ruby_patchlevel":"107","ruby_platform":"arm64-darwin20"},"files":[{"path":"demo.html.erb","offenses":[{"linter":"ExtraNewline","message":"Extra blank line detected.","location":{"start_line":3,"start_column":0,"last_line":4,"last_column":0,"length":1}},{"linter":"FinalNewline","message":"Remove multiple trailing newline at the end of the file.","location":{"start_line":6,"start_column":0,"last_line":8,"last_column":0,"length":2}},{"linter":"SpaceAroundErbTag","message":"Use 1 space after `<%=` instead of 2 spaces.","location":{"start_line":4,"start_column":9,"last_line":4,"last_column":11,"length":2}},{"linter":"SpaceAroundErbTag","message":"Use 1 space before `%>` instead of 2 spaces.","location":{"start_line":4,"start_column":9,"last_line":4,"last_column":11,"length":2}},{"linter":"TrailingWhitespace","message":"Extra whitespace detected at end of line.","location":{"start_line":5,"start_column":6,"last_line":5,"last_column":10,"length":4}}]}],"summary":{"offenses":5,"inspected_files":1,"corrected":0}}'
+ \ ])
+
+Execute(The erblint handler should handle when files are checked and no offenses are found):
+ AssertEqual
+ \ [],
+ \ ale_linters#eruby#erblint#Handle(347, [
+ \ '{"metadata":{"erb_lint_version":"0.1.1","ruby_engine":"ruby","ruby_version":"3.0.2","ruby_patchlevel":"107","ruby_platform":"arm64-darwin20"},"files":[{"path":"demo.html.erb","offenses":[]}],"summary":{"offenses":0,"inspected_files":1,"corrected":0}}'
+ \ ])
+
+Execute(The erblint handler should handle output without any errors):
+ AssertEqual
+ \ [],
+ \ ale_linters#eruby#erblint#Handle(347, ['{}'])
+
+ AssertEqual
+ \ [],
+ \ ale_linters#eruby#erblint#Handle(347, [])
diff --git a/sources_non_forked/ale/test/handler/test_erlang_dialyzer_handler.vader b/sources_non_forked/ale/test/handler/test_erlang_dialyzer_handler.vader
new file mode 100644
index 00000000..afd5c597
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_erlang_dialyzer_handler.vader
@@ -0,0 +1,27 @@
+Before:
+ runtime ale_linters/erlang/dialyzer.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The dialyzer handler should handle error messages.):
+ AssertEqual
+ \[
+ \ {
+ \ 'lnum': 3,
+ \ 'lcol': 0,
+ \ 'text': 'Callback info about the provider behaviour is not available',
+ \ 'type': 'W'
+ \ }
+ \],
+ \ ale_linters#erlang#dialyzer#Handle(bufnr(''), ['erl_tidy_prv_fmt.erl:3: Callback info about the provider behaviour is not available'])
+
+Execute(The dialyzer handler should handle empty file.):
+ AssertEqual
+ \[],
+ \ ale_linters#erlang#dialyzer#Handle(bufnr(''), [])
+
+Execute(The dialyzer handler should handle empty lines.):
+ AssertEqual
+ \[],
+ \ ale_linters#erlang#dialyzer#Handle(bufnr(''), [''])
diff --git a/sources_non_forked/ale/test/handler/test_erlang_elvis_handler.vader b/sources_non_forked/ale/test/handler/test_erlang_elvis_handler.vader
new file mode 100644
index 00000000..0a6d756d
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_erlang_elvis_handler.vader
@@ -0,0 +1,40 @@
+Before:
+ runtime ale_linters/erlang/elvis.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(Warning messages should be handled):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 11,
+ \ 'text': "Replace the 'if' expression on line 11 with a 'case' expression or function clauses.",
+ \ 'type': 'W',
+ \ 'sub_type': 'style',
+ \ },
+ \ {
+ \ 'lnum': 20,
+ \ 'text': 'Remove the debug call to io:format/1 on line 20.',
+ \ 'type': 'W',
+ \ 'sub_type': 'style',
+ \ },
+ \ ],
+ \ ale_linters#erlang#elvis#Handle(bufnr(''), [
+ \ "src/foo.erl:11:no_if_expression:Replace the 'if' expression on line 11 with a 'case' expression or function clauses.",
+ \ 'src/foo.erl:20:no_debug_call:Remove the debug call to io:format/1 on line 20.',
+ \ ])
+
+Execute(Line length message shouldn't contain the line itself):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 24,
+ \ 'text': 'Line 24 is too long.',
+ \ 'type': 'W',
+ \ 'sub_type': 'style',
+ \ },
+ \ ],
+ \ ale_linters#erlang#elvis#Handle(bufnr(''), [
+ \ 'src/foo.erl:24:line_length:Line 24 is too long: io:format("Look ma, too long!"),.',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_eslint_handler.vader b/sources_non_forked/ale/test/handler/test_eslint_handler.vader
new file mode 100644
index 00000000..01dd2c8f
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_eslint_handler.vader
@@ -0,0 +1,438 @@
+Before:
+ Save g:ale_javascript_eslint_suppress_eslintignore
+ Save g:ale_javascript_eslint_suppress_missing_config
+ Save g:ale_warn_about_trailing_whitespace
+ Save g:ale_warn_about_trailing_blank_lines
+
+ let g:ale_javascript_eslint_suppress_eslintignore = 0
+ let g:ale_javascript_eslint_suppress_missing_config = 0
+ let g:ale_warn_about_trailing_whitespace = 1
+ let g:ale_warn_about_trailing_blank_lines = 1
+ unlet! b:ale_warn_about_trailing_whitespace
+ unlet! b:ale_warn_about_trailing_blank_lines
+
+After:
+ Restore
+
+ unlet! b:ale_javascript_eslint_suppress_eslintignore
+ unlet! b:ale_javascript_eslint_suppress_missing_config
+ unlet! b:ale_warn_about_trailing_whitespace
+ unlet! b:ale_warn_about_trailing_blank_lines
+ unlet! g:config_error_lines
+
+Execute(The eslint handler should parse lines correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 47,
+ \ 'col': 14,
+ \ 'text': 'Missing trailing comma.',
+ \ 'code': 'comma-dangle',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'lnum': 56,
+ \ 'col': 41,
+ \ 'text': 'Missing semicolon.',
+ \ 'code': 'semi',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 13,
+ \ 'col': 3,
+ \ 'text': 'Parsing error: Unexpected token',
+ \ 'type': 'E',
+ \ },
+ \ ],
+ \ ale#handlers#eslint#Handle(bufnr(''), [
+ \ 'This line should be ignored completely',
+ \ '/path/to/some-filename.js:47:14: Missing trailing comma. [Warning/comma-dangle]',
+ \ '/path/to/some-filename.js:56:41: Missing semicolon. [Error/semi]',
+ \ 'This line should be ignored completely',
+ \ '/path/to/some-filename.js:13:3: Parsing error: Unexpected token',
+ \ ])
+
+Execute(The eslint handler should print a message about a missing configuration file):
+ let g:config_error_lines = [
+ \ '',
+ \ 'Oops! Something went wrong! :(',
+ \ '',
+ \ 'ESLint couldn''t find a configuration file. To set up a configuration file for this project, please run:',
+ \ ' eslint --init',
+ \ '',
+ \ 'ESLint looked for configuration files in /some/path/or/other and its ancestors.',
+ \ '',
+ \ 'If you think you already have a configuration file or if you need more help, please stop by the ESLint chat room: https://gitter.im/eslint/eslint',
+ \ '',
+ \ ]
+
+ AssertEqual
+ \ [{
+ \ 'lnum': 1,
+ \ 'text': 'eslint configuration error (type :ALEDetail for more information)',
+ \ 'detail': join(g:config_error_lines, "\n"),
+ \ }],
+ \ ale#handlers#eslint#Handle(bufnr(''), g:config_error_lines[:])
+
+Execute(The eslint handler should allow the missing config error to be suppressed):
+ let b:ale_javascript_eslint_suppress_missing_config = 1
+ let g:config_error_lines = [
+ \ '',
+ \ 'Oops! Something went wrong! :(',
+ \ '',
+ \ 'ESLint couldn''t find a configuration file. To set up a configuration file for this project, please run:',
+ \ ' eslint --init',
+ \ '',
+ \ 'ESLint looked for configuration files in /some/path/or/other and its ancestors.',
+ \ '',
+ \ 'If you think you already have a configuration file or if you need more help, please stop by the ESLint chat room: https://gitter.im/eslint/eslint',
+ \ '',
+ \ ]
+
+ AssertEqual
+ \ [],
+ \ ale#handlers#eslint#Handle(bufnr(''), g:config_error_lines[:])
+
+Execute(The eslint handler should print a message for config parsing errors):
+ let g:config_error_lines = [
+ \ 'Cannot read config file: /some/path/or/other/.eslintrc.js',
+ \ 'Error: Unexpected token <<',
+ \ '/some/path/or/other/.eslintrc.js:1',
+ \ '(function (exports, require, module, __filename, __dirname) { <<<>>>',
+ \ ' ^^',
+ \ 'SyntaxError: Unexpected token <<',
+ \ ' at Object.exports.runInThisContext (vm.js:76:16)',
+ \ ' at Module._compile (module.js:528:28)',
+ \ ' at Object.Module._extensions..js (module.js:565:10)',
+ \ ' at Module.load (module.js:473:32)',
+ \ ' at tryModuleLoad (module.js:432:12)',
+ \ ' at Function.Module._load (module.js:424:3)',
+ \ ' at Module.require (module.js:483:17)',
+ \ ' at require (internal/module.js:20:19)',
+ \ ' at module.exports (/usr/local/lib/node_modules/eslint/node_modules/require-uncached/index.js:14:12)',
+ \ ' at loadJSConfigFile (/usr/local/lib/node_modules/eslint/lib/config/config-file.js:160:16)',
+ \]
+
+ AssertEqual
+ \ [{
+ \ 'lnum': 1,
+ \ 'text': 'eslint configuration error (type :ALEDetail for more information)',
+ \ 'detail': join(g:config_error_lines, "\n"),
+ \ }],
+ \ ale#handlers#eslint#Handle(bufnr(''), g:config_error_lines[:])
+
+Execute(Suppressing missing configs shouldn't suppress parsing errors):
+ let b:ale_javascript_eslint_suppress_missing_config = 1
+ let g:config_error_lines = [
+ \ 'Cannot read config file: /some/path/or/other/.eslintrc.js',
+ \ 'Error: Unexpected token <<',
+ \ '/some/path/or/other/.eslintrc.js:1',
+ \ '(function (exports, require, module, __filename, __dirname) { <<<>>>',
+ \ ' ^^',
+ \ 'SyntaxError: Unexpected token <<',
+ \ ' at Object.exports.runInThisContext (vm.js:76:16)',
+ \ ' at Module._compile (module.js:528:28)',
+ \ ' at Object.Module._extensions..js (module.js:565:10)',
+ \ ' at Module.load (module.js:473:32)',
+ \ ' at tryModuleLoad (module.js:432:12)',
+ \ ' at Function.Module._load (module.js:424:3)',
+ \ ' at Module.require (module.js:483:17)',
+ \ ' at require (internal/module.js:20:19)',
+ \ ' at module.exports (/usr/local/lib/node_modules/eslint/node_modules/require-uncached/index.js:14:12)',
+ \ ' at loadJSConfigFile (/usr/local/lib/node_modules/eslint/lib/config/config-file.js:160:16)',
+ \]
+
+ AssertEqual
+ \ [{
+ \ 'lnum': 1,
+ \ 'text': 'eslint configuration error (type :ALEDetail for more information)',
+ \ 'detail': join(g:config_error_lines, "\n"),
+ \ }],
+ \ ale#handlers#eslint#Handle(bufnr(''), g:config_error_lines[:])
+
+Execute(The eslint handler should print a message for invalid configuration settings):
+ let g:config_error_lines = [
+ \ '/home/w0rp/git/wazoku/wazoku-spotlight/.eslintrc.js:',
+ \ ' Configuration for rule "indent" is invalid:',
+ \ ' Value "off" is the wrong type.',
+ \ '',
+ \ 'Error: /home/w0rp/git/wazoku/wazoku-spotlight/.eslintrc.js:',
+ \ ' Configuration for rule "indent" is invalid:',
+ \ ' Value "off" is the wrong type.',
+ \ '',
+ \ ' at validateRuleOptions (/usr/local/lib/node_modules/eslint/lib/config/config-validator.js:115:15)',
+ \ ' at /usr/local/lib/node_modules/eslint/lib/config/config-validator.js:162:13',
+ \ ' at Array.forEach (native)',
+ \ ' at Object.validate (/usr/local/lib/node_modules/eslint/lib/config/config-validator.js:161:35)',
+ \ ' at Object.load (/usr/local/lib/node_modules/eslint/lib/config/config-file.js:522:19)',
+ \ ' at loadConfig (/usr/local/lib/node_modules/eslint/lib/config.js:63:33)',
+ \ ' at getLocalConfig (/usr/local/lib/node_modules/eslint/lib/config.js:130:29)',
+ \ ' at Config.getConfig (/usr/local/lib/node_modules/eslint/lib/config.js:256:22)',
+ \ ' at processText (/usr/local/lib/node_modules/eslint/lib/cli-engine.js:224:33)',
+ \ ' at CLIEngine.executeOnText (/usr/local/lib/node_modules/eslint/lib/cli-engine.js:756:26)',
+ \]
+
+ AssertEqual
+ \ [{
+ \ 'lnum': 1,
+ \ 'text': 'eslint configuration error (type :ALEDetail for more information)',
+ \ 'detail': join(g:config_error_lines, "\n"),
+ \ }],
+ \ ale#handlers#eslint#Handle(bufnr(''), g:config_error_lines[:])
+
+Execute(Suppressing missing configs shouldn't suppress invalid config errors):
+ let b:ale_javascript_eslint_suppress_missing_config = 1
+ let g:config_error_lines = [
+ \ '/home/w0rp/git/wazoku/wazoku-spotlight/.eslintrc.js:',
+ \ ' Configuration for rule "indent" is invalid:',
+ \ ' Value "off" is the wrong type.',
+ \ '',
+ \ 'Error: /home/w0rp/git/wazoku/wazoku-spotlight/.eslintrc.js:',
+ \ ' Configuration for rule "indent" is invalid:',
+ \ ' Value "off" is the wrong type.',
+ \ '',
+ \ ' at validateRuleOptions (/usr/local/lib/node_modules/eslint/lib/config/config-validator.js:115:15)',
+ \ ' at /usr/local/lib/node_modules/eslint/lib/config/config-validator.js:162:13',
+ \ ' at Array.forEach (native)',
+ \ ' at Object.validate (/usr/local/lib/node_modules/eslint/lib/config/config-validator.js:161:35)',
+ \ ' at Object.load (/usr/local/lib/node_modules/eslint/lib/config/config-file.js:522:19)',
+ \ ' at loadConfig (/usr/local/lib/node_modules/eslint/lib/config.js:63:33)',
+ \ ' at getLocalConfig (/usr/local/lib/node_modules/eslint/lib/config.js:130:29)',
+ \ ' at Config.getConfig (/usr/local/lib/node_modules/eslint/lib/config.js:256:22)',
+ \ ' at processText (/usr/local/lib/node_modules/eslint/lib/cli-engine.js:224:33)',
+ \ ' at CLIEngine.executeOnText (/usr/local/lib/node_modules/eslint/lib/cli-engine.js:756:26)',
+ \]
+
+ AssertEqual
+ \ [{
+ \ 'lnum': 1,
+ \ 'text': 'eslint configuration error (type :ALEDetail for more information)',
+ \ 'detail': join(g:config_error_lines, "\n"),
+ \ }],
+ \ ale#handlers#eslint#Handle(bufnr(''), g:config_error_lines[:])
+
+Execute(The eslint handler should print a message when import is not used in a module):
+ let g:config_error_lines = [
+ \ 'ImportDeclaration should appear when the mode is ES6 and in the module context.',
+ \ 'AssertionError: ImportDeclaration should appear when the mode is ES6 and in the module context.',
+ \ ' at Referencer.ImportDeclaration (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint-scope/lib/referencer.js:597:9)',
+ \ ' at Referencer.Visitor.visit (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/esrecurse/esrecurse.js:122:34)',
+ \ ' at Referencer.Visitor.visitChildren (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/esrecurse/esrecurse.js:101:38)',
+ \ ' at Referencer.Program (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint-scope/lib/referencer.js:449:14)',
+ \ ' at Referencer.Visitor.visit (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/esrecurse/esrecurse.js:122:34)',
+ \ ' at Object.analyze (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint-scope/lib/index.js:138:16)',
+ \ ' at EventEmitter.module.exports.api.verify (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint/lib/eslint.js:887:40)',
+ \ ' at processText (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint/lib/cli-engine.js:278:31)',
+ \ ' at CLIEngine.executeOnText (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint/lib/cli-engine.js:734:26)',
+ \ ' at Object.execute (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint/lib/cli.js:171:42) ',
+ \]
+
+ AssertEqual
+ \ [{
+ \ 'lnum': 1,
+ \ 'text': 'eslint configuration error (type :ALEDetail for more information)',
+ \ 'detail': join(g:config_error_lines, "\n"),
+ \ }],
+ \ ale#handlers#eslint#Handle(bufnr(''), g:config_error_lines[:])
+
+Execute(Suppressing missing configs shouldn't suppress module import errors):
+ let b:ale_javascript_eslint_suppress_missing_config = 1
+ let g:config_error_lines = [
+ \ 'ImportDeclaration should appear when the mode is ES6 and in the module context.',
+ \ 'AssertionError: ImportDeclaration should appear when the mode is ES6 and in the module context.',
+ \ ' at Referencer.ImportDeclaration (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint-scope/lib/referencer.js:597:9)',
+ \ ' at Referencer.Visitor.visit (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/esrecurse/esrecurse.js:122:34)',
+ \ ' at Referencer.Visitor.visitChildren (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/esrecurse/esrecurse.js:101:38)',
+ \ ' at Referencer.Program (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint-scope/lib/referencer.js:449:14)',
+ \ ' at Referencer.Visitor.visit (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/esrecurse/esrecurse.js:122:34)',
+ \ ' at Object.analyze (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint-scope/lib/index.js:138:16)',
+ \ ' at EventEmitter.module.exports.api.verify (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint/lib/eslint.js:887:40)',
+ \ ' at processText (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint/lib/cli-engine.js:278:31)',
+ \ ' at CLIEngine.executeOnText (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint/lib/cli-engine.js:734:26)',
+ \ ' at Object.execute (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint/lib/cli.js:171:42) ',
+ \]
+
+ AssertEqual
+ \ [{
+ \ 'lnum': 1,
+ \ 'text': 'eslint configuration error (type :ALEDetail for more information)',
+ \ 'detail': join(g:config_error_lines, "\n"),
+ \ }],
+ \ ale#handlers#eslint#Handle(bufnr(''), g:config_error_lines[:])
+
+
+Execute(The eslint handler should output end_col values where appropriate):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 4,
+ \ 'col': 3,
+ \ 'end_col': 15,
+ \ 'text': 'Parsing error: Unexpected token ''some string''',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 70,
+ \ 'col': 3,
+ \ 'end_col': 5,
+ \ 'text': '''foo'' is not defined.',
+ \ 'code': 'no-undef',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 71,
+ \ 'col': 2,
+ \ 'end_col': 6,
+ \ 'text': 'Unexpected `await` inside a loop.',
+ \ 'code': 'no-await-in-loop',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 72,
+ \ 'col': 6,
+ \ 'end_col': 10,
+ \ 'text': 'Redundant use of `await` on a return value.',
+ \ 'code': 'no-return-await',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 73,
+ \ 'col': 4,
+ \ 'end_col': 10,
+ \ 'text': 'Unexpected console statement',
+ \ 'code': 'no-console',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 74,
+ \ 'col': 4,
+ \ 'end_col': 11,
+ \ 'text': 'Unexpected ''debugger'' statement.',
+ \ 'code': 'no-debugger',
+ \ 'type': 'E',
+ \ },
+ \ ],
+ \ ale#handlers#eslint#Handle(bufnr(''), [
+ \ 'app.js:4:3: Parsing error: Unexpected token ''some string'' [Error]',
+ \ 'app.js:70:3: ''foo'' is not defined. [Error/no-undef]',
+ \ 'app.js:71:2: Unexpected `await` inside a loop. [Error/no-await-in-loop]',
+ \ 'app.js:72:6: Redundant use of `await` on a return value. [Error/no-return-await]',
+ \ 'app.js:73:4: Unexpected console statement [Error/no-console]',
+ \ 'app.js:74:4: Unexpected ''debugger'' statement. [Error/no-debugger]',
+ \ ])
+
+Execute(The eslint hint about using typescript-eslint-parser):
+ silent! noautocmd file foo.ts
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 451,
+ \ 'col': 2,
+ \ 'end_col': 2,
+ \ 'text': 'Parsing error (You may need configure typescript-eslint-parser): Unexpected token )',
+ \ 'type': 'E',
+ \ },
+ \ ],
+ \ ale#handlers#eslint#Handle(bufnr(''), [
+ \ 'foo.ts:451:2: Parsing error: Unexpected token ) [Error]',
+ \ ])
+
+Execute(eslint should warn about ignored files by default):
+ AssertEqual
+ \ [{
+ \ 'lnum': 0,
+ \ 'col': 0,
+ \ 'type': 'W',
+ \ 'text': 'File ignored because of a matching ignore pattern. Use "--no-ignore" to override.'
+ \ }],
+ \ ale#handlers#eslint#Handle(bufnr(''), [
+ \ '/path/to/some/ignored.js:0:0: File ignored because of a matching ignore pattern. Use "--no-ignore" to override. [Warning]',
+ \ ])
+
+ AssertEqual
+ \ [{
+ \ 'lnum': 0,
+ \ 'col': 0,
+ \ 'type': 'W',
+ \ 'text': 'File ignored by default. Use "--ignore-pattern ''!node_modules/*''" to override.',
+ \ }],
+ \ ale#handlers#eslint#Handle(bufnr(''), [
+ \ '/path/to/some/ignored.js:0:0: File ignored by default. Use "--ignore-pattern ''!node_modules/*''" to override. [Warning]',
+ \ ])
+
+Execute(eslint should not warn about ignored files when explicitly disabled):
+ let g:ale_javascript_eslint_suppress_eslintignore = 1
+
+ AssertEqual
+ \ [],
+ \ ale#handlers#eslint#Handle(bufnr(''), [
+ \ '/path/to/some/ignored.js:0:0: File ignored because of a matching ignore pattern. Use "--no-ignore" to override. [Warning]',
+ \ ])
+
+ AssertEqual
+ \ [],
+ \ ale#handlers#eslint#Handle(bufnr(''), [
+ \ '/path/to/some/ignored.js:0:0: File ignored by default. Use "--ignore-pattern ''!node_modules/*''" to override. [Warning]',
+ \ ])
+
+Execute(eslint should handle react errors correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 59,
+ \ 'col': 9,
+ \ 'type': 'E',
+ \ 'text': 'Property should be placed on the same line as the component declaration',
+ \ 'code': 'react/jsx-first-prop-new-line',
+ \ },
+ \ ],
+ \ ale#handlers#eslint#Handle(bufnr(''), [
+ \ '/path/editor-help.jsx:59:9: Property should be placed on the same line as the component declaration [Error/react/jsx-first-prop-new-line]',
+ \ ])
+
+Execute(Failing to connect to eslint_d should be handled correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'text': 'Could not connect to eslint_d. Try updating eslint_d or killing it.',
+ \ },
+ \ ],
+ \ ale#handlers#eslint#Handle(bufnr(''), [
+ \ 'Could not connect',
+ \ ])
+
+Execute(Disabling warnings about trailing spaces should work):
+ silent! noautocmd file foo.ts
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 182,
+ \ 'col': 22,
+ \ 'code': 'no-trailing-spaces',
+ \ 'type': 'E',
+ \ 'text': 'Trailing spaces not allowed.',
+ \ },
+ \ ],
+ \ ale#handlers#eslint#Handle(bufnr(''), [
+ \ 'foo.js:182:22: Trailing spaces not allowed. [Error/no-trailing-spaces]',
+ \ ])
+
+ let g:ale_warn_about_trailing_whitespace = 0
+
+ AssertEqual
+ \ [],
+ \ ale#handlers#eslint#Handle(bufnr(''), [
+ \ 'foo.js:182:22: Trailing spaces not allowed. [Error/no-trailing-spaces]',
+ \ ])
+
+ let g:ale_warn_about_trailing_whitespace = 1
+ let b:ale_warn_about_trailing_whitespace = 0
+
+ AssertEqual
+ \ [],
+ \ ale#handlers#eslint#Handle(bufnr(''), [
+ \ 'foo.js:182:22: Trailing spaces not allowed. [Error/no-trailing-spaces]',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_eslint_json_handler.vader b/sources_non_forked/ale/test/handler/test_eslint_json_handler.vader
new file mode 100644
index 00000000..6235794a
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_eslint_json_handler.vader
@@ -0,0 +1,376 @@
+Before:
+ Save g:ale_javascript_eslint_suppress_eslintignore
+ Save g:ale_javascript_eslint_suppress_missing_config
+ Save g:ale_warn_about_trailing_whitespace
+ Save g:ale_warn_about_trailing_blank_lines
+
+ let g:ale_javascript_eslint_suppress_eslintignore = 0
+ let g:ale_javascript_eslint_suppress_missing_config = 0
+ let g:ale_warn_about_trailing_whitespace = 1
+ let g:ale_warn_about_trailing_blank_lines = 1
+ unlet! b:ale_warn_about_trailing_whitespace
+ unlet! b:ale_warn_about_trailing_blank_lines
+
+After:
+ Restore
+
+ unlet! b:ale_javascript_eslint_suppress_eslintignore
+ unlet! b:ale_javascript_eslint_suppress_missing_config
+ unlet! b:ale_warn_about_trailing_whitespace
+ unlet! b:ale_warn_about_trailing_blank_lines
+ unlet! g:config_error_lines
+
+Execute(The eslint handler should parse json correctly):
+ call ale#test#SetFilename('foo.js')
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'end_lnum': 1,
+ \ 'col': 7,
+ \ 'end_col': 14,
+ \ 'text': '''variable'' is assigned a value but never used.',
+ \ 'code': 'no-unused-vars',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'lnum': 5,
+ \ 'col': 15,
+ \ 'text': 'Missing semicolon.',
+ \ 'code': 'semi',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'lnum': 7,
+ \ 'end_lnum': 7,
+ \ 'col': 7,
+ \ 'end_col': 14,
+ \ 'text': '''variable'' is already defined.',
+ \ 'code': 'no-redeclare',
+ \ 'type': 'E',
+ \ },
+ \ ],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), [
+ \ '[{"filePath":"foo.js","messages":[{"ruleId":"no-unused-vars","severity":1,"message":"''variable'' is assigned a value but never used.","line":1,"column":7,"nodeType":"Identifier","endLine":1,"endColumn":15},{"ruleId":"semi","severity":1,"message":"Missing semicolon.","line":5,"column":15,"nodeType":"ExpressionStatement","fix":{"range":[46,46],"text":";"}},{"ruleId":"no-redeclare","severity":2,"message":"''variable'' is already defined.","line":7,"column":7,"nodeType":"Identifier","endLine":7,"endColumn":15}],"errorCount":1,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":1,"source":"const variable = {\n a: 3\n};\n\nconsole.log(1)\n\nclass variable {\n}\n"}]'
+ \ ])
+
+Execute(The eslint handler should suppress deprecation warnings):
+ call ale#test#SetFilename('foo.js')
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 9,
+ \ 'text': 'Parsing error: Unexpected token Controller',
+ \ 'type': 'E',
+ \ }
+ \ ],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), [
+ \ '[{"filePath":"foo.js","messages":[{"ruleId":null,"fatal":true,"severity":2 ,"message":"Parsing error: Unexpected token Controller","line":1,"column":9}],"errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount": 0,"source":"i:mport Controller from \"@ember/controller\";\nimport listViewControllerMixin from \"elearning/mixins/list-view-controller\";\nimport { inject as service } from \"@ember/service\";\n\nexport default Controller.extend(listViewControllerMixin(), {\n modelName: \"notification\",\n intl: service(),\n\n flatpickrLocale: computed(\"intl.locale\", function() {\n return this.intl.locale.firstObject.split(\"-\")[0];\n })\n});\n"}]', '(node:616989) [ESLINT_LEGACY_OBJECT_REST_SPREAD] DeprecationWarning: The ''parserOptions.ecmaFeatures.experimentalObjectRestSpread'' option is deprecated. Use ''parser Options.ecmaVersion'' instead. (found in "node_modules/eslint-plugin-ember/lib/config/base.js")]'
+ \ ])
+
+Execute(The eslint handler should print a message about a missing configuration file):
+ let g:config_error_lines = [
+ \ '',
+ \ 'Oops! Something went wrong! :(',
+ \ '',
+ \ 'ESLint couldn''t find a configuration file. To set up a configuration file for this project, please run:',
+ \ ' eslint --init',
+ \ '',
+ \ 'ESLint looked for configuration files in /some/path/or/other and its ancestors.',
+ \ '',
+ \ 'If you think you already have a configuration file or if you need more help, please stop by the ESLint chat room: https://gitter.im/eslint/eslint',
+ \ '',
+ \ ]
+
+ AssertEqual
+ \ [{
+ \ 'lnum': 1,
+ \ 'text': 'eslint configuration error (type :ALEDetail for more information)',
+ \ 'detail': join(g:config_error_lines, "\n"),
+ \ }],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), g:config_error_lines[:])
+
+Execute(The eslint handler should allow the missing config error to be suppressed):
+ let b:ale_javascript_eslint_suppress_missing_config = 1
+ let g:config_error_lines = [
+ \ '',
+ \ 'Oops! Something went wrong! :(',
+ \ '',
+ \ 'ESLint couldn''t find a configuration file. To set up a configuration file for this project, please run:',
+ \ ' eslint --init',
+ \ '',
+ \ 'ESLint looked for configuration files in /some/path/or/other and its ancestors.',
+ \ '',
+ \ 'If you think you already have a configuration file or if you need more help, please stop by the ESLint chat room: https://gitter.im/eslint/eslint',
+ \ '',
+ \ ]
+
+ AssertEqual
+ \ [],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), g:config_error_lines[:])
+
+Execute(The eslint handler should print a message for config parsing errors):
+ let g:config_error_lines = [
+ \ 'Cannot read config file: /some/path/or/other/.eslintrc.js',
+ \ 'Error: Unexpected token <<',
+ \ '/some/path/or/other/.eslintrc.js:1',
+ \ '(function (exports, require, module, __filename, __dirname) { <<<>>>',
+ \ ' ^^',
+ \ 'SyntaxError: Unexpected token <<',
+ \ ' at Object.exports.runInThisContext (vm.js:76:16)',
+ \ ' at Module._compile (module.js:528:28)',
+ \ ' at Object.Module._extensions..js (module.js:565:10)',
+ \ ' at Module.load (module.js:473:32)',
+ \ ' at tryModuleLoad (module.js:432:12)',
+ \ ' at Function.Module._load (module.js:424:3)',
+ \ ' at Module.require (module.js:483:17)',
+ \ ' at require (internal/module.js:20:19)',
+ \ ' at module.exports (/usr/local/lib/node_modules/eslint/node_modules/require-uncached/index.js:14:12)',
+ \ ' at loadJSConfigFile (/usr/local/lib/node_modules/eslint/lib/config/config-file.js:160:16)',
+ \]
+
+ AssertEqual
+ \ [{
+ \ 'lnum': 1,
+ \ 'text': 'eslint configuration error (type :ALEDetail for more information)',
+ \ 'detail': join(g:config_error_lines, "\n"),
+ \ }],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), g:config_error_lines[:])
+
+Execute(Suppressing missing configs shouldn't suppress parsing errors):
+ let b:ale_javascript_eslint_suppress_missing_config = 1
+ let g:config_error_lines = [
+ \ 'Cannot read config file: /some/path/or/other/.eslintrc.js',
+ \ 'Error: Unexpected token <<',
+ \ '/some/path/or/other/.eslintrc.js:1',
+ \ '(function (exports, require, module, __filename, __dirname) { <<<>>>',
+ \ ' ^^',
+ \ 'SyntaxError: Unexpected token <<',
+ \ ' at Object.exports.runInThisContext (vm.js:76:16)',
+ \ ' at Module._compile (module.js:528:28)',
+ \ ' at Object.Module._extensions..js (module.js:565:10)',
+ \ ' at Module.load (module.js:473:32)',
+ \ ' at tryModuleLoad (module.js:432:12)',
+ \ ' at Function.Module._load (module.js:424:3)',
+ \ ' at Module.require (module.js:483:17)',
+ \ ' at require (internal/module.js:20:19)',
+ \ ' at module.exports (/usr/local/lib/node_modules/eslint/node_modules/require-uncached/index.js:14:12)',
+ \ ' at loadJSConfigFile (/usr/local/lib/node_modules/eslint/lib/config/config-file.js:160:16)',
+ \]
+
+ AssertEqual
+ \ [{
+ \ 'lnum': 1,
+ \ 'text': 'eslint configuration error (type :ALEDetail for more information)',
+ \ 'detail': join(g:config_error_lines, "\n"),
+ \ }],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), g:config_error_lines[:])
+
+Execute(The eslint handler should print a message for invalid configuration settings):
+ let g:config_error_lines = [
+ \ '/home/w0rp/git/wazoku/wazoku-spotlight/.eslintrc.js:',
+ \ ' Configuration for rule "indent" is invalid:',
+ \ ' Value "off" is the wrong type.',
+ \ '',
+ \ 'Error: /home/w0rp/git/wazoku/wazoku-spotlight/.eslintrc.js:',
+ \ ' Configuration for rule "indent" is invalid:',
+ \ ' Value "off" is the wrong type.',
+ \ '',
+ \ ' at validateRuleOptions (/usr/local/lib/node_modules/eslint/lib/config/config-validator.js:115:15)',
+ \ ' at /usr/local/lib/node_modules/eslint/lib/config/config-validator.js:162:13',
+ \ ' at Array.forEach (native)',
+ \ ' at Object.validate (/usr/local/lib/node_modules/eslint/lib/config/config-validator.js:161:35)',
+ \ ' at Object.load (/usr/local/lib/node_modules/eslint/lib/config/config-file.js:522:19)',
+ \ ' at loadConfig (/usr/local/lib/node_modules/eslint/lib/config.js:63:33)',
+ \ ' at getLocalConfig (/usr/local/lib/node_modules/eslint/lib/config.js:130:29)',
+ \ ' at Config.getConfig (/usr/local/lib/node_modules/eslint/lib/config.js:256:22)',
+ \ ' at processText (/usr/local/lib/node_modules/eslint/lib/cli-engine.js:224:33)',
+ \ ' at CLIEngine.executeOnText (/usr/local/lib/node_modules/eslint/lib/cli-engine.js:756:26)',
+ \]
+
+ AssertEqual
+ \ [{
+ \ 'lnum': 1,
+ \ 'text': 'eslint configuration error (type :ALEDetail for more information)',
+ \ 'detail': join(g:config_error_lines, "\n"),
+ \ }],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), g:config_error_lines[:])
+
+Execute(Suppressing missing configs shouldn't suppress invalid config errors):
+ let b:ale_javascript_eslint_suppress_missing_config = 1
+ let g:config_error_lines = [
+ \ '/home/w0rp/git/wazoku/wazoku-spotlight/.eslintrc.js:',
+ \ ' Configuration for rule "indent" is invalid:',
+ \ ' Value "off" is the wrong type.',
+ \ '',
+ \ 'Error: /home/w0rp/git/wazoku/wazoku-spotlight/.eslintrc.js:',
+ \ ' Configuration for rule "indent" is invalid:',
+ \ ' Value "off" is the wrong type.',
+ \ '',
+ \ ' at validateRuleOptions (/usr/local/lib/node_modules/eslint/lib/config/config-validator.js:115:15)',
+ \ ' at /usr/local/lib/node_modules/eslint/lib/config/config-validator.js:162:13',
+ \ ' at Array.forEach (native)',
+ \ ' at Object.validate (/usr/local/lib/node_modules/eslint/lib/config/config-validator.js:161:35)',
+ \ ' at Object.load (/usr/local/lib/node_modules/eslint/lib/config/config-file.js:522:19)',
+ \ ' at loadConfig (/usr/local/lib/node_modules/eslint/lib/config.js:63:33)',
+ \ ' at getLocalConfig (/usr/local/lib/node_modules/eslint/lib/config.js:130:29)',
+ \ ' at Config.getConfig (/usr/local/lib/node_modules/eslint/lib/config.js:256:22)',
+ \ ' at processText (/usr/local/lib/node_modules/eslint/lib/cli-engine.js:224:33)',
+ \ ' at CLIEngine.executeOnText (/usr/local/lib/node_modules/eslint/lib/cli-engine.js:756:26)',
+ \]
+
+ AssertEqual
+ \ [{
+ \ 'lnum': 1,
+ \ 'text': 'eslint configuration error (type :ALEDetail for more information)',
+ \ 'detail': join(g:config_error_lines, "\n"),
+ \ }],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), g:config_error_lines[:])
+
+Execute(The eslint handler should print a message when import is not used in a module):
+ let g:config_error_lines = [
+ \ 'ImportDeclaration should appear when the mode is ES6 and in the module context.',
+ \ 'AssertionError: ImportDeclaration should appear when the mode is ES6 and in the module context.',
+ \ ' at Referencer.ImportDeclaration (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint-scope/lib/referencer.js:597:9)',
+ \ ' at Referencer.Visitor.visit (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/esrecurse/esrecurse.js:122:34)',
+ \ ' at Referencer.Visitor.visitChildren (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/esrecurse/esrecurse.js:101:38)',
+ \ ' at Referencer.Program (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint-scope/lib/referencer.js:449:14)',
+ \ ' at Referencer.Visitor.visit (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/esrecurse/esrecurse.js:122:34)',
+ \ ' at Object.analyze (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint-scope/lib/index.js:138:16)',
+ \ ' at EventEmitter.module.exports.api.verify (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint/lib/eslint.js:887:40)',
+ \ ' at processText (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint/lib/cli-engine.js:278:31)',
+ \ ' at CLIEngine.executeOnText (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint/lib/cli-engine.js:734:26)',
+ \ ' at Object.execute (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint/lib/cli.js:171:42) ',
+ \]
+
+ AssertEqual
+ \ [{
+ \ 'lnum': 1,
+ \ 'text': 'eslint configuration error (type :ALEDetail for more information)',
+ \ 'detail': join(g:config_error_lines, "\n"),
+ \ }],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), g:config_error_lines[:])
+
+Execute(Suppressing missing configs shouldn't suppress module import errors):
+ let b:ale_javascript_eslint_suppress_missing_config = 1
+ let g:config_error_lines = [
+ \ 'ImportDeclaration should appear when the mode is ES6 and in the module context.',
+ \ 'AssertionError: ImportDeclaration should appear when the mode is ES6 and in the module context.',
+ \ ' at Referencer.ImportDeclaration (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint-scope/lib/referencer.js:597:9)',
+ \ ' at Referencer.Visitor.visit (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/esrecurse/esrecurse.js:122:34)',
+ \ ' at Referencer.Visitor.visitChildren (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/esrecurse/esrecurse.js:101:38)',
+ \ ' at Referencer.Program (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint-scope/lib/referencer.js:449:14)',
+ \ ' at Referencer.Visitor.visit (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/esrecurse/esrecurse.js:122:34)',
+ \ ' at Object.analyze (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint-scope/lib/index.js:138:16)',
+ \ ' at EventEmitter.module.exports.api.verify (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint/lib/eslint.js:887:40)',
+ \ ' at processText (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint/lib/cli-engine.js:278:31)',
+ \ ' at CLIEngine.executeOnText (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint/lib/cli-engine.js:734:26)',
+ \ ' at Object.execute (/home/w0rp/git/wazoku/wazoku-spotlight/spotlight/static/node_modules/eslint/lib/cli.js:171:42) ',
+ \]
+
+ AssertEqual
+ \ [{
+ \ 'lnum': 1,
+ \ 'text': 'eslint configuration error (type :ALEDetail for more information)',
+ \ 'detail': join(g:config_error_lines, "\n"),
+ \ }],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), g:config_error_lines[:])
+
+Execute(The eslint handler should hint about using typescript-eslint-parser):
+ call ale#test#SetFilename('foo.ts')
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 1,
+ \ 'text': 'Parsing error (You may need configure typescript-eslint-parser): The keyword ''interface'' is reserved',
+ \ 'type': 'E',
+ \ },
+ \ ],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), [
+ \ '[{"filePath":"foo.ts","messages":[{"ruleId":null,"fatal":true,"severity":2,"message":"Parsing error: The keyword ''interface'' is reserved","line":2,"column":1}],"errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"\ninterface test {}\n"}]',
+ \ ])
+
+Execute(eslint should warn about ignored files by default):
+ AssertEqual
+ \ [{
+ \ 'lnum': 0,
+ \ 'type': 'W',
+ \ 'text': 'File ignored because of a matching ignore pattern. Use "--no-ignore" to override.'
+ \ }],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), [
+ \ '[{"filePath":"/path/to/some/ignored/file.js","messages":[{"fatal":false,"severity":1,"message":"File ignored because of a matching ignore pattern. Use \"--no-ignore\" to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0}]',
+ \ ])
+
+ AssertEqual
+ \ [{
+ \ 'lnum': 0,
+ \ 'type': 'W',
+ \ 'text': 'File ignored by default. Use "--ignore-pattern ''!node_modules/*''" to override.',
+ \ }],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), [
+ \ '[{"filePath":"/path/to/some/ignored/file.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use \"--ignore-pattern ''!node_modules/*''\" to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0}]',
+ \ ])
+
+Execute(eslint should not warn about ignored files when explicitly disabled):
+ let g:ale_javascript_eslint_suppress_eslintignore = 1
+
+ AssertEqual
+ \ [],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), [
+ \ '[{"filePath":"/path/to/some/ignored/file.js","messages":[{"fatal":false,"severity":1,"message":"File ignored because of a matching ignore pattern. Use \"--no-ignore\" to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0}]',
+ \ ])
+
+ AssertEqual
+ \ [],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), [
+ \ '[{"filePath":"/path/to/some/ignored/file.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use \"--ignore-pattern ''!node_modules/*''\" to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0}]',
+ \ ])
+
+Execute(Failing to connect to eslint_d should be handled correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'text': 'Could not connect to eslint_d. Try updating eslint_d or killing it.',
+ \ },
+ \ ],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), [
+ \ 'Could not connect',
+ \ ])
+
+Execute(Disabling warnings about trailing spaces should work):
+ call ale#test#SetFilename('foo.js')
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 16,
+ \ 'code': 'no-trailing-spaces',
+ \ 'type': 'W',
+ \ 'text': 'Trailing spaces not allowed.',
+ \ },
+ \ ],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), [
+ \ '[{"filePath":"foo.js","messages":[{"ruleId":"no-trailing-spaces","severity":1,"message":"Trailing spaces not allowed.","line":2,"column":16,"nodeType":"Program","fix":{"range":[16,17],"text":""}}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":1,"source":"\nconsole.log(1); \n"}]'
+ \ ])
+
+ let g:ale_warn_about_trailing_whitespace = 0
+
+ AssertEqual
+ \ [],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), [
+ \ '[{"filePath":"foo.js","messages":[{"ruleId":"no-trailing-spaces","severity":1,"message":"Trailing spaces not allowed.","line":2,"column":16,"nodeType":"Program","fix":{"range":[16,17],"text":""}}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":1,"source":"\nconsole.log(1); \n"}]'
+ \ ])
+
+ let g:ale_warn_about_trailing_whitespace = 1
+ let b:ale_warn_about_trailing_whitespace = 0
+
+ AssertEqual
+ \ [],
+ \ ale#handlers#eslint#HandleJSON(bufnr(''), [
+ \ '[{"filePath":"foo.js","messages":[{"ruleId":"no-trailing-spaces","severity":1,"message":"Trailing spaces not allowed.","line":2,"column":16,"nodeType":"Program","fix":{"range":[16,17],"text":""}}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":1,"source":"\nconsole.log(1); \n"}]'
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_fecs_handler.vader b/sources_non_forked/ale/test/handler/test_fecs_handler.vader
new file mode 100644
index 00000000..7c216b8d
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_fecs_handler.vader
@@ -0,0 +1,35 @@
+Before:
+ runtime autoload/ale/handlers/fecs.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(fecs should parse lines correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 20,
+ \ 'col': 25,
+ \ 'text': 'Unexpected console statement.',
+ \ 'code': 'no-console',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'lnum': 24,
+ \ 'col': 36,
+ \ 'text': 'Missing radix parameter.',
+ \ 'code': 'radix',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 25,
+ \ 'col': 6,
+ \ 'text': 'Missing static property value.',
+ \ 'type': 'E',
+ \ },
+ \ ],
+ \ ale#handlers#fecs#Handle(347, [
+ \ 'fecs WARN → line 20, col 25: Unexpected console statement. (no-console)',
+ \ 'fecs ERROR → line 24, col 36: Missing radix parameter. (radix)',
+ \ 'fecs ERROR → line 25, col 6: Missing static property value.',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_fish_handler.vader b/sources_non_forked/ale/test/handler/test_fish_handler.vader
new file mode 100644
index 00000000..ad3a963c
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_fish_handler.vader
@@ -0,0 +1,61 @@
+Before:
+ runtime ale_linters/fish/fish.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The fish handler should handle basic warnings and syntax errors):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 20,
+ \ 'col': 23,
+ \ 'text': "Unsupported use of '||'. In fish, please use 'COMMAND; or COMMAND'.",
+ \ },
+ \ {
+ \ 'lnum': 26,
+ \ 'col': 7,
+ \ 'text': "Illegal command name '(prompt_pwd)'",
+ \ },
+ \ {
+ \ 'lnum': 36,
+ \ 'col': 1,
+ \ 'text': "'end' outside of a block",
+ \ },
+ \ ],
+ \ ale_linters#fish#fish#Handle(1, [
+ \ "fish_prompt.fish (line 20): Unsupported use of '||'. In fish, please use 'COMMAND; or COMMAND'.",
+ \ 'if set -q SSH_CLIENT || set -q SSH_TTY',
+ \ ' ^',
+ \ "fish_prompt.fish (line 26): Illegal command name '(prompt_pwd)'",
+ \ ' (prompt_pwd) \',
+ \ ' ^',
+ \ "fish_prompt.fish (line 36): 'end' outside of a block",
+ \ 'end',
+ \ '^',
+ \ 'config.fish (line 45):',
+ \ "abbr --add p 'cd ~/Projects'",
+ \ '^',
+ \ ])
+
+Execute(The fish handler should handle problems where the problem before before the line with the line number):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 23,
+ \ 'text': 'Unsupported use of ''||''. In fish, please use ''COMMAND; or COMMAND''.',
+ \ },
+ \ {
+ \ 'lnum': 5,
+ \ 'col': 1,
+ \ 'text': 'wat',
+ \ },
+ \ ],
+ \ ale_linters#fish#fish#Handle(bufnr(''), [
+ \ 'Unsupported use of ''||''. In fish, please use ''COMMAND; or COMMAND''.',
+ \ '/tmp/vLz620o/258/test.fish (line 2): if set -q SSH_CLIENT || set -q SSH_TTY',
+ \ ' ^',
+ \ '/tmp/vLz620o/258/test.fish (line 5): wat',
+ \ ' ^',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_flake8_handler.vader b/sources_non_forked/ale/test/handler/test_flake8_handler.vader
new file mode 100644
index 00000000..1c9956fa
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_flake8_handler.vader
@@ -0,0 +1,276 @@
+Before:
+ Save g:ale_warn_about_trailing_blank_lines
+ Save g:ale_warn_about_trailing_whitespace
+
+ let g:ale_warn_about_trailing_blank_lines = 1
+ let g:ale_warn_about_trailing_whitespace = 1
+
+ runtime ale_linters/python/flake8.vim
+
+After:
+ Restore
+
+ unlet! b:ale_warn_about_trailing_blank_lines
+ unlet! b:ale_warn_about_trailing_whitespace
+
+ call ale#linter#Reset()
+
+Execute(The flake8 handler should handle basic warnings and syntax errors):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 6,
+ \ 'vcol': 1,
+ \ 'type': 'E',
+ \ 'text': 'indentation is not a multiple of four',
+ \ 'code': 'E111',
+ \ 'sub_type': 'style',
+ \ },
+ \ {
+ \ 'lnum': 7,
+ \ 'col': 6,
+ \ 'vcol': 1,
+ \ 'type': 'W',
+ \ 'text': 'some warning',
+ \ 'code': 'W123',
+ \ 'sub_type': 'style',
+ \ },
+ \ {
+ \ 'lnum': 8,
+ \ 'col': 3,
+ \ 'vcol': 1,
+ \ 'type': 'E',
+ \ 'text': 'SyntaxError: invalid syntax',
+ \ 'code': 'E999',
+ \ },
+ \ ],
+ \ ale_linters#python#flake8#Handle(1, [
+ \ 'stdin:6:6: E111 indentation is not a multiple of four',
+ \ 'stdin:7:6: W123 some warning',
+ \ 'stdin:8:3: E999 SyntaxError: invalid syntax',
+ \ ])
+
+Execute(The flake8 handler should set end column indexes for certain errors):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 25,
+ \ 'col': 1,
+ \ 'vcol': 1,
+ \ 'type': 'E',
+ \ 'end_col': 3,
+ \ 'text': 'undefined name ''foo''',
+ \ 'code': 'F821',
+ \ },
+ \ {
+ \ 'lnum': 28,
+ \ 'col': 5,
+ \ 'vcol': 1,
+ \ 'type': 'E',
+ \ 'end_col': 9,
+ \ 'text': 'hello may be undefined, or defined from star imports: x',
+ \ 'code': 'F405',
+ \ },
+ \ {
+ \ 'lnum': 104,
+ \ 'col': 5,
+ \ 'vcol': 1,
+ \ 'type': 'E',
+ \ 'end_col': 12,
+ \ 'text': '''continue'' not properly in loop',
+ \ 'code': 'F999',
+ \ },
+ \ {
+ \ 'lnum': 106,
+ \ 'col': 5,
+ \ 'vcol': 1,
+ \ 'type': 'E',
+ \ 'end_col': 9,
+ \ 'text': '''break'' outside loop',
+ \ 'code': 'F999',
+ \ },
+ \ {
+ \ 'lnum': 109,
+ \ 'col': 5,
+ \ 'vcol': 1,
+ \ 'type': 'E',
+ \ 'end_col': 8,
+ \ 'text': 'local variable ''test'' is assigned to but never used',
+ \ 'code': 'F841',
+ \ },
+ \ ],
+ \ ale_linters#python#flake8#Handle(1, [
+ \ 'foo.py:25:1: F821 undefined name ''foo''',
+ \ 'foo.py:28:5: F405 hello may be undefined, or defined from star imports: x',
+ \ 'foo.py:104:5: F999 ''continue'' not properly in loop',
+ \ 'foo.py:106:5: F999 ''break'' outside loop',
+ \ 'foo.py:109:5: F841 local variable ''test'' is assigned to but never used',
+ \ ])
+
+Execute(The flake8 handler should handle stack traces):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'text': 'ImportError: No module named parser (See :ALEDetail)',
+ \ 'detail': join([
+ \ 'Traceback (most recent call last):',
+ \ ' File "/usr/local/bin/flake8", line 7, in ',
+ \ ' from flake8.main.cli import main',
+ \ ' File "/usr/local/lib/python2.7/dist-packages/flake8/main/cli.py", line 2, in ',
+ \ ' from flake8.main import application',
+ \ ' File "/usr/local/lib/python2.7/dist-packages/flake8/main/application.py", line 17, in ',
+ \ ' from flake8.plugins import manager as plugin_manager',
+ \ ' File "/usr/local/lib/python2.7/dist-packages/flake8/plugins/manager.py", line 5, in ',
+ \ ' import pkg_resources',
+ \ ' File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 35, in ',
+ \ ' import email.parser',
+ \ 'ImportError: No module named parser',
+ \ ], "\n"),
+ \ },
+ \ ],
+ \ ale_linters#python#flake8#Handle(42, [
+ \ 'Traceback (most recent call last):',
+ \ ' File "/usr/local/bin/flake8", line 7, in ',
+ \ ' from flake8.main.cli import main',
+ \ ' File "/usr/local/lib/python2.7/dist-packages/flake8/main/cli.py", line 2, in ',
+ \ ' from flake8.main import application',
+ \ ' File "/usr/local/lib/python2.7/dist-packages/flake8/main/application.py", line 17, in ',
+ \ ' from flake8.plugins import manager as plugin_manager',
+ \ ' File "/usr/local/lib/python2.7/dist-packages/flake8/plugins/manager.py", line 5, in ',
+ \ ' import pkg_resources',
+ \ ' File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 35, in ',
+ \ ' import email.parser',
+ \ 'ImportError: No module named parser',
+ \ ])
+
+Execute(The flake8 handler should handle names with spaces):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 6,
+ \ 'vcol': 1,
+ \ 'type': 'E',
+ \ 'text': 'indentation is not a multiple of four',
+ \ 'code': 'E111',
+ \ 'sub_type': 'style',
+ \ },
+ \ ],
+ \ ale_linters#python#flake8#Handle(42, [
+ \ 'C:\something\with spaces.py:6:6: E111 indentation is not a multiple of four',
+ \ ])
+
+Execute(Warnings about trailing whitespace should be reported by default):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 1,
+ \ 'vcol': 1,
+ \ 'code': 'W291',
+ \ 'type': 'W',
+ \ 'sub_type': 'style',
+ \ 'text': 'who cares',
+ \ },
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 1,
+ \ 'vcol': 1,
+ \ 'code': 'W293',
+ \ 'type': 'W',
+ \ 'sub_type': 'style',
+ \ 'text': 'who cares',
+ \ },
+ \ ],
+ \ ale_linters#python#flake8#Handle(bufnr(''), [
+ \ 'foo.py:6:1: W291 who cares',
+ \ 'foo.py:6:1: W293 who cares',
+ \ ])
+
+Execute(Disabling trailing whitespace warnings should work):
+ let b:ale_warn_about_trailing_whitespace = 0
+
+ AssertEqual
+ \ [
+ \ ],
+ \ ale_linters#python#flake8#Handle(bufnr(''), [
+ \ 'foo.py:6:1: W291 who cares',
+ \ 'foo.py:6:1: W293 who cares',
+ \ ])
+
+Execute(Warnings about trailing blank lines should be reported by default):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 1,
+ \ 'vcol': 1,
+ \ 'code': 'W391',
+ \ 'type': 'W',
+ \ 'sub_type': 'style',
+ \ 'text': 'blank line at end of file',
+ \ },
+ \ ],
+ \ ale_linters#python#flake8#Handle(bufnr(''), [
+ \ 'foo.py:6:1: W391 blank line at end of file',
+ \ ])
+
+Execute(Disabling trailing blank line warnings should work):
+ let b:ale_warn_about_trailing_blank_lines = 0
+
+ AssertEqual
+ \ [
+ \ ],
+ \ ale_linters#python#flake8#Handle(bufnr(''), [
+ \ 'foo.py:6:1: W391 blank line at end of file',
+ \ ])
+
+Execute(F401 should be a warning):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 1,
+ \ 'vcol': 1,
+ \ 'code': 'F401',
+ \ 'type': 'W',
+ \ 'text': 'module imported but unused',
+ \ },
+ \ ],
+ \ ale_linters#python#flake8#Handle(bufnr(''), [
+ \ 'foo.py:6:1: F401 module imported but unused',
+ \ ])
+
+Execute(E112 should be a syntax error):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 1,
+ \ 'vcol': 1,
+ \ 'code': 'E112',
+ \ 'type': 'E',
+ \ 'text': 'expected an indented block',
+ \ },
+ \ ],
+ \ ale_linters#python#flake8#Handle(bufnr(''), [
+ \ 'foo.py:6:1: E112 expected an indented block',
+ \ ])
+
+Execute(Compatibility with hacking which uses older style flake8):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 1,
+ \ 'vcol': 1,
+ \ 'code': 'H306',
+ \ 'type': 'W',
+ \ 'text': 'imports not in alphabetical order (smtplib, io)',
+ \ },
+ \ ],
+ \ ale_linters#python#flake8#Handle(bufnr(''), [
+ \ 'foo.py:6:1: H306: imports not in alphabetical order (smtplib, io)',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_flakehell_handler.vader b/sources_non_forked/ale/test/handler/test_flakehell_handler.vader
new file mode 100644
index 00000000..1f77bd96
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_flakehell_handler.vader
@@ -0,0 +1,276 @@
+Before:
+ Save g:ale_warn_about_trailing_blank_lines
+ Save g:ale_warn_about_trailing_whitespace
+
+ let g:ale_warn_about_trailing_blank_lines = 1
+ let g:ale_warn_about_trailing_whitespace = 1
+
+ runtime ale_linters/python/flakehell.vim
+
+After:
+ Restore
+
+ unlet! b:ale_warn_about_trailing_blank_lines
+ unlet! b:ale_warn_about_trailing_whitespace
+
+ call ale#linter#Reset()
+
+Execute(The flakehell handler should handle basic warnings and syntax errors):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 6,
+ \ 'vcol': 1,
+ \ 'type': 'E',
+ \ 'text': 'indentation is not a multiple of four',
+ \ 'code': 'E111',
+ \ 'sub_type': 'style',
+ \ },
+ \ {
+ \ 'lnum': 7,
+ \ 'col': 6,
+ \ 'vcol': 1,
+ \ 'type': 'W',
+ \ 'text': 'some warning',
+ \ 'code': 'W123',
+ \ 'sub_type': 'style',
+ \ },
+ \ {
+ \ 'lnum': 8,
+ \ 'col': 3,
+ \ 'vcol': 1,
+ \ 'type': 'E',
+ \ 'text': 'SyntaxError: invalid syntax',
+ \ 'code': 'E999',
+ \ },
+ \ ],
+ \ ale_linters#python#flakehell#Handle(1, [
+ \ 'stdin:6:6: E111 indentation is not a multiple of four',
+ \ 'stdin:7:6: W123 some warning',
+ \ 'stdin:8:3: E999 SyntaxError: invalid syntax',
+ \ ])
+
+Execute(The flakehell handler should set end column indexes for certain errors):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 25,
+ \ 'col': 1,
+ \ 'vcol': 1,
+ \ 'type': 'E',
+ \ 'end_col': 3,
+ \ 'text': 'undefined name ''foo''',
+ \ 'code': 'F821',
+ \ },
+ \ {
+ \ 'lnum': 28,
+ \ 'col': 5,
+ \ 'vcol': 1,
+ \ 'type': 'E',
+ \ 'end_col': 9,
+ \ 'text': 'hello may be undefined, or defined from star imports: x',
+ \ 'code': 'F405',
+ \ },
+ \ {
+ \ 'lnum': 104,
+ \ 'col': 5,
+ \ 'vcol': 1,
+ \ 'type': 'E',
+ \ 'end_col': 12,
+ \ 'text': '''continue'' not properly in loop',
+ \ 'code': 'F999',
+ \ },
+ \ {
+ \ 'lnum': 106,
+ \ 'col': 5,
+ \ 'vcol': 1,
+ \ 'type': 'E',
+ \ 'end_col': 9,
+ \ 'text': '''break'' outside loop',
+ \ 'code': 'F999',
+ \ },
+ \ {
+ \ 'lnum': 109,
+ \ 'col': 5,
+ \ 'vcol': 1,
+ \ 'type': 'E',
+ \ 'end_col': 8,
+ \ 'text': 'local variable ''test'' is assigned to but never used',
+ \ 'code': 'F841',
+ \ },
+ \ ],
+ \ ale_linters#python#flakehell#Handle(1, [
+ \ 'foo.py:25:1: F821 undefined name ''foo''',
+ \ 'foo.py:28:5: F405 hello may be undefined, or defined from star imports: x',
+ \ 'foo.py:104:5: F999 ''continue'' not properly in loop',
+ \ 'foo.py:106:5: F999 ''break'' outside loop',
+ \ 'foo.py:109:5: F841 local variable ''test'' is assigned to but never used',
+ \ ])
+
+Execute(The flakehell handler should handle stack traces):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'text': 'ImportError: No module named parser (See :ALEDetail)',
+ \ 'detail': join([
+ \ 'Traceback (most recent call last):',
+ \ ' File "/usr/local/bin/flakehell", line 7, in ',
+ \ ' from flakehell.main.cli import main',
+ \ ' File "/usr/local/lib/python2.7/dist-packages/flakehell/main/cli.py", line 2, in ',
+ \ ' from flakehell.main import application',
+ \ ' File "/usr/local/lib/python2.7/dist-packages/flakehell/main/application.py", line 17, in ',
+ \ ' from flakehell.plugins import manager as plugin_manager',
+ \ ' File "/usr/local/lib/python2.7/dist-packages/flakehell/plugins/manager.py", line 5, in ',
+ \ ' import pkg_resources',
+ \ ' File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 35, in ',
+ \ ' import email.parser',
+ \ 'ImportError: No module named parser',
+ \ ], "\n"),
+ \ },
+ \ ],
+ \ ale_linters#python#flakehell#Handle(42, [
+ \ 'Traceback (most recent call last):',
+ \ ' File "/usr/local/bin/flakehell", line 7, in ',
+ \ ' from flakehell.main.cli import main',
+ \ ' File "/usr/local/lib/python2.7/dist-packages/flakehell/main/cli.py", line 2, in ',
+ \ ' from flakehell.main import application',
+ \ ' File "/usr/local/lib/python2.7/dist-packages/flakehell/main/application.py", line 17, in ',
+ \ ' from flakehell.plugins import manager as plugin_manager',
+ \ ' File "/usr/local/lib/python2.7/dist-packages/flakehell/plugins/manager.py", line 5, in ',
+ \ ' import pkg_resources',
+ \ ' File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 35, in ',
+ \ ' import email.parser',
+ \ 'ImportError: No module named parser',
+ \ ])
+
+Execute(The flakehell handler should handle names with spaces):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 6,
+ \ 'vcol': 1,
+ \ 'type': 'E',
+ \ 'text': 'indentation is not a multiple of four',
+ \ 'code': 'E111',
+ \ 'sub_type': 'style',
+ \ },
+ \ ],
+ \ ale_linters#python#flakehell#Handle(42, [
+ \ 'C:\something\with spaces.py:6:6: E111 indentation is not a multiple of four',
+ \ ])
+
+Execute(Warnings about trailing whitespace should be reported by default):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 1,
+ \ 'vcol': 1,
+ \ 'code': 'W291',
+ \ 'type': 'W',
+ \ 'sub_type': 'style',
+ \ 'text': 'who cares',
+ \ },
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 1,
+ \ 'vcol': 1,
+ \ 'code': 'W293',
+ \ 'type': 'W',
+ \ 'sub_type': 'style',
+ \ 'text': 'who cares',
+ \ },
+ \ ],
+ \ ale_linters#python#flakehell#Handle(bufnr(''), [
+ \ 'foo.py:6:1: W291 who cares',
+ \ 'foo.py:6:1: W293 who cares',
+ \ ])
+
+Execute(Disabling trailing whitespace warnings should work):
+ let b:ale_warn_about_trailing_whitespace = 0
+
+ AssertEqual
+ \ [
+ \ ],
+ \ ale_linters#python#flakehell#Handle(bufnr(''), [
+ \ 'foo.py:6:1: W291 who cares',
+ \ 'foo.py:6:1: W293 who cares',
+ \ ])
+
+Execute(Warnings about trailing blank lines should be reported by default):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 1,
+ \ 'vcol': 1,
+ \ 'code': 'W391',
+ \ 'type': 'W',
+ \ 'sub_type': 'style',
+ \ 'text': 'blank line at end of file',
+ \ },
+ \ ],
+ \ ale_linters#python#flakehell#Handle(bufnr(''), [
+ \ 'foo.py:6:1: W391 blank line at end of file',
+ \ ])
+
+Execute(Disabling trailing blank line warnings should work):
+ let b:ale_warn_about_trailing_blank_lines = 0
+
+ AssertEqual
+ \ [
+ \ ],
+ \ ale_linters#python#flakehell#Handle(bufnr(''), [
+ \ 'foo.py:6:1: W391 blank line at end of file',
+ \ ])
+
+Execute(F401 should be a warning):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 1,
+ \ 'vcol': 1,
+ \ 'code': 'F401',
+ \ 'type': 'W',
+ \ 'text': 'module imported but unused',
+ \ },
+ \ ],
+ \ ale_linters#python#flakehell#Handle(bufnr(''), [
+ \ 'foo.py:6:1: F401 module imported but unused',
+ \ ])
+
+Execute(E112 should be a syntax error):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 1,
+ \ 'vcol': 1,
+ \ 'code': 'E112',
+ \ 'type': 'E',
+ \ 'text': 'expected an indented block',
+ \ },
+ \ ],
+ \ ale_linters#python#flakehell#Handle(bufnr(''), [
+ \ 'foo.py:6:1: E112 expected an indented block',
+ \ ])
+
+Execute(Compatibility with hacking which uses older style flakehell):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 1,
+ \ 'vcol': 1,
+ \ 'code': 'H306',
+ \ 'type': 'W',
+ \ 'text': 'imports not in alphabetical order (smtplib, io)',
+ \ },
+ \ ],
+ \ ale_linters#python#flakehell#Handle(bufnr(''), [
+ \ 'foo.py:6:1: H306: imports not in alphabetical order (smtplib, io)',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_flawfinder_handler.vader b/sources_non_forked/ale/test/handler/test_flawfinder_handler.vader
new file mode 100644
index 00000000..708bac2a
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_flawfinder_handler.vader
@@ -0,0 +1,57 @@
+Before:
+ Save g:ale_c_flawfinder_error_severity
+
+ unlet! g:ale_c_flawfinder_error_severity
+ unlet! b:ale_c_flawfinder_error_severity
+
+ runtime ale_linters/c/flawfinder.vim
+
+After:
+ unlet! g:ale_c_flawfinder_error_severity
+ Restore
+
+Execute(The Flawfinder handler should ignore other lines of output):
+ AssertEqual
+ \ [],
+ \ ale#handlers#flawfinder#HandleFlawfinderFormat(347, [
+ \ 'foo',
+ \ 'bar',
+ \ 'baz',
+ \ ])
+
+Execute(The Flawfinder handler should work):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 31,
+ \ 'col': 4,
+ \ 'type': 'W',
+ \ 'text': "(buffer) strncpy: Easily used incorrectly",
+ \ },
+ \ ],
+ \ ale#handlers#flawfinder#HandleFlawfinderFormat(347, [
+ \ ":31:4: [1] (buffer) strncpy:Easily used incorrectly",
+ \ ])
+
+Execute(The Flawfinder error severity level should be configurable):
+ let b:ale_c_flawfinder_error_severity = 2
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 12,
+ \ 'col': 4,
+ \ 'type': 'E',
+ \ 'text': "(buffer) char: Statically-sized arrays can be bad",
+ \ },
+ \ {
+ \ 'lnum': 31,
+ \ 'col': 4,
+ \ 'type': 'W',
+ \ 'text': "(buffer) strncpy: Easily used incorrectly",
+ \ },
+ \ ],
+ \ ale#handlers#flawfinder#HandleFlawfinderFormat(bufnr(''), [
+ \ ":12:4: [2] (buffer) char:Statically-sized arrays can be bad",
+ \ ":31:4: [1] (buffer) strncpy:Easily used incorrectly",
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_flow_handler.vader b/sources_non_forked/ale/test/handler/test_flow_handler.vader
new file mode 100644
index 00000000..055ba026
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_flow_handler.vader
@@ -0,0 +1,507 @@
+Before:
+ runtime ale_linters/javascript/flow.vim
+
+After:
+ unlet! g:flow_output
+ unlet! g:expected
+ unlet! g:actual
+ call ale#linter#Reset()
+
+Execute(The flow handler should throw away non-JSON lines):
+ AssertEqual
+ \ [],
+ \ ale_linters#javascript#flow#Handle(bufnr(''), [
+ \ 'Already up-to-date.',
+ \ '{"flowVersion":"0.50.0","errors":[],"passed":true}',
+ \ ])
+ AssertEqual
+ \ [],
+ \ ale_linters#javascript#flow#Handle(bufnr(''), [
+ \ 'foo',
+ \ 'bar',
+ \ 'baz',
+ \ '{"flowVersion":"0.50.0","errors":[],"passed":true}',
+ \ ])
+
+Execute(The flow handler should process errors correctly.):
+ silent! noautocmd file /home/w0rp/Downloads/graphql-js/src/language/parser.js
+
+ let g:flow_output = {
+ \ "flowVersion": "0.39.0",
+ \ "errors": [
+ \ {
+ \ "kind": "infer",
+ \ "level": "error",
+ \ "message": [
+ \ {
+ \ "context": " return 1",
+ \ "descr": "number",
+ \ "type": "Blame",
+ \ "loc": {
+ \ "source": expand('%:p'),
+ \ "type": "SourceFile",
+ \ "start": {
+ \ "line": 417,
+ \ "column": 10,
+ \ "offset": 9503
+ \ },
+ \ "end": {
+ \ "line": 417,
+ \ "column": 10,
+ \ "offset": 9504
+ \ }
+ \ },
+ \ "path": expand('%:p'),
+ \ "line": 417,
+ \ "endline": 417,
+ \ "start": 10,
+ \ "end": 10
+ \ },
+ \ {
+ \ "context": v:null,
+ \ "descr": "This type is incompatible with the expected return type of",
+ \ "type": "Comment",
+ \ "path": "",
+ \ "line": 0,
+ \ "endline": 0,
+ \ "start": 1,
+ \ "end": 0
+ \ },
+ \ {
+ \ "context": "function parseArguments(lexer: Lexer<*>): Array {",
+ \ "descr": "array type",
+ \ "type": "Blame",
+ \ "loc": {
+ \ "source": expand('%:p'),
+ \ "type": "SourceFile",
+ \ "start": {
+ \ "line": 416,
+ \ "column": 43,
+ \ "offset": 9472
+ \ },
+ \ "end": {
+ \ "line": 416,
+ \ "column": 61,
+ \ "offset": 9491
+ \ }
+ \ },
+ \ "path": expand('%:p'),
+ \ "line": 416,
+ \ "endline": 416,
+ \ "start": 43,
+ \ "end": 61
+ \ }
+ \ ]
+ \ },
+ \ {
+ \ "kind": "infer",
+ \ "level": "warning",
+ \ "message": [
+ \ {
+ \ "context": " return peek(lexer, TokenKind.PAREN_L) ?",
+ \ "descr": "unreachable code",
+ \ "type": "Blame",
+ \ "loc": {
+ \ "source": expand('%:p'),
+ \ "type": "SourceFile",
+ \ "start": {
+ \ "line": 419,
+ \ "column": 3,
+ \ "offset": 9508
+ \ },
+ \ "end": {
+ \ "line": 421,
+ \ "column": 7,
+ \ "offset": 9626
+ \ }
+ \ },
+ \ "path": expand('%:p'),
+ \ "line": 419,
+ \ "endline": 421,
+ \ "start": 3,
+ \ "end": 7
+ \ }
+ \ ]
+ \ }
+ \ ],
+ \ "passed": v:false
+ \}
+
+ let g:actual = ale_linters#javascript#flow#Handle(bufnr(''), [json_encode(g:flow_output)])
+ let g:expected = [
+ \ {
+ \ 'lnum': 417,
+ \ 'type': 'E',
+ \ 'col': 10,
+ \ 'text': 'number: This type is incompatible with the expected return type of array type',
+ \ },
+ \ {
+ \ 'lnum': 419,
+ \ 'type': 'W',
+ \ 'col': 3,
+ \ 'text': 'unreachable code:',
+ \ },
+ \]
+
+ AssertEqual g:expected, g:actual
+
+Execute(The flow handler should fetch the correct location for the currently opened file, even when it's not in the first message.):
+ silent! noautocmd file /Users/rav/Projects/vim-ale-flow/index.js
+
+ let g:flow_output = {
+ \ "flowVersion": "0.44.0",
+ \ "errors": [{
+ \ "operation": {
+ \ "context": " , document.getElementById('foo')",
+ \ "descr": "React element `Foo`",
+ \ "type": "Blame",
+ \ "loc": {
+ \ "source": expand('%:p'),
+ \ "type": "SourceFile",
+ \ "start": {
+ \ "line": 6,
+ \ "column": 3,
+ \ "offset": 92
+ \ },
+ \ "end": {
+ \ "line": 6,
+ \ "column": 18,
+ \ "offset": 108
+ \ }
+ \ },
+ \ "path": expand('%:p'),
+ \ "line": 6,
+ \ "endline": 6,
+ \ "start": 3,
+ \ "end": 18
+ \ },
+ \ "kind": "infer",
+ \ "level": "error",
+ \ "message": [{
+ \ "context": "module.exports = function(props: Props) {",
+ \ "descr": "property `bar`",
+ \ "type": "Blame",
+ \ "loc": {
+ \ "source": "/Users/rav/Projects/vim-ale-flow/foo.js",
+ \ "type": "SourceFile",
+ \ "start": {
+ \ "line": 9,
+ \ "column": 34,
+ \ "offset": 121
+ \ },
+ \ "end": {
+ \ "line": 9,
+ \ "column": 38,
+ \ "offset": 126
+ \ }
+ \ },
+ \ "path": "/Users/rav/Projects/vim-ale-flow/foo.js",
+ \ "line": 9,
+ \ "endline": 9,
+ \ "start": 34,
+ \ "end": 38
+ \ }, {
+ \ "context": v:null,
+ \ "descr": "Property not found in",
+ \ "type": "Comment",
+ \ "path": "",
+ \ "line": 0,
+ \ "endline": 0,
+ \ "start": 1,
+ \ "end": 0
+ \ }, {
+ \ "context": " , document.getElementById('foo')",
+ \ "descr": "props of React element `Foo`",
+ \ "type": "Blame",
+ \ "loc": {
+ \ "source": expand('%:p'),
+ \ "type": "SourceFile",
+ \ "start": {
+ \ "line": 6,
+ \ "column": 3,
+ \ "offset": 92
+ \ },
+ \ "end": {
+ \ "line": 6,
+ \ "column": 18,
+ \ "offset": 108
+ \ }
+ \ },
+ \ "path": expand('%:p'),
+ \ "line": 6,
+ \ "endline": 6,
+ \ "start": 3,
+ \ "end": 18
+ \ }]
+ \ }],
+ \ "passed": v:false
+ \}
+
+ let g:actual = ale_linters#javascript#flow#Handle(bufnr(''), [json_encode(g:flow_output)])
+ let g:expected = [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 3,
+ \ 'type': 'E',
+ \ 'text': 'property `bar`: Property not found in props of React element `Foo` See also: React element `Foo`',
+ \ }
+ \]
+
+ AssertEqual g:expected, g:actual
+
+Execute(The flow handler should handle relative paths):
+ silent! noautocmd file /Users/rav/Projects/vim-ale-flow/index.js
+
+ let g:flow_output = {
+ \ "flowVersion": "0.44.0",
+ \ "errors": [{
+ \ "operation": {
+ \ "context": " , document.getElementById('foo')",
+ \ "descr": "React element `Foo`",
+ \ "type": "Blame",
+ \ "loc": {
+ \ "source": expand('%:p'),
+ \ "type": "SourceFile",
+ \ "start": {
+ \ "line": 6,
+ \ "column": 3,
+ \ "offset": 92
+ \ },
+ \ "end": {
+ \ "line": 6,
+ \ "column": 18,
+ \ "offset": 108
+ \ }
+ \ },
+ \ "path": expand('%:p'),
+ \ "line": 6,
+ \ "endline": 6,
+ \ "start": 3,
+ \ "end": 18
+ \ },
+ \ "kind": "infer",
+ \ "level": "error",
+ \ "message": [{
+ \ "context": "module.exports = function(props: Props) {",
+ \ "descr": "property `bar`",
+ \ "type": "Blame",
+ \ "loc": {
+ \ "source": "vim-ale-flow/foo.js",
+ \ "type": "SourceFile",
+ \ "start": {
+ \ "line": 9,
+ \ "column": 34,
+ \ "offset": 121
+ \ },
+ \ "end": {
+ \ "line": 9,
+ \ "column": 38,
+ \ "offset": 126
+ \ }
+ \ },
+ \ "path": "vim-ale-flow/foo.js",
+ \ "line": 9,
+ \ "endline": 9,
+ \ "start": 34,
+ \ "end": 38
+ \ }, {
+ \ "context": v:null,
+ \ "descr": "Property not found in",
+ \ "type": "Comment",
+ \ "path": "",
+ \ "line": 0,
+ \ "endline": 0,
+ \ "start": 1,
+ \ "end": 0
+ \ }, {
+ \ "context": " , document.getElementById('foo')",
+ \ "descr": "props of React element `Foo`",
+ \ "type": "Blame",
+ \ "loc": {
+ \ "source": expand('%:p'),
+ \ "type": "SourceFile",
+ \ "start": {
+ \ "line": 6,
+ \ "column": 3,
+ \ "offset": 92
+ \ },
+ \ "end": {
+ \ "line": 6,
+ \ "column": 18,
+ \ "offset": 108
+ \ }
+ \ },
+ \ "path": expand('%:p'),
+ \ "line": 6,
+ \ "endline": 6,
+ \ "start": 3,
+ \ "end": 18
+ \ }]
+ \ }],
+ \ "passed": v:false
+ \}
+
+ let g:actual = ale_linters#javascript#flow#Handle(bufnr(''), [json_encode(g:flow_output)])
+ let g:expected = [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 3,
+ \ 'type': 'E',
+ \ 'text': 'property `bar`: Property not found in props of React element `Foo` See also: React element `Foo`',
+ \ }
+ \]
+
+ AssertEqual g:expected, g:actual
+
+Execute(The flow handler should handle extra errors):
+ silent! noautocmd file /Users/rav/Projects/vim-ale-flow/index.js
+
+ let g:flow_output = {
+ \ "flowVersion": "0.54.0",
+ \ "errors": [{
+ \ "extra": [{
+ \ "message": [{
+ \ "context": v:null,
+ \ "descr": "Property \`setVector\` is incompatible:",
+ \ "type": "Blame ",
+ \ "path": "",
+ \ "line": 0,
+ \ "endline": 0,
+ \ "start": 1,
+ \ "end": 0
+ \ }],
+ \ "children": [{
+ \ "message": [{
+ \ "context": "setVector = \{2\}",
+ \ "descr": "number ",
+ \ "type": "Blame ",
+ \ "loc": {
+ \ "source": expand('%:p'),
+ \ "type": "SourceFile ",
+ \ "start": {
+ \ "line": 90,
+ \ "column": 30,
+ \ "offset": 2296
+ \ },
+ \ "end": {
+ \ "line": 90,
+ \ "column": 30,
+ \ "offset": 2297
+ \ }
+ \ },
+ \ "path": expand('%:p'),
+ \ "line": 90,
+ \ "endline": 90,
+ \ "start": 30,
+ \ "end": 30
+ \ }, {
+ \ "context": v:null,
+ \ "descr": "This type is incompatible with ",
+ \ "type": "Comment ",
+ \ "path": "",
+ \ "line": 0,
+ \ "endline": 0,
+ \ "start": 1,
+ \ "end": 0
+ \ }, {
+ \ "context": "setVector: VectorType => void,",
+ \ "descr": "function type ",
+ \ "type": "Blame ",
+ \ "loc": {
+ \ "source": expand('%:p'),
+ \ "type": "SourceFile",
+ \ "start": {
+ \ "line": 9,
+ \ "column": 14,
+ \ "offset": 252
+ \ },
+ \ "end": {
+ \ "line": 9,
+ \ "column": 31,
+ \ "offset": 270
+ \ }
+ \ },
+ \ "path": expand('%:p'),
+ \ "line": 9,
+ \ "endline": 9,
+ \ "start": 14,
+ \ "end": 31
+ \ }]
+ \ }]
+ \ }],
+ \ "kind": "infer",
+ \ "level": "error",
+ \ "suppressions": [],
+ \ "message": [{
+ \ "context": " < New ",
+ \ "descr": "props of React element `New`",
+ \ "type": "Blame",
+ \ "loc": {
+ \ "source": "vim-ale-flow/foo.js",
+ \ "type": "SourceFile",
+ \ "start": {
+ \ "line": 89,
+ \ "column": 17,
+ \ "offset": 2262
+ \ },
+ \ "end": {
+ \ "line": 94,
+ \ "column": 18,
+ \ "offset": 2488
+ \ }
+ \ },
+ \ "path": "",
+ \ "line": 89,
+ \ "endline": 94,
+ \ "start": 17,
+ \ "end": 18
+ \ }, {
+ \ "context": v:null,
+ \ "descr": "This type is incompatible with",
+ \ "type": "Comment",
+ \ "path": "",
+ \ "line": 0,
+ \ "endline": 0,
+ \ "start": 1,
+ \ "end": 0
+ \ }, {
+ \ "context": "class New extends React.Component < NewProps,NewState > {",
+ \ "descr": "object type",
+ \ "type": "Blame",
+ \ "loc": {
+ \ "source": expand('%:p'),
+ \ "type": "SourceFile",
+ \ "start": {
+ \ "line": 20,
+ \ "column": 35,
+ \ "offset": 489
+ \ },
+ \ "end": {
+ \ "line": 20,
+ \ "column": 42,
+ \ "offset": 497
+ \ }
+ \ },
+ \ "path": expand('%:p'),
+ \ "line": 20,
+ \ "endline": 20,
+ \ "start": 35,
+ \ "end": 42
+ \ }]
+ \ }],
+ \ "passed": v:false
+ \}
+
+ let g:actual = ale_linters#javascript#flow#Handle(bufnr(''), [json_encode(g:flow_output)])
+ let g:expected = [
+ \ {
+ \ 'lnum': 20,
+ \ 'col': 35,
+ \ 'type': 'E',
+ \ 'text': 'props of React element `New`: This type is incompatible with object type',
+ \ 'detail': 'props of React element `New`: This type is incompatible with object type'
+ \ . "\nProperty `setVector` is incompatible: number This type is incompatible with function type ",
+ \ }
+ \]
+
+ AssertEqual g:expected, g:actual
diff --git a/sources_non_forked/ale/test/handler/test_foodcritic_handler.vader b/sources_non_forked/ale/test/handler/test_foodcritic_handler.vader
new file mode 100644
index 00000000..67cb6cab
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_foodcritic_handler.vader
@@ -0,0 +1,44 @@
+Before:
+ runtime ale_linters/chef/foodcritic.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(Basic warnings should be handled):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'code': 'CINK001',
+ \ 'type': 'W',
+ \ 'text': 'Missing CHANGELOG in markdown format',
+ \ 'filename': '/foo/bar/CHANGELOG.md',
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'code': 'FC011',
+ \ 'type': 'W',
+ \ 'text': 'Missing README in markdown format',
+ \ 'filename': '/foo/bar/README.md',
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'code': 'FC031',
+ \ 'type': 'W',
+ \ 'text': 'Cookbook without metadata.rb file',
+ \ 'filename': '/foo/bar/metadata.rb',
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'code': 'FC071',
+ \ 'type': 'W',
+ \ 'text': 'Missing LICENSE file',
+ \ 'filename': '/foo/bar/LICENSE',
+ \ },
+ \ ],
+ \ ale_linters#chef#foodcritic#Handle(bufnr(''), [
+ \ 'CINK001: Missing CHANGELOG in markdown format: /foo/bar/CHANGELOG.md:1',
+ \ 'FC011: Missing README in markdown format: /foo/bar/README.md:1',
+ \ 'FC031: Cookbook without metadata.rb file: /foo/bar/metadata.rb:1',
+ \ 'FC071: Missing LICENSE file: /foo/bar/LICENSE:1',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_fortran_handler.vader b/sources_non_forked/ale/test/handler/test_fortran_handler.vader
new file mode 100644
index 00000000..c55a4c6f
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_fortran_handler.vader
@@ -0,0 +1,95 @@
+Before:
+ runtime ale_linters/fortran/gcc.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The fortran handler should parse lines from GCC 4.1.2 correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'bufnr': 357,
+ \ 'lnum': 4,
+ \ 'col': 0,
+ \ 'text': "Symbol ‘b’ at (1) has no IMPLICIT type",
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'bufnr': 357,
+ \ 'lnum': 3,
+ \ 'col': 0,
+ \ 'text': "Symbol ‘a’ at (1) has no IMPLICIT type",
+ \ 'type': 'E',
+ \ },
+ \ ],
+ \ ale_linters#fortran#gcc#Handle(357, [
+ \ " In file :4",
+ \ "",
+ \ "write(*,*) b",
+ \ " 1",
+ \ "Error: Symbol ‘b’ at (1) has no IMPLICIT type",
+ \ " In file :3",
+ \ "",
+ \ "write(*,*) a",
+ \ " 1",
+ \ "Error: Symbol ‘a’ at (1) has no IMPLICIT type",
+ \ ])
+
+
+Execute(The fortran handler should parse lines from GCC 4.9.3 correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'bufnr': 357,
+ \ 'lnum': 3,
+ \ 'col': 12,
+ \ 'text': "Symbol ‘a’ at (1) has no IMPLICIT type",
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'bufnr': 357,
+ \ 'lnum': 4,
+ \ 'col': 12,
+ \ 'text': "Symbol ‘b’ at (1) has no IMPLICIT type",
+ \ 'type': 'E',
+ \ },
+ \ ],
+ \ ale_linters#fortran#gcc#Handle(357, [
+ \ ":3.12:",
+ \ "",
+ \ "write(*,*) a",
+ \ " 1",
+ \ "Error: Symbol ‘a’ at (1) has no IMPLICIT type",
+ \ ":4.12:",
+ \ "",
+ \ "write(*,*) b",
+ \ " 1",
+ \ "Error: Symbol ‘b’ at (1) has no IMPLICIT type",
+ \ ])
+
+Execute(The fortran handler should parse lines from GCC 6.3.1 correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'bufnr': 337,
+ \ 'lnum': 3,
+ \ 'col': 12,
+ \ 'text': "Symbol ‘a’ at (1) has no IMPLICIT type",
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'bufnr': 337,
+ \ 'lnum': 4,
+ \ 'col': 12,
+ \ 'text': "Symbol ‘b’ at (1) has no IMPLICIT type",
+ \ 'type': 'E',
+ \ },
+ \ ],
+ \ ale_linters#fortran#gcc#Handle(337, [
+ \ ":3:12:",
+ \ "",
+ \ "Error: Symbol ‘a’ at (1) has no IMPLICIT type",
+ \ ":4:12:",
+ \ "",
+ \ "Error: Symbol ‘b’ at (1) has no IMPLICIT type",
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_gawk_handler.vader b/sources_non_forked/ale/test/handler/test_gawk_handler.vader
new file mode 100644
index 00000000..3a7b5457
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_gawk_handler.vader
@@ -0,0 +1,39 @@
+Before:
+ runtime ale_linters/awk/gawk.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(gawk syntax errors should be parsed correctly):
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 0,
+ \ 'text': "invalid char ''' in expression",
+ \ 'code': 0,
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 5,
+ \ 'col': 0,
+ \ 'text': 'unterminated string',
+ \ 'code': 0,
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 10,
+ \ 'col': 0,
+ \ 'text': "escape sequence `\u' treated as plain `u'",
+ \ 'code': 0,
+ \ 'type': 'W',
+ \ },
+ \ ],
+ \ ale#handlers#gawk#HandleGawkFormat(347, [
+ \ "gawk: something.awk:1: BEGIN { system('touch aaaaaaaaa') }",
+ \ "gawk: something.awk:1: ^ invalid char ''' in expression",
+ \ 'gawk: something.awk:5: { x = "aaaaaaaaaaa',
+ \ 'gawk: something.awk:5: ^ unterminated string',
+ \ "gawk: something.awk:10: warning: escape sequence `\u' treated as plain `u'",
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_gcc_handler.vader b/sources_non_forked/ale/test/handler/test_gcc_handler.vader
new file mode 100644
index 00000000..a4231cab
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_gcc_handler.vader
@@ -0,0 +1,316 @@
+Execute(The GCC handler should ignore other lines of output):
+ AssertEqual
+ \ [],
+ \ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
+ \ 'foo',
+ \ 'bar',
+ \ 'baz',
+ \ ])
+
+Execute(GCC errors from included files should be parsed correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 1,
+ \ 'filename': 'broken.h',
+ \ 'type': 'E',
+ \ 'text': 'expected identifier or ''('' before ''{'' token',
+ \ },
+ \ {
+ \ 'lnum': 3,
+ \ 'col': 2,
+ \ 'text': 'Error found in header. See :ALEDetail',
+ \ 'detail': join([
+ \ 'In file included from :3:2:',
+ \ 'broken.h:1:1: error: expected identifier or ''('' before ''{'' token',
+ \ ' {{{',
+ \ ' ^',
+ \ ], "\n"),
+ \ },
+ \ ],
+ \ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
+ \ 'In file included from :3:2:',
+ \ 'broken.h:1:1: error: expected identifier or ''('' before ''{'' token',
+ \ ' {{{',
+ \ ' ^',
+ \ 'compilation terminated.',
+ \ ])
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 1,
+ \ 'filename': 'b.h',
+ \ 'type': 'E',
+ \ 'text': 'expected identifier or ''('' before ''{'' token',
+ \ },
+ \ {
+ \ 'lnum': 5,
+ \ 'text': 'Error found in header. See :ALEDetail',
+ \ 'detail': join([
+ \ 'In file included from a.h:1:0,',
+ \ ' from :5:',
+ \ 'b.h:1:1: error: expected identifier or ''('' before ''{'' token',
+ \ ' {{{',
+ \ ' ^',
+ \ ], "\n"),
+ \ },
+ \ ],
+ \ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
+ \ 'In file included from a.h:1:0,',
+ \ ' from :5:',
+ \ 'b.h:1:1: error: expected identifier or ''('' before ''{'' token',
+ \ ' {{{',
+ \ ' ^',
+ \ 'compilation terminated.',
+ \ ])
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 1,
+ \ 'filename': 'b.h',
+ \ 'type': 'E',
+ \ 'text': 'unknown type name ''bad_type''',
+ \ },
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 1,
+ \ 'filename': 'b.h',
+ \ 'type': 'E',
+ \ 'text': 'unknown type name ''other_bad_type''',
+ \ },
+ \ {
+ \ 'lnum': 3,
+ \ 'text': 'Error found in header. See :ALEDetail',
+ \ 'detail': join([
+ \ 'In file included from a.h:1:0,',
+ \ ' from :3:',
+ \ 'b.h:1:1: error: unknown type name ‘bad_type’',
+ \ ' bad_type x;',
+ \ ' ^',
+ \ 'b.h:2:1: error: unknown type name ‘other_bad_type’',
+ \ ' other_bad_type y;',
+ \ ' ^',
+ \ ], "\n"),
+ \ },
+ \ ],
+ \ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
+ \ 'In file included from a.h:1:0,',
+ \ ' from :3:',
+ \ 'b.h:1:1: error: unknown type name ‘bad_type’',
+ \ ' bad_type x;',
+ \ ' ^',
+ \ 'b.h:2:1: error: unknown type name ‘other_bad_type’',
+ \ ' other_bad_type y;',
+ \ ' ^',
+ \ 'compilation terminated.',
+ \ ])
+
+Execute(The GCC handler shouldn't complain about #pragma once for headers):
+ silent file! test.h
+
+ AssertEqual
+ \ [],
+ \ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
+ \ ':1:1: warning: #pragma once in main file [enabled by default]',
+ \ ])
+
+ silent file! test.hpp
+
+ AssertEqual
+ \ [],
+ \ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
+ \ ':1:1: warning: #pragma once in main file [enabled by default]',
+ \ ])
+
+Execute(The GCC handler should handle syntax errors):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 12,
+ \ 'type': 'E',
+ \ 'text': 'invalid suffix "p" on integer constant'
+ \ },
+ \ {
+ \ 'lnum': 17,
+ \ 'col': 5,
+ \ 'type': 'E',
+ \ 'text': 'invalid suffix "n" on integer constant'
+ \ },
+ \ {
+ \ 'lnum': 4,
+ \ 'type': 'E',
+ \ 'text': 'variable or field ''foo'' declared void'
+ \ },
+ \ {
+ \ 'lnum': 4,
+ \ 'type': 'E',
+ \ 'text': '''cat'' was not declared in this scope'
+ \ },
+ \ {
+ \ 'lnum': 12,
+ \ 'type': 'E',
+ \ 'text': 'expected '';'' before ''o'''
+ \ },
+ \ ],
+ \ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
+ \ ':6:12: error: invalid suffix "p" on integer constant',
+ \ ':17:5: error: invalid suffix "n" on integer constant',
+ \ ':4: error: variable or field ''foo'' declared void',
+ \ ':4: error: ''cat'' was not declared in this scope',
+ \ ':12: error: expected `;'' before ''o''',
+ \ ])
+
+Execute(The GCC handler should handle notes with no previous message):
+ AssertEqual
+ \ [],
+ \ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
+ \ ':1:1: note: x',
+ \ ':1:1: note: x',
+ \ ])
+
+Execute(The GCC handler should attach notes to previous messages):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 12,
+ \ 'type': 'E',
+ \ 'text': 'Some error',
+ \ 'detail': "Some error\n:1:1: note: x",
+ \ },
+ \ ],
+ \ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
+ \ '-:6:12: error: Some error',
+ \ ':1:1: note: x',
+ \ ])
+
+Execute(The GCC handler should interpret - as being the current file):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 12,
+ \ 'type': 'E',
+ \ 'text': 'Some error',
+ \ },
+ \ ],
+ \ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
+ \ '-:6:12: error: Some error',
+ \ ])
+
+Execute(The GCC handler should handle fatal error messages due to missing files):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 3,
+ \ 'col': 12,
+ \ 'type': 'E',
+ \ 'text': 'foo.h: No such file or directory'
+ \ },
+ \ ],
+ \ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
+ \ ':3:12: fatal error: foo.h: No such file or directory',
+ \ ])
+
+Execute(The GCC handler should handle errors for inlined header functions):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 50,
+ \ 'col': 4,
+ \ 'filename': '/usr/include/bits/fcntl2.h',
+ \ 'type': 'E',
+ \ 'text': 'call to ''__open_missing_mode'' declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments',
+ \ },
+ \ {
+ \ 'lnum': 44,
+ \ 'col': 5,
+ \ 'filename': '/usr/include/bits/fcntl2.h',
+ \ 'type': 'E',
+ \ 'text': 'call to ''__open_too_many_args'' declared with attribute error: open can be called either with 2 or 3 arguments, not more',
+ \ },
+ \ {
+ \ 'lnum': 7,
+ \ 'col': 10,
+ \ 'type': 'E',
+ \ 'text': 'call to ''__open_missing_mode'' declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments',
+ \ },
+ \ {
+ \ 'lnum': 13,
+ \ 'col': 11,
+ \ 'type': 'E',
+ \ 'text': 'call to ''__open_too_many_args'' declared with attribute error: open can be called either with 2 or 3 arguments, not more',
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'text': 'Error found in header. See :ALEDetail',
+ \ 'detail': join([
+ \ 'In file included from /usr/include/fcntl.h:328,',
+ \ ' from :1:',
+ \ 'In function ‘open’,',
+ \ ' inlined from ‘main’ at :7:10:',
+ \ '/usr/include/bits/fcntl2.h:50:4: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments',
+ \ ' __open_missing_mode ();',
+ \ ' ^~~~~~~~~~~~~~~~~~~~~~',
+ \ 'In function ‘open’,',
+ \ ' inlined from ‘main’ at :13:11:',
+ \ '/usr/include/bits/fcntl2.h:44:5: error: call to ‘__open_too_many_args’ declared with attribute error: open can be called either with 2 or 3 arguments, not more',
+ \ ' __open_too_many_args ();',
+ \ ], "\n")
+ \ },
+ \],
+ \ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
+ \ 'In file included from /usr/include/fcntl.h:328,',
+ \ ' from :1:',
+ \ 'In function ‘open’,',
+ \ ' inlined from ‘main’ at :7:10:',
+ \ '/usr/include/bits/fcntl2.h:50:4: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments',
+ \ ' __open_missing_mode ();',
+ \ ' ^~~~~~~~~~~~~~~~~~~~~~',
+ \ 'In function ‘open’,',
+ \ ' inlined from ‘main’ at :13:11:',
+ \ '/usr/include/bits/fcntl2.h:44:5: error: call to ‘__open_too_many_args’ declared with attribute error: open can be called either with 2 or 3 arguments, not more',
+ \ ' __open_too_many_args ();',
+ \ ' ^~~~~~~~~~~~~~~~~~~~~~~',
+ \ ])
+
+Execute(The GCC handler should handle macro expansion errors in current file):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 19,
+ \ 'type': 'E',
+ \ 'text': 'error message',
+ \ 'detail': "error message\n:1:19: note: in expansion of macro 'TEST'",
+ \ },
+ \ ],
+ \ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
+ \ ': error: error message',
+ \ ':1:19: note: in expansion of macro ‘TEST’',
+ \ ' 1 | std::string str = TEST;',
+ \ ' | ^~~~',
+ \ ])
+
+Execute(The GCC handler should handle macro expansion errors in other files):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 0,
+ \ 'type': 'E',
+ \ 'text': 'Error found in macro expansion. See :ALEDetail',
+ \ 'detail': "error message\ninc.h:1:19: note: in expansion of macro 'TEST'",
+ \ },
+ \ ],
+ \ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [
+ \ ': error: error message',
+ \ 'inc.h:1:19: note: in expansion of macro ‘TEST’',
+ \ ' 1 | std::string str = TEST;',
+ \ ' | ^~~~',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_ghc_handler.vader b/sources_non_forked/ale/test/handler/test_ghc_handler.vader
new file mode 100644
index 00000000..70246ed1
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_ghc_handler.vader
@@ -0,0 +1,177 @@
+Execute(The ghc handler should handle hdevtools output):
+ call ale#test#SetFilename('foo.hs')
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 147,
+ \ 'type': 'W',
+ \ 'col': 62,
+ \ 'text': '• Couldnt match type ‘a -> T.Text’ with ‘T.Text’ Expected type: [T.Text]',
+ \ 'detail': join([
+ \ '• Couldnt match type ‘a -> T.Text’ with ‘T.Text’',
+ \ ' Expected type: [T.Text]',
+ \ ], "\n"),
+ \ },
+ \ ],
+ \ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [
+ \ 'foo.hs:147:62: warning:',
+ \ '• Couldnt match type ‘a -> T.Text’ with ‘T.Text’',
+ \ ' Expected type: [T.Text]',
+ \ ])
+
+Execute(The ghc handler should handle ghc 8 output):
+ call ale#test#SetFilename('src/Appoint/Lib.hs')
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 6,
+ \ 'type': 'E',
+ \ 'col': 1,
+ \ 'text': 'Failed to load interface for ‘GitHub.Data’ Use -v to see a list of the files searched for.',
+ \ 'detail': join([
+ \ ' Failed to load interface for ‘GitHub.Data’',
+ \ ' Use -v to see a list of the files searched for.',
+ \ ], "\n"),
+ \ },
+ \ {
+ \ 'lnum': 7,
+ \ 'type': 'W',
+ \ 'col': 1,
+ \ 'text': 'Failed to load interface for ‘GitHub.Endpoints.PullRequests’ Use -v to see a list of the files searched for.',
+ \ 'detail': join([
+ \ ' Failed to load interface for ‘GitHub.Endpoints.PullRequests’',
+ \ ' Use -v to see a list of the files searched for.',
+ \ ], "\n"),
+ \ },
+ \ ],
+ \ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [
+ \ '',
+ \ ale#path#Simplify('src/Appoint/Lib.hs') . ':6:1: error:',
+ \ ' Failed to load interface for ‘GitHub.Data’',
+ \ ' Use -v to see a list of the files searched for.',
+ \ '',
+ \ ale#path#Simplify('src/Appoint/Lib.hs') . ':7:1: warning:',
+ \ ' Failed to load interface for ‘GitHub.Endpoints.PullRequests’',
+ \ ' Use -v to see a list of the files searched for.',
+ \ ])
+
+Execute(The ghc handler should handle ghc 7 output):
+ call ale#test#SetFilename('src/Main.hs')
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 168,
+ \ 'type': 'E',
+ \ 'col': 1,
+ \ 'text': 'parse error (possibly incorrect indentation or mismatched brackets)',
+ \ 'detail': join([
+ \ ' parse error (possibly incorrect indentation or mismatched brackets)',
+ \ ], "\n"),
+ \ },
+ \ {
+ \ 'lnum': 84,
+ \ 'col': 1,
+ \ 'type': 'W',
+ \ 'text': 'Top-level binding with no type signature: myLayout :: Choose Tall (Choose (Mirror Tall) Full) a',
+ \ 'detail': join([
+ \ ' Top-level binding with no type signature:',
+ \ ' myLayout :: Choose Tall (Choose (Mirror Tall) Full) a',
+ \ ], "\n"),
+ \ },
+ \ {
+ \ 'lnum': 94,
+ \ 'col': 5,
+ \ 'type': 'E',
+ \ 'text': 'Some other error',
+ \ 'detail': join([
+ \ ' Some other error',
+ \ ], "\n"),
+ \ },
+ \ ],
+ \ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [
+ \ ale#path#Simplify('src/Main.hs') . ':168:1:',
+ \ ' parse error (possibly incorrect indentation or mismatched brackets)',
+ \ ale#path#Simplify('src/Main.hs') . ':84:1:Warning:',
+ \ ' Top-level binding with no type signature:',
+ \ ' myLayout :: Choose Tall (Choose (Mirror Tall) Full) a',
+ \ ale#path#Simplify('src/Main.hs') . ':94:5:Error:',
+ \ ' Some other error',
+ \ ])
+
+Execute(The ghc handler should handle stack 1.5.1 output):
+ call ale#test#SetFilename('src/Main.hs')
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 160,
+ \ 'col': 14,
+ \ 'type': 'E',
+ \ 'text': '• Expecting one fewer arguments to ‘Exp’ Expected kind ‘k0 -> *’, but ‘Exp’ has kind ‘*’ • In the type ‘Exp a’ | 160 | pattern F :: Exp a | ^^^^^',
+ \ 'detail': join([
+ \ ' • Expecting one fewer arguments to ‘Exp’',
+ \ ' Expected kind ‘k0 -> *’, but ‘Exp’ has kind ‘*’',
+ \ ' • In the type ‘Exp a’',
+ \ ' |',
+ \ ' 160 | pattern F :: Exp a',
+ \ ' | ^^^^^',
+ \ ], "\n"),
+ \ },
+ \ ],
+ \ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [
+ \ ' ' . ale#path#Simplify('src/Main.hs') . ':160:14: error:',
+ \ ' • Expecting one fewer arguments to ‘Exp’',
+ \ ' Expected kind ‘k0 -> *’, but ‘Exp’ has kind ‘*’',
+ \ ' • In the type ‘Exp a’',
+ \ ' |',
+ \ ' 160 | pattern F :: Exp a',
+ \ ' | ^^^^^',
+ \ ])
+
+Execute(The ghc handler should handle ghc panic):
+ let g:detail = [
+ \ '[15 of 15] Compiling SizedTypes.List',
+ \ 'ghc: panic! (the ''impossible'' happened)',
+ \ ' (GHC version 8.10.3:',
+ \ ' src/SizedTypes/List.hs:(46,19)-(50,0) Specified type does not refine Haskell type for `SizedTypes.List.out` (Plugged Init types new)',
+ \ ' The Liquid type',
+ \ ' .',
+ \ ' GHC.Types.Int -> (SizedTypes.List.List a) -> (_, (SizedTypes.List.List a))',
+ \ ' .',
+ \ ' is inconsistent with the Haskell type',
+ \ ' .',
+ \ ' forall p a ->',
+ \ 'p -> SizedTypes.List.List a -> (a, SizedTypes.List.List a)',
+ \ ' .',
+ \ ' defined at src/SizedTypes/List.hs:52:1-3',
+ \ ' .',
+ \ ' Specifically, the Liquid component',
+ \ ' .',
+ \ ' {VV##0 : GHC.Types.Int | VV##0 >= 0}',
+ \ ' .',
+ \ ' is inconsistent with the Haskell component',
+ \ ' .',
+ \ ' p',
+ \ ' .',
+ \ ' ',
+ \ ' HINT: Use the hole ''_'' instead of the mismatched component (in the Liquid specification)',
+ \ '',
+ \ 'Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug',
+ \ '',
+ \ ''
+ \ ]
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 1,
+ \ 'type': 'E',
+ \ 'text': 'ghc panic!',
+ \ 'detail': join(g:detail[1:-3], "\n"),
+ \ },
+ \ ],
+ \ ale#handlers#haskell#HandleGHCFormat(bufnr(''), g:detail)
+ unlet g:detail
diff --git a/sources_non_forked/ale/test/handler/test_ghc_mod_handler.vader b/sources_non_forked/ale/test/handler/test_ghc_mod_handler.vader
new file mode 100644
index 00000000..bed5b13c
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_ghc_mod_handler.vader
@@ -0,0 +1,37 @@
+Execute(HandleGhcFormat should handle ghc-mod problems):
+ call ale#test#SetFilename('check2.hs')
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 1,
+ \ 'type': 'E',
+ \ 'text': 'Failed to load interface for ‘Missing’Use -v to see a list of the files searched for.',
+ \ },
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 1,
+ \ 'type': 'E',
+ \ 'text': 'Suggestion: Use camelCaseFound: my_variable = ...Why not: myVariable = ...',
+ \ },
+ \ {
+ \ 'lnum': 6,
+ \ 'col': 1,
+ \ 'type': 'W',
+ \ 'text': 'Eta reduceFound: myFunc x = succ xWhy not: myFunc = succ',
+ \ },
+ \ {
+ \ 'lnum': 28,
+ \ 'col': 28,
+ \ 'type': 'W',
+ \ 'text': 'Defaulting the following constraints to type ‘Integer’ (Num a0) arising from the literal ‘3’ at check2.hs:28:28 (Eq a0) arising from a use of ‘lookup’ at check2.hs:28:21-28 • In the first argument of ‘lookup’, namely ‘3’ In the expression: lookup 3 In the second argument of ‘fmap’, namely ‘(lookup 3 $ zip [1, 2, 3] [4, 5, 6])''’'
+ \ },
+ \ ],
+ \ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [
+ \ 'check2.hs:2:1:Failed to load interface for ‘Missing’Use -v to see a list of the files searched for.',
+ \ 'check2.hs:2:1: Suggestion: Use camelCaseFound: my_variable = ...Why not: myVariable = ...',
+ \ 'check2.hs:6:1: Warning: Eta reduceFound: myFunc x = succ xWhy not: myFunc = succ',
+ \ 'xxx.hs:6:1: Warning: Eta reduceFound: myFunc x = succ xWhy not: myFunc = succ',
+ \ printf("check2.hs:28:28: Warning: Defaulting the following constraints to type ‘Integer’ (Num a0) arising from the literal ‘3’ at %s/check2.hs:28:28 (Eq a0) arising from a use of ‘lookup’ at %s/check2.hs:28:21-28 • In the first argument of ‘lookup’, namely ‘3’ In the expression: lookup 3 In the second argument of ‘fmap’, namely ‘(lookup 3 $ zip [1, 2, 3] [4, 5, 6])'’", tempname(), tempname()),
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_ghdl_handler.vader b/sources_non_forked/ale/test/handler/test_ghdl_handler.vader
new file mode 100644
index 00000000..a0f5edac
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_ghdl_handler.vader
@@ -0,0 +1,26 @@
+Before:
+ runtime ale_linters/vhdl/ghdl.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The ghdl handler should parse lines correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 41,
+ \ 'col' : 5,
+ \ 'type': 'E',
+ \ 'text': "error: 'begin' is expected instead of 'if'"
+ \ },
+ \ {
+ \ 'lnum': 12,
+ \ 'col' : 8,
+ \ 'type': 'E',
+ \ 'text': ' no declaration for "i0"'
+ \ },
+ \ ],
+ \ ale_linters#vhdl#ghdl#Handle(bufnr(''), [
+ \ "dff_en.vhd:41:5:error: 'begin' is expected instead of 'if'",
+ \ '/path/to/file.vhdl:12:8: no declaration for "i0"',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_gitlint_handler.vader b/sources_non_forked/ale/test/handler/test_gitlint_handler.vader
new file mode 100644
index 00000000..5c531664
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_gitlint_handler.vader
@@ -0,0 +1,89 @@
+Before:
+ Save g:ale_warn_about_trailing_whitespace
+
+ let g:ale_warn_about_trailing_whitespace = 1
+
+ runtime ale_linters/gitcommit/gitlint.vim
+
+After:
+ Restore
+
+ unlet! b:ale_warn_about_trailing_whitespace
+
+ call ale#linter#Reset()
+
+Execute(The gitlint handler should handle basic warnings and syntax errors):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'type': 'E',
+ \ 'text': 'Body message is missing',
+ \ 'code': 'B6',
+ \ },
+ \ {
+ \ 'lnum': 2,
+ \ 'type': 'E',
+ \ 'text': 'Second line is not empty: "to send to upstream"',
+ \ 'code': 'B4',
+ \ },
+ \ {
+ \ 'lnum': 3,
+ \ 'type': 'E',
+ \ 'text': 'Body message is too short (19<20): "to send to upstream"',
+ \ 'code': 'B5',
+ \ },
+ \ {
+ \ 'lnum': 8,
+ \ 'type': 'E',
+ \ 'text': 'Title exceeds max length (92>72): "some very long commit subject line where the author can''t wait to explain what he just fixed"',
+ \ 'code': 'T1',
+ \ },
+ \ ],
+ \ ale_linters#gitcommit#gitlint#Handle(1, [
+ \ '1: B6 Body message is missing',
+ \ '2: B4 Second line is not empty: "to send to upstream"',
+ \ '3: B5 Body message is too short (19<20): "to send to upstream"',
+ \ '8: T1 Title exceeds max length (92>72): "some very long commit subject line where the author can''t wait to explain what he just fixed"'
+ \ ])
+
+Execute(Disabling trailing whitespace warnings should work):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 8,
+ \ 'type': 'E',
+ \ 'text': 'Trailing whitespace',
+ \ 'code': 'T2',
+ \ },
+ \ ],
+ \ ale_linters#gitcommit#gitlint#Handle(bufnr(''), [
+ \ '8: T2 Trailing whitespace',
+ \])
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 8,
+ \ 'type': 'E',
+ \ 'text': 'Trailing whitespace',
+ \ 'code': 'B2',
+ \ },
+ \ ],
+ \ ale_linters#gitcommit#gitlint#Handle(bufnr(''), [
+ \ '8: B2 Trailing whitespace',
+ \])
+
+ let b:ale_warn_about_trailing_whitespace = 0
+
+ AssertEqual
+ \ [],
+ \ ale_linters#gitcommit#gitlint#Handle(bufnr(''), [
+ \ '8: T2 Trailing whitespace',
+ \ ])
+
+ AssertEqual
+ \ [],
+ \ ale_linters#gitcommit#gitlint#Handle(bufnr(''), [
+ \ '8: B2 Trailing whitespace',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_glslang_handler.vader b/sources_non_forked/ale/test/handler/test_glslang_handler.vader
new file mode 100644
index 00000000..6d3a7999
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_glslang_handler.vader
@@ -0,0 +1,24 @@
+Before:
+ runtime ale_linters/glsl/glslang.vim
+
+Execute(The glsl glslang handler should parse lines correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 4,
+ \ 'col': 0,
+ \ 'type': 'E',
+ \ 'text': '''gl_ModelViewProjectionMatrix'' : undeclared identifier',
+ \ },
+ \ {
+ \ 'lnum': 121,
+ \ 'col': 0,
+ \ 'type': 'W',
+ \ 'text': '''switch'' : last case/default label not followed by statements',
+ \ },
+ \ ],
+ \ ale_linters#glsl#glslang#Handle(bufnr(''), [
+ \ 'ERROR: 0:4: ''gl_ModelViewProjectionMatrix'' : undeclared identifier',
+ \ 'WARNING: 0:121: ''switch'' : last case/default label not followed by statements',
+ \ 'ERROR: 2 compilation errors. No code generated.',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_go_generic_handler.vader b/sources_non_forked/ale/test/handler/test_go_generic_handler.vader
new file mode 100644
index 00000000..2b17fdcb
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_go_generic_handler.vader
@@ -0,0 +1,38 @@
+Execute(The golang handler should return the correct filenames):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 27,
+ \ 'col': 0,
+ \ 'text': 'some error',
+ \ 'type': 'E',
+ \ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
+ \ },
+ \ {
+ \ 'lnum': 27,
+ \ 'col': 5,
+ \ 'text': 'some error with a column',
+ \ 'type': 'E',
+ \ 'filename': ale#path#Simplify(expand('%:p:h') . '/other.go'),
+ \ },
+ \ {
+ \ 'lnum': 18,
+ \ 'col': 0,
+ \ 'text': 'random error',
+ \ 'type': 'E',
+ \ 'filename': ale#path#Simplify(expand('%:p:h') . '/go1.14.go'),
+ \ },
+ \ {
+ \ 'lnum': 36,
+ \ 'col': 2,
+ \ 'text': 'another random error',
+ \ 'type': 'E',
+ \ 'filename': ale#path#Simplify(expand('%:p:h') . '/anothergo1.14.go'),
+ \ },
+ \ ],
+ \ ale#handlers#go#Handler(bufnr(''), [
+ \ 'test.go:27: some error',
+ \ 'other.go:27:5: some error with a column',
+ \ 'vet: go1.14.go:18:0: random error',
+ \ 'vet: anothergo1.14.go:36:2: another random error',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_gobuild_handler.vader b/sources_non_forked/ale/test/handler/test_gobuild_handler.vader
new file mode 100644
index 00000000..17608c3a
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_gobuild_handler.vader
@@ -0,0 +1,45 @@
+Before:
+ runtime ale_linters/go/gobuild.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute (The gobuild handler should handle names with spaces):
+ " We can't test Windows paths with the path resovling on Linux, but we can
+ " test the regex.
+ AssertEqual
+ \ [
+ \ [
+ \ 'C:\something\file with spaces.go',
+ \ '27',
+ \ '',
+ \ 'missing argument for Printf("%s"): format reads arg 2, have only 1 args',
+ \ ],
+ \ [
+ \ 'C:\something\file with spaces.go',
+ \ '5',
+ \ '2',
+ \ 'expected declaration, found ''STRING'' "log"',
+ \ ],
+ \ ],
+ \ map(ale_linters#go#gobuild#GetMatches([
+ \ 'C:\something\file with spaces.go:27: missing argument for Printf("%s"): format reads arg 2, have only 1 args',
+ \ 'C:\something\file with spaces.go:5:2: expected declaration, found ''STRING'' "log"',
+ \ ]), 'v:val[1:4]')
+
+Execute (The gobuild handler should handle relative paths correctly):
+ call ale#test#SetFilename('app/test.go')
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 27,
+ \ 'col': 0,
+ \ 'text': 'missing argument for Printf("%s"): format reads arg 2, have only 1 args',
+ \ 'type': 'E',
+ \ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
+ \ },
+ \ ],
+ \ ale_linters#go#gobuild#Handler(bufnr(''), [
+ \ 'test.go:27: missing argument for Printf("%s"): format reads arg 2, have only 1 args',
+ \ ])
diff --git a/sources_non_forked/ale/test/handler/test_golangci_lint_handler.vader b/sources_non_forked/ale/test/handler/test_golangci_lint_handler.vader
new file mode 100644
index 00000000..58815f56
--- /dev/null
+++ b/sources_non_forked/ale/test/handler/test_golangci_lint_handler.vader
@@ -0,0 +1,84 @@
+Before:
+ runtime ale_linters/go/golangci_lint.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute (The golangci-lint handler should handle names with spaces):
+ " We can't test Windows paths with the path resovling on Linux, but we can
+ " test the regex.
+ AssertEqual
+ \ [
+ \ [
+ \ 'C:\something\file with spaces.go',
+ \ '12',
+ \ '3',
+ \ 'expected ''package'', found ''IDENT'' gibberish',
+ \ 'staticcheck',
+ \ ],
+ \ [
+ \ 'C:\something\file with spaces.go',
+ \ '37',
+ \ '5',
+ \ 'expected ''package'', found ''IDENT'' gibberish',
+ \ 'golint',
+ \ ],
+ \ ],
+ \ map(ale_linters#go#golangci_lint#GetMatches([
+ \ 'C:\something\file with spaces.go:12:3: expected ''package'', found ''IDENT'' gibberish (staticcheck)',
+ \ 'C:\something\file with spaces.go:37:5: expected ''package'', found ''IDENT'' gibberish (golint)',
+ \ ]), 'v:val[1:5]')
+
+Execute (The golangci-lint handler should handle paths correctly):
+ call ale#test#SetFilename('app/test.go')
+
+ let file = ale#path#GetAbsPath(expand('%:p:h'), 'test.go')
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 12,
+ \ 'col': 3,
+ \ 'text': 'expected ''package'', found ''IDENT'' gibberish (staticcheck)',
+ \ 'type': 'W',
+ \ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
+ \ },
+ \ {
+ \ 'lnum': 37,
+ \ 'col': 5,
+ \ 'text': 'expected ''package'', found ''IDENT'' gibberish (golint)',
+ \ 'type': 'W',
+ \ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
+ \ },
+ \ ],
+ \ ale_linters#go#golangci_lint#Handler(bufnr(''), [
+ \ file . ':12:3: expected ''package'', found ''IDENT'' gibberish (staticcheck)',
+ \ file . ':37:5: expected ''package'', found ''IDENT'' gibberish (golint)',
+ \ ])
+
+Execute (The golangci-lint handler should handle only typecheck lines as errors):
+ call ale#test#SetFilename('app/main.go')
+
+ let file = ale#path#GetAbsPath(expand('%:p:h'), 'test.go')
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 30,
+ \ 'col': 5,
+ \ 'text': 'variable ''err'' is not used (typecheck)',
+ \ 'type': 'E',
+ \ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
+ \ },
+ \ {
+ \ 'lnum': 505,
+ \ 'col': 75,
+ \ 'text': 'Magic number: 404, in detected (gomnd)',
+ \ 'type': 'W',
+ \ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
+ \ }
+ \ ],
+ \ ale_linters#go#golangci_lint#Handler(bufnr(''), [
+ \ file . ':30:5: variable ''err'' is not used (typecheck)',
+ \ file . ':505:75: Magic number: 404, in