Skip to content

How to pass flags to a formatter #105

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

Closed
iammohitsakhuja opened this issue Sep 5, 2018 · 3 comments
Closed

How to pass flags to a formatter #105

iammohitsakhuja opened this issue Sep 5, 2018 · 3 comments

Comments

@iammohitsakhuja
Copy link

I would just like to know how to pass flags to a formatter, particularly I'm asking for Autopep8. I usually format the code with --aggressive option but I can't seem to be able to do that using this. I read the documentation in the vroom/ and doc/ directories but I couldn't find a way on how to do this. I understand if this is a noobie question - which it is, since I am new to Vim and Vimscript. So any help would be appreciated.

@dbarnett
Copy link
Contributor

Can that option be enabled in autopep8's .pycodestyle file?
https://github.com/hhatto/autopep8/blob/master/README.rst#configuration

@nfischer
Copy link

nfischer commented Mar 8, 2019

Just hit this as well. I'd like to use js-beautify -s 2 (2-space indent instead of 4). I wound up using a similar workaround with .jsbeautifyrc.

I agree in principle this is better configured per-project in a config file, although my specific case is to send a one-off fix (I'm not committing the config file since my team doesn't regularly use this tool). Perhaps we could put a warning in the README, explaining multi-arg commands (including CLI switches) aren't supported, and users should consider config files for their formatters?

@dbarnett
Copy link
Contributor

dbarnett commented Mar 9, 2019

I think #66 covers this and we can mark this one a dupe.

We have some more discussion on it there. Local config files are definitely a better option where available.

@dbarnett dbarnett closed this as completed Mar 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants