Ale: Feature Request: Lint on save

Created on 4 Oct 2016  路  4Comments  路  Source: dense-analysis/ale

Would it be possible to create a rule to lint on save only? I tried setting let g:ale_lint_on_text_changed = 0 but then no linting occurs; ideally I would like to only lint on each save so that I have a chance to do everything on my own first and then am alerted of anything I missed (when I save) rather than right away; I considered increasing g:ale_lint_delay but I want the lint to be immediate, just only on save, not right while I am in the middle of typing and fixing things I already know wont work.

So, something like this:
image

p.s. thanks for a fantastic plugin! I was glad to make the switch from Syntastic to the Vim 8 async goodness.

enhancement

Most helpful comment

I have now added support for this. You can now set the following in your vimrc file:

let g:ale_lint_on_text_changed = 0
let g:ale_lint_on_enter = 0
let g:ale_lint_on_save = 1

Then linting will only be performed, asynchronously, when a file is saved, if that's how you want to go about it.

All 4 comments

Sure, that can be done. I can add an option which is off by default, and you could turn two off and one on to get that behaviour.

You could probably do it now in vimrc with an autocmd which calls ALELint(0). There's a similar line for BufEnter at the end of the main file.

I'll add a switch for it, as others will probably want the same.

Ok cool. I'll add an autocmd for now. Thanks @w0rp :)

I have now added support for this. You can now set the following in your vimrc file:

let g:ale_lint_on_text_changed = 0
let g:ale_lint_on_enter = 0
let g:ale_lint_on_save = 1

Then linting will only be performed, asynchronously, when a file is saved, if that's how you want to go about it.

Thank you @w0rp!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ianchanning picture ianchanning  路  3Comments

plexigras picture plexigras  路  3Comments

trevordmiller picture trevordmiller  路  3Comments

EdmundsEcho picture EdmundsEcho  路  3Comments

sublee picture sublee  路  3Comments