From 7d90ff56d96d601478f00895e009ae63a7d8b4bb Mon Sep 17 00:00:00 2001 From: w0rp Date: Tue, 8 Sep 2020 21:40:10 +0100 Subject: Close #3333 - Add an ALECompletePost event Add an `ALECompletePost` event along with everything needed to make it useful for its primary purpose: fixing code after inserting completions. * `ALEFix` can now be called with a bang (`!`) to suppress errors. * A new `ALELintStop` command lets you stop linting, and start it later. --- test/fix/test_ale_fix.vader | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test/fix') diff --git a/test/fix/test_ale_fix.vader b/test/fix/test_ale_fix.vader index a51a5a53..128e3a14 100644 --- a/test/fix/test_ale_fix.vader +++ b/test/fix/test_ale_fix.vader @@ -196,6 +196,10 @@ After: " 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 @@ -206,6 +210,13 @@ Execute(ALEFix should complain when there are no functions to call): 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 @@ -715,6 +726,19 @@ Execute(ale#fix#InitBufferData() should set up the correct data): \ '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 -- cgit v1.2.3