Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running multiple formatters is not working #53

Closed
rudineirk opened this issue Feb 10, 2017 · 1 comment
Closed

Running multiple formatters is not working #53

rudineirk opened this issue Feb 10, 2017 · 1 comment

Comments

@rudineirk
Copy link

rudineirk commented Feb 10, 2017

When I configured multiple formatters for the same file type, only the first was applied

For example, for python formatting I set isort and autopep8 as formatters like this:

autocmd! BufWritePre * Neoformat
let g:neoformat_python_isort = {
            \ 'exe': 'isort',
            \ 'args': ['-'],
            \ 'stdin': 1,
            \ }
let g:neoformat_enabled_python = ['isort', 'autopep8']

Only the changes made by isort are applied to the buffer (or the file, if writing to the file). If I put autopep8 first, only the changes made by autopep8 are applied.

isort should order python imports and autopep8 should fix code style problems. In the example below, both should make changes, isort should put the datetime import first and autopep8 should remove the space after arg in the run function.

from os import path
from datetime import datetime


def run(arg ):
    pass
@sbdchd
Copy link
Owner

sbdchd commented Feb 10, 2017

Currently, Neoformat does not run multiple formatters on a buffer. Instead, it tries formatters until one succeeds.

I suppose an option could be added to use every defined formatter consecutively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants