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

Add isort profiles to compatible configs #1556

Closed
mcsitter opened this issue Jul 18, 2020 · 1 comment · Fixed by #1559
Closed

Add isort profiles to compatible configs #1556

mcsitter opened this issue Jul 18, 2020 · 1 comment · Fixed by #1559
Labels
T: enhancement New feature or request

Comments

@mcsitter
Copy link
Contributor

As we all know, black enforces certain standards. This can collide with other tools like isort.
In the compatible configurations section the necessary changes are already described. This is cumbersome to implement thought.

Luckily isort supports profiles in the config, which works perfectly. a simple profile=black in the settings file and it is applied. It would be great to add this notice to the docs and possibly also update the examples accordingly.

I am happy to create a PR if so desired!

@mcsitter mcsitter added the T: enhancement New feature or request label Jul 18, 2020
@ichard26
Copy link
Collaborator

ichard26 commented Jul 18, 2020

@mcsitter thanks for bringing this up! It's always nice to make the process of bootstrapping a new project just a little easier :)

If you want to do a PR for this, go ahead! I am the original author of the compatible_configs.md document(ation) and when isort 5 was released I did think about adding the Black profile... but I didn't. IMO, I think the manual configurations should stay since isort 5 is a huge upgrade and some teams might not be able to use isort 5 and its awesome profiles (e.g. it does drop Python 2 support). While you are at it, you could add ensure_newline_before_comments = True to the original config since that's part of the Black profile provided by isort 5.

https://github.com/timothycrosley/isort/blob/9b0fd43956ca9881a1fec9dddb16b4eb18923a7a/isort/profiles.py#L4-L11

Although it's a super new configuration option (added in this month I believe) so if you're gonna use ensure_newline_before_comments you might as well just use isort 5. I wouldn't add ensure_newline_before_comments but that's your call, I just want to provide some information to help you in making your PR :)

Once again, thank you for showing interest by filing this issue and being willing to help with a PR! If you have any questions, feel free to tell me! If time allows, I am happy to review your PR, although I don't have the final say on whether your PR will be merged ;)

Edit: I can always do this myself if needed by the way. No problems if something comes up and you can't do the PR.

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

Successfully merging a pull request may close this issue.

2 participants