Ale: Question: disable fixers in a certain project?

Created on 26 Feb 2018  路  3Comments  路  Source: dense-analysis/ale

First, thanks for the fantastic plugin! ALE is amazing and is an important part of my workflow 鉂わ笍
Second, is it possible to disable fixers on a certain project - like by a directory pattern? I see there is the ale_pattern_options for linting, but not fixing. The use case is I have let g:ale_fix_on_save = 1, which I want for projects by default - but I have a few projects that I don't want fixers to run on because the team has other code styles in place (but I still want the linters to run like normal). Is this possible? If not, could it be added?

Most helpful comment

You can use g:ale_pattern_options to set any buffer variable, including ale_fixers. You can set b:ale_fix_on_save to 0, or disable the fixers.

" Disable fixers for any file containing 'foo' in its path.
let g:ale_pattern_options = {'foo': {'ale_fixers': []}

See :help g:ale_pattern_options for more information.

All 3 comments

You can use g:ale_pattern_options to set any buffer variable, including ale_fixers. You can set b:ale_fix_on_save to 0, or disable the fixers.

" Disable fixers for any file containing 'foo' in its path.
let g:ale_pattern_options = {'foo': {'ale_fixers': []}

See :help g:ale_pattern_options for more information.

@w0rp Awesome, thank you!

just wanted to add here that I was following the ale_enabled section of the docs and setting let g:ale_pattern_options = {'\.min.js$': {'ale_enabled': 0}} based on the project name which didn't work.

The solution in this thread worked for me, but I am not sure why

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arthuryangcs picture arthuryangcs  路  4Comments

alexlafroscia picture alexlafroscia  路  4Comments

garand picture garand  路  4Comments

ianchanning picture ianchanning  路  3Comments

Integralist picture Integralist  路  4Comments