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
isort and black config #3497
Comments
That sounds really beautiful :) |
Anyone else want to comment? |
@jensens You did some isort commits in Plone recently. Do you agree with the above? |
Yes, that sounds like a really good settings 👍🏾 and the final result, these only 2 lines are pure beauty 🤩 |
sounds good. so we need to change our styleguide to use black and this isort config too? |
the only thing would be, when ever something changes in black, there is a chance that our profile get's outdated, where the black profile will be update to date or sure. |
I have made an
In the Plone style guide we have advocated the use of these three extra settings for years:
Most important is the first one, which says: we do not care about what is first/second/third party code, just sort everything alphabetically please. |
i like black with the three options like @mauritsvanrees says, that makes sense. |
My PR to |
https://github.com/PyCQA/isort/blob/main/CHANGELOG.md#5110-december-12-2022
|
@idgserpro Ah, thanks for letting us know. So
|
I'm having a look at how https://github.com/zopefoundation/meta works to create a similar tool for plone, first to add Is anyone interested, are there any efforts towards such scenario that I'm not aware of? 🤔 |
Definitely interested in something like that. There is no effort yet, as far as I know. Well, there is the |
Oh, thanks for the pointer and the ready example 👍🏾 I will have a look during Christmas vacations when I want to get some time off family 😆 |
We are already using |
Several packages have an
isort
config. Often something like this:But ever since
isort
has gotten profiles, like theblack
used above, it has also had aplone
profile. See the current profiles. The black and plone profiles are defined like this:The author seems to have gotten the config out of the Plone style guide.
Compared with the top most config, the
plone
profile has line length 200, which we want to be 88 for standard black compatibility.And the black config has some extra options that influence how to handle a too long import. For a moment I thought this might not matter, because we have
force_single_line = True
, but it does matter. Otherwise you get difference like this when running both black and isort:Neither the
black
nor theplone
profile has changed since two years, so they are pretty stable.Shall we ask to update the
plone
profile inisort
? Then we can simply use this isort config:It seems best to copy the
black
settings and add our own sauce on top:Does that sound good?
See also the
isort
options documentation.And PLIP #2754.
The text was updated successfully, but these errors were encountered: