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

STY Enables black with experimental_string_processing=true #20412

Merged
merged 2 commits into from
Jun 29, 2021

Conversation

thomasjpfan
Copy link
Member

Reference Issues/PRs

Resolves #20365

What does this implement/fix? Explain your changes.

This should be merged with the "rebase and merge" option to keep the two commits separate:

  1. MAINT Adds experimental_string_processing to pyproject.toml
  2. STY Runs black with experimental_string_processing=true

@thomasjpfan
Copy link
Member Author

The doc error is being fixed here: #20410

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

I did a manual review of ~30 files at random and could not spot any issue. It generally improves things a lot. I think we can trust the tests for this change to be correct. Doing a full review of this diff is going to be tedious.

Note: there plenty of cases where the code could be even cleaner / simpler by using f-strings instead of .format() or %-based string interpolation but this can be improved progressively later.

@rth
Copy link
Member

rth commented Jun 28, 2021

Note: there plenty of cases where the code could be even cleaner / simpler by using f-strings instead of .format() or %-based string interpolation but this can be improved progressively later.

Yes, if we are into such automatic code changes, running pyupgrade on the code would perform a migration to f-strings. But then this means that such tooling would also need to be available for people solving PR merge conflicts, so what's a good compromise there remains to be determined. Maybe something we can talk about at the meeting.

@ogrisel
Copy link
Member

ogrisel commented Jun 28, 2021

Edit: #20410 was merged. I think you should rebase this on top of main to make sure CI is 100% green before merging.

Edit2: actually there are conflicts, so the black step should be re-run :)

@thomasjpfan thomasjpfan force-pushed the black_string_normalize branch from 588e08c to 65378ac Compare June 28, 2021 18:14
@ogrisel
Copy link
Member

ogrisel commented Jun 29, 2021

@rth shall we merge this one? The CI is green and there are no conflicts but it won't last long I think.

@rth
Copy link
Member

rth commented Jun 29, 2021

Yes, thanks @thomasjpfan !

@rth rth merged commit 3ae7c76 into scikit-learn:main Jun 29, 2021
samronsin pushed a commit to samronsin/scikit-learn that referenced this pull request Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Black introduced a lot of interrupted strings
3 participants