cryeo / yapf-jetbrains

YAPF plugin for Jetbrains IDEs.
MIT License
11 stars 2 forks source link

How about add file filter to only reformat `*.py` files. #2

Closed v1c77 closed 6 years ago

v1c77 commented 6 years ago

I tested either with the config reformat on save or use the shortcut to reformat current file. It can not recognize out a python file and always sys out a error log to pycharm event log about:

16:13   YAPF
            File is unformattable

Or is there any other way like add some config to .style.yapf ? Thank you. : )

cryeo commented 6 years ago

Hello,

File is unformattable occurs in following situations:

There are two ways to reformat code via this plugin:

The latter has a limitation that target file should belong to current project.

I tried to regenerate situation in PyCharm CE 2018.2 but I could not. Could you tell me information in detail? :)

v1c77 commented 6 years ago

sorry for my incoherent words. I just mean that this plugin always try to reformat all the files in my project but I only want it focus on those python files.

On my opinion, maybe you can change the log File is unformattable from level error to warn or just info, please just not raise the notice window.

Or, you can change the strategy that only in python file the plugin will be activated.

cryeo commented 6 years ago

Thanks, I'll modify it on next version :)

cryeo commented 6 years ago

Fixed on v0.2