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

Fix #4011: Handle more huggable immediately nested parens/brackets. #4012

Merged
merged 23 commits into from Nov 18, 2023

Conversation

yilei
Copy link
Contributor

@yilei yilei commented Nov 1, 2023

Description

Fix #4011.

Checklist - did you ...

  • Add an entry in CHANGES.md if necessary?
  • Add / update tests if necessary?
  • Add new / update outdated documentation?

@yilei yilei marked this pull request as draft November 1, 2023 00:24
Copy link

github-actions bot commented Nov 1, 2023

diff-shades results comparing this PR (240c218) to main (58f31a7). The full diff is available in the logs under the "Generate HTML diff report" step.

╭─────────────────────────── Summary ────────────────────────────╮
│ 21 projects & 729 files changed / 18 848 changes [+8861/-9987] │
│                                                                │
│ ... out of 2 513 998 lines, 11 770 files & 23 projects         │
╰────────────────────────────────────────────────────────────────╯

Differences found.

What is this? | Workflow run | diff-shades documentation

@yilei yilei marked this pull request as ready for review November 1, 2023 02:21
@yilei
Copy link
Contributor Author

yilei commented Nov 1, 2023

Looks like the changelog checker doesn't like me combining two PRs in CHANGES.md, let me know if you prefer separating them.

CHANGES.md Outdated Show resolved Hide resolved
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
src/black/lines.py Outdated Show resolved Hide resolved
@yilei
Copy link
Contributor Author

yilei commented Nov 7, 2023

Looking at diff shades, this explodes:

-man_pages = [
-    ("index", doc_module.__name__, doc_module.__name__ + " Documentation", [""], 1)
-]
+man_pages = [(
+    "index",
+    doc_module.__name__,
+    doc_module.__name__ + " Documentation",
+    [""],
+    1,
+)]
-    c = Context({
-        "version": get_docs_version(),
-    })
+    c = Context(
+        {
+            "version": get_docs_version(),
+        }
+    )

I'll take a look later.

@yilei yilei marked this pull request as draft November 7, 2023 05:27
@yilei yilei marked this pull request as ready for review November 9, 2023 05:17
@yilei
Copy link
Contributor Author

yilei commented Nov 9, 2023

diff-shades finally succeeded after several retries.

I tried my best to read through the preview diffs, and they all look expected to me.

copybara-service bot pushed a commit to google/pyink that referenced this pull request Nov 15, 2023
This keeps two blank lines between the module docstring and the following def/class when there are no other code in between.

Why cherrypick not rebase? Pyink is not yet ready to rebase to Black 23.11.0 yet, I'm waiting for psf#4012 to be merged as Pyink has local patches related by hugging parens.

PiperOrigin-RevId: 582472645
copybara-service bot pushed a commit to google/pyink that referenced this pull request Nov 15, 2023
This keeps two blank lines between the module docstring and the following def/class when there are no other code in between.

Why cherrypick not rebase? Pyink is not yet ready to rebase to Black 23.11.0, I'm waiting for psf#4012 to be merged as Pyink has local patches related to hugging parens.

PiperOrigin-RevId: 582472645
copybara-service bot pushed a commit to google/pyink that referenced this pull request Nov 15, 2023
This keeps two blank lines between the module docstring and the following def/class when there are no other code in between.

Why cherrypick not rebase? Pyink is not yet ready to rebase to Black 23.11.0, I'm waiting for psf#4012 to be merged as Pyink has local patches related to hugging parens.

Also added two missing patches.

PiperOrigin-RevId: 582472645
copybara-service bot pushed a commit to google/pyink that referenced this pull request Nov 15, 2023
This keeps two blank lines between the module docstring and the following def/class when there are no other code in between.

Why cherrypick not rebase? Pyink is not yet ready to rebase to Black 23.11.0, I'm waiting for psf#4012 to be merged as Pyink has local patches related to hugging parens.

Also added two missing patches.

PiperOrigin-RevId: 582704838
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preview: handle more huggable immediately nested parens/brackets
2 participants