yapfify icon indicating copy to clipboard operation
yapfify copied to clipboard

Support for setup.cfg as style definition

Open jvanheugten opened this issue 7 years ago • 6 comments

I was wondering if this also works with style definitions that are in [yapf] section in a setup.cfg in the directory or one of the parent directories (see https://github.com/google/yapf)? It didn't seem to work for me. Also would this also work with emacs tramp (ie when opening a file through ssh and the folder or the parents contain a style file in the project)?

jvanheugten avatar Jan 21 '18 19:01 jvanheugten

I'm not sure about setup.cfg

Yapf is running locally even for tramp buffers, so formatting will be done according to the global yapf style. No style search on the remote host will be done.

proofit404 avatar Jan 21 '18 20:01 proofit404

I add tramp support for very similar package isortify.

I want to give this feature some time to stabilize. If it will not cause any troubles, I'll backport it to this package.

proofit404 avatar Feb 01 '18 06:02 proofit404

@proofit404 is there any way to run a yapf formatter that exists within a docker container on a local file?

thatnerdjosh avatar Apr 24 '18 17:04 thatnerdjosh

I add tramp support for very similar package isortify.

I want to give this feature some time to stabilize. If it will not cause any troubles, I'll backport it to this package.

Note: is this still actual? I would love to have yapf using the setup.cfg when using tramp, since it is actually part of my workflow. I can of course do it manually, but still would be great to have the automation here.

Dav1d23 avatar Jul 08 '19 07:07 Dav1d23

I add tramp support for very similar package isortify. I want to give this feature some time to stabilize. If it will not cause any troubles, I'll backport it to this package.

Note: is this still actual? I would love to have yapf using the setup.cfg when using tramp, since it is actually part of my workflow. I can of course do it manually, but still would be great to have the automation here.

@proofit404 I don't think isortify does this currently?

JorisE avatar Jul 08 '19 11:07 JorisE

@JorisE @Dav1d23 Hi guys,

isortify package does a similar feature in this way:

  1. You install isort on the remote host.
  2. You have setup.cfg on the remote host.
  3. You activate the remote virtual environment using pythonic-activate.

It works well for me with vagrant and docker.

But this approach forces us to run isort as a python module using pythonic-call function. And we lose an ability to deal with executables on the local machine until you activate the virtual environment manually.

proofit404 avatar Jul 09 '19 00:07 proofit404