gforcada/flake8-isort

Location of .isort.cfg

Closed this issue · 8 comments

do3cc commented

I am not sure where or how to fix it, but I found out that .isort.cfg is not looked for recursively.
It gets looked up in cwd and in the home directory.
Right now I need to put an .isort.cfg in my project directory, because there I start vim and it looks at cwd. Then I need to symlink the .isort.cfg to src/package_name, because this is the cwd when this plugin gets called

This is the code to look for an .isort.cfg file: https://github.com/gforcada/flake8-isort/blob/master/flake8_isort.py#L41-L56 It's supposed to look at the entire parents tree until it finds it.

Maybe it's not getting a proper file path location? Could you debug that?

do3cc commented

I did try to debug but stopped as you might guess from my long reply in #163

do3cc commented

Also, this is the Code checking if Isort.cfg exists. Not the Code that reads the cfg file. This Code finds the cfg file in the project dir, then isort itself doesnt find the file. There I stopped debugging

Von meinem iPhone gesendet

Am 18.12.2015 um 09:31 schrieb Gil Forcada Codinachs <notifications@github.commailto:notifications@github.com>:

This is the code to look for an .isort.cfg file: https://github.com/gforcada/flake8-isort/blob/master/flake8_isort.py#L41-L56 It's supposed to look at the entire parents tree until it finds it.

Maybe it's not getting a proper file path location? Could you debug that?

Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-165713575.

________________________________________________________ The contents of this e-mail and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this e-mail is received in error, please immediately notify the sender and delete the e-mail and attached documents. Please note that neither the sender nor the sender's company accept any responsibility for viruses and it is your responsibility to scan or otherwise check this e-mail and any attachments.

do3cc commented

Sorry, my bugreport is pretty incoherent.
Isort does not find my .isort.cfg file, but this plugin does.
It then calls isort and isort ignores the .isort.cfg file.

From my debugging I saw that isort itself looked at cwd and ~ but did not go through a folder hierarchy.
I stopped here, it might be that looking for cfg files is implemented in multiple locations of isort and the plugin calls isort in such a way that it won't look through the directories or the isort plugin, or that it simply is a bug.
So I guess the root issue is how isort is called, because Isort advertises that it looks through up to 25 directories for the config file. But here I really stopped my analysis.

I'm thinking that, at least for Plone, we could add styles to flake8-isort, so that the configuration is already within flake8-isort and no external .isort.cfg file needs to be used.

Downside is if you use isort directly then you will miss the configuration...

@do3cc does the #3 helps in any way on your problem?

do3cc commented

yes, i think this is the best solution

So closing then?