-
-
Notifications
You must be signed in to change notification settings - Fork 588
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
Create sharable configuration presets for isort #970
Comments
I would love to have something like this! Ideally, it would hook into the new profiles feature, simply adding a new profile when a sharable configuration was installed. @sobolevn are you still interested in working on this? |
I am sorry, but I don't think that I have time for this 😞 This might also be related:
|
This is fixed in develop (see: https://github.com/timothycrosley/isort/tree/develop/example_shared_isort_profile) and will be released in version 5.2.0. Thanks! ~Timothy |
This was just deployed with version 5.2.0 of isort. Thanks! ~Timothy |
Problem
I am writing quite a complex
flake8
plugin with lots of configuration options.Moreover, I also depend on a lot of other plugins as dependencies. Including
flake8-isort
.Here's how my configuration looks like for an end user, contents of
setup.cfg
:I do not want my users to copy-paste these settings for several reasons:
Real world use-cases
Several other linters have this feature. Some of them even consider it as a key feature.
When working for EsLint for example, one can just create a module with a single javascript file and reuse it everywhere.
I propose the same for
flake8
.Each user can create its own set of rules for an organisation / set of projects and reuse it without this amount of copy-paste.
Implementation details
Things to point out:
Configuration priority
Higher takes the priority over lower:
setup.cfg
/.isort.cfg
--sharable-configuration
Creating new sharable configuration
I guess that reusing entry points here is the best option.
Then:
pip install my-isort-config
isort --sharable-configuration=myconfig
Configuration class API
I am not sure about this. But my vision would be something like:
Conclusion
This feature allows to transfer configuration in a reliable and clean way, brings no breaking changes, follows the best practices of other lint tools.
Original issue from
wemake-python-styleguide
: wemake-services/wemake-python-styleguide#164The same feature I proposed for
flake8
: https://gitlab.com/pycqa/flake8/issues/555I am super excited to help! @timothycrosley what do you think?
The text was updated successfully, but these errors were encountered: