Ale: Passing arguments to ale fixer

Created on 16 Jun 2017  路  4Comments  路  Source: dense-analysis/ale

I use autopep8 as fixer for ale_fix option. It works when called without any arguments but I don't know how to add arguments for the fixer.
let g:ale_fixers = { 'python': ['autopep8']}
But when used as let g:ale_fixers = { \'python': ['autopep8 --aggressive']} It gives the following error:
Error detected while processing function ale#fix#Fix[11]..<SNR>161_GetCallbacks[31]..ale#util#GetFunction: line 2: E475: Invalid argument: autopep8 --aggressive

Is this a bug or am I doing it wrongly? Please help.

Most helpful comment

You should be able to set the following now.

let g:ale_fixers = {'python': ['autopep8']}
let g:ale_python_autopep8_options = '--aggressive'

All 4 comments

Yeah, 'autopep' is the name of the fixer to run, not the command. I just added g:ale_python_autopep8_options now so you can set more options.

You should be able to set the following now.

let g:ale_fixers = {'python': ['autopep8']}
let g:ale_python_autopep8_options = '--aggressive'

Thanks

Worps setting

let g:ale_python_autopep8_options = '--aggressive'

Also enforces that comments that are too long, (eg. 120 characters comments) will be automatically wrapped to the next line by autopep8. That is fucking nice.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

glepnir picture glepnir  路  3Comments

catbaron0 picture catbaron0  路  3Comments

alexlafroscia picture alexlafroscia  路  4Comments

trevordmiller picture trevordmiller  路  3Comments

chauncey-garrett picture chauncey-garrett  路  3Comments