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

Use black's --preview flag once as a test #3882

Merged
merged 3 commits into from Sep 22, 2023
Merged

Conversation

harshil21
Copy link
Member

@harshil21 harshil21 commented Sep 9, 2023

I noticed multiple times that black doesn't always automatically fix issues where the code has exceeded the line length. This seemed to happen in strings like:

warn(
"blah blah this string will not be formatted no matter how long it gets",
...
)

Which made me find the fix for it: psf/black#1802 (comment)

So this PR enables that and it also fixes a few more things, neat!

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Looks like you edited the (optional) requirements or the pre-commit hooks. I'm just a friendly reminder to keep the additional dependencies for the hooks in sync with the requirements :)

@Bibo-Joshi
Copy link
Member

Bibo-Joshi commented Sep 10, 2023

Hey, interesting findings! I agree that the future features under the --preview flag continue to improve the black style. Black not splitting long string automatically surely is a bit tedious right now, though not really a deal breaker IMO :D

The description of the preview feater states

Experimental, potentially disruptive style changes are gathered under the --preview CLI flag. At the end of each year, these changes may be adopted into the default style, as described in The Black Code Style.

This sounds to me like functionality behind the --preview flag is more likely to be buggy, may change more frequently and may in the end not make it into the stable style. TBH [I do not think] the benefit of the gradually nicer style tweaks is worth this instability risk :/
A one-time change is ofc fine with me as long as the current black version accepts these changes :)

@Bibo-Joshi
Copy link
Member

Sorry harshil but I think there is a misunderstanding here. My point is that I don't like the changes in pre-commit-config and pyproject.toml very much …

@harshil21 harshil21 changed the title Use black's --preview flag to fix line length issues Use black's --preview flag once as a test Sep 17, 2023
@Bibo-Joshi Bibo-Joshi merged commit ab90cd7 into master Sep 22, 2023
22 of 23 checks passed
@Bibo-Joshi Bibo-Joshi deleted the use-black-preview branch September 22, 2023 16:19
@github-actions github-actions bot locked and limited conversation to collaborators Sep 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants