Skip to content
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

Ability to have diffrent isort configurations for diffrent file extension #1162

Closed
ShaharNaveh opened this issue Mar 7, 2020 · 3 comments
Closed
Labels
enhancement New feature or request
Milestone

Comments

@ShaharNaveh
Copy link

With isort 5.0.0 it's now possible to format pyx in addition to the traditional .py files.
my sorting order in .py files is different than my sorting order in .pyx files.
Is there an option to have different configuration for different file extensions?

@timothycrosley timothycrosley added the enhancement New feature or request label Jul 4, 2020
@timothycrosley
Copy link
Member

Currently, no, but i think this would be a great feature for isort to add

@timothycrosley timothycrosley added this to the 5.3.0 milestone Jul 31, 2020
@timothycrosley
Copy link
Member

This is implemented in develop and will find it's way out in the 5.3.0 release:

isort now has in both the config and CLI arguments, support for setting blocked_extensions and supported_extensions. This allows creating two config files, one that specifies sorting pyx files and another that specifies sorting pyfiles. Then isort would need to be executed per a config defined:

isort --settings-path .isort.cfg .
isort --settings-path .cython.isort.cfg .

Thanks!

~Timothy

@timothycrosley
Copy link
Member

This has now been released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants