-
Notifications
You must be signed in to change notification settings - Fork 11
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
py-yapf does not use local style settings #12
Comments
I'm looking at the same issue. My .style.yapf in my home directory is not recognized |
you can edit py-yapf-options and add "--style .style.yapf" I think. Is this enough? |
that doesn't work, because the formatting is happening in /tmp folder, and the file is not available without adding it as "--style ~/.style.yapf". Even if we add it like that, the next version install is going to wipe the custom settings. Having it as a option that can be set inside emacs init.el will solve the problem of version upgrades. Or failing that do the yapf formatting inside the same folder as the file for that buffer (of course having a temp name that doesn't conflict with another file in the same folder) |
Your custom settings will not be changed by the plugin. py-yapf-options is already the option you're asking for. |
Now I get what you meant, I was thinking of editing the extension file itself, when you mentioned editing. I've added this to my emacs init file: But once I set it back to nil |
Tried multiple ways to customize, everytime after setting this option it fails saying "Buffer is already yapfed" I tried following
But once I reset it to nil, everything works as usual |
You need to use (quote ("--style" "~/.style.yapf")) instead of straight "--style ~/.style.yapf" |
I added quote to all of it, notice the single quote before the style list. (I added the quote to add-to-list after your comment, but it was there in my code though). |
Yapf will use the file ~/.config/yapf/style by default @roopeshvaddepally. Using that file will work with py-yapf. If anyone wants to pick up project settings, you can try https://github.com/JorisE/yapfify.el/blob/master/yapfify.el. Unlike py-yapf, it operates on the original file, so that YAPF will use the settings applicable to that file. |
I think #13 is a very important update to this project that makes this really useable in any situation. Is this project still maintained? |
yapf will normally look in directories upwards to see if it can find information in the
[yapf]
section in setup.cfg or the[yapf]
section in .yapf.style. Because py-yapf operates on a file in/tmp
, this settings are not respected.It would be convenient if py-yapf would operate as if it were changing the file that a buffer represents.
The text was updated successfully, but these errors were encountered: