[
  {
    "url": "https://api.github.com/repos/psf/black/issues/5717",
    "repository_url": "https://api.github.com/repos/psf/black",
    "labels_url": "https://api.github.com/repos/psf/black/issues/5717/labels{/name}",
    "comments_url": "https://api.github.com/repos/psf/black/issues/5717/comments",
    "events_url": "https://api.github.com/repos/psf/black/issues/5717/events",
    "html_url": "https://github.com/psf/black/pull/5717",
    "id": 6505674688,
    "node_id": "PR_kwDOB3dpmM8AAAABQl7W2Q",
    "number": 5717,
    "title": "Fix # fmt: skip inside f-string and t-string replacement fields (#5708)",
    "user": {
      "login": "Prateek99-s",
      "id": 145468640,
      "node_id": "U_kgDOCKus4A",
      "avatar_url": "https://avatars.githubusercontent.com/u/145468640?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/Prateek99-s",
      "html_url": "https://github.com/Prateek99-s",
      "followers_url": "https://api.github.com/users/Prateek99-s/followers",
      "following_url": "https://api.github.com/users/Prateek99-s/following{/other_user}",
      "gists_url": "https://api.github.com/users/Prateek99-s/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/Prateek99-s/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/Prateek99-s/subscriptions",
      "organizations_url": "https://api.github.com/users/Prateek99-s/orgs",
      "repos_url": "https://api.github.com/users/Prateek99-s/repos",
      "events_url": "https://api.github.com/users/Prateek99-s/events{/privacy}",
      "received_events_url": "https://api.github.com/users/Prateek99-s/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "labels": [],
    "state": "open",
    "locked": false,
    "assignees": [],
    "milestone": null,
    "comments": 1,
    "created_at": "2026-11-20T05:46:57Z",
    "updated_at": "2026-11-20T06:29:09Z",
    "closed_at": null,
    "assignee": null,
    "author_association": "CONTRIBUTOR",
    "issue_field_values": [],
    "type": null,
    "active_lock_reason": null,
    "draft": false,
    "pull_request": {
      "url": "https://api.github.com/repos/psf/black/pulls/5717",
      "html_url": "https://github.com/psf/black/pull/5717",
      "diff_url": "https://github.com/psf/black/pull/5717.diff",
      "patch_url": "https://github.com/psf/black/pull/5717.patch",
      "merged_at": null
    },
    "body": "## Summary\n\nFixes #5708.\n\nWhen `# fmt: skip` is used inside a multiline f-string or t-string replacement field (e.g. `f\"{\\n    a+b  # fmt: skip\\n}\"`), `normalize_fmt_off` converts the skipped expression and `# fmt: skip` into a `STANDALONE_COMMENT` leaf and consumes the trailing newline from the following leaf's prefix (e.g. `}`).\n\nWhen `fstring_tstring_to_string(node)` re-serialized the f-string/t-string back to a string leaf, `str(node)` directly concatenated children without adding a newline after the `STANDALONE_COMMENT`. This caused the following token (`}`) to be glued onto the comment line (`a+b  # fmt: skip}`), swallowing it into the comment and failing with an `InvalidInput` / `cannot parse: 3:0: ParseError: bad input`.\n\nThis PR introduces `_stringify_node_with_comment_newlines()` in `src/black/nodes.py` to ensure that any `STANDALONE_COMMENT` ending with a comment line preserves its trailing newline when stringified inside an f-string or t-string.\n\n## Test Plan\n\n- Added `tests/data/cases/fmtskip_in_fstring_expression.py` (PEP 701 f-strings).\n- Added `tests/data/cases/fmtskip_in_tstring_expression.py` (PEP 750 t-strings).\n- Verified `pytest tests/test_format.py` (341/341 passed).\n- Verified `pytest tests/test_black.py` (560 passed).\n- Ran `black`, `flake8`, and `mypy` with 0 issues.\n",
    "closed_by": null,
    "reactions": {
      "url": "https://api.github.com/repos/psf/black/issues/5717/reactions",
      "total_count": 0,
      "+1": 0,
      "-1": 0,
      "laugh": 0,
      "hooray": 0,
      "confused": 0,
      "heart": 0,
      "rocket": 0,
      "eyes": 0
    },
    "timeline_url": "https://api.github.com/repos/psf/black/issues/5717/timeline",
    "performed_via_github_app": null,
    "state_reason": null
  },
  {
    "url": "https://api.github.com/repos/psf/black/issues/5716",
    "repository_url": "https://api.github.com/repos/psf/black",
    "labels_url": "https://api.github.com/repos/psf/black/issues/5716/labels{/name}",
    "comments_url": "https://api.github.com/repos/psf/black/issues/5716/comments",
    "events_url": "https://api.github.com/repos/psf/black/issues/5716/events",
    "html_url": "https://github.com/psf/black/pull/5716",
    "id": 6495635913,
    "node_id": "PR_kwDOB3dpmM8AAAABQd4_-A",
    "number": 5716,
    "title": "Fix --line-ranges over-indenting comments outside the selected ranges",
    "user": {
      "login": "BlueX888",
      "id": 140241684,
      "node_id": "U_kgDOCFvrFA",
      "avatar_url": "https://avatars.githubusercontent.com/u/140241684?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/BlueX888",
      "html_url": "https://github.com/BlueX888",
      "followers_url": "https://api.github.com/users/BlueX888/followers",
      "following_url": "https://api.github.com/users/BlueX888/following{/other_user}",
      "gists_url": "https://api.github.com/users/BlueX888/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/BlueX888/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/BlueX888/subscriptions",
      "organizations_url": "https://api.github.com/users/BlueX888/orgs",
      "repos_url": "https://api.github.com/users/BlueX888/repos",
      "events_url": "https://api.github.com/users/BlueX888/events{/privacy}",
      "received_events_url": "https://api.github.com/users/BlueX888/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "labels": [],
    "state": "open",
    "locked": false,
    "assignees": [],
    "milestone": null,
    "comments": 2,
    "created_at": "2026-11-19T17:46:21Z",
    "updated_at": "2026-11-20T05:28:49Z",
    "closed_at": null,
    "assignee": null,
    "author_association": "NONE",
    "issue_field_values": [],
    "type": null,
    "active_lock_reason": null,
    "draft": false,
    "pull_request": {
      "url": "https://api.github.com/repos/psf/black/pulls/5716",
      "html_url": "https://github.com/psf/black/pull/5716",
      "diff_url": "https://github.com/psf/black/pull/5716.diff",
      "patch_url": "https://github.com/psf/black/pull/5716.patch",
      "merged_at": null
    },
    "body": "### Description\n\n`black --line-ranges` over-indents standalone comments that sit outside the selected ranges when their surrounding block is reindented and the file uses 2-space or tab indentation.\n\nThis is a regression: 26.5.1 produced the correct 8-space indent, 26.10.0 produces 12. It was introduced by #5175 (\"Preserve prefixes outside `--line-ranges`\") and kept by #5617. Root cause: `generate_comments()` renders unselected comments as `pc.original_line.removeprefix(\"    \" * block_depth)`. `removeprefix` only strips when the source line starts with the new 4-space indent. With 2-space or tab-indented source the original indent is narrower, so nothing is stripped, and the line renderer adds the new block indent on top of the old one.\n\nThe fix strips up to `4 * block_depth` leading spaces or tabs from the original line before handing it to the renderer, which adds the new block indentation itself. Selected comments are unchanged, and comments in 4-space sources that are indented at a multiple of 4 are byte-identical.\n\nTests: two data cases under `tests/data/cases/` (2-space and tab source, `--line-ranges=7-8`). Both fail on `c0e143e` with the doubled indent and pass with the change. Full suite (`pytest tests --ignore=tests/test_blackd.py`, the `d` extra is not installed): 651 passed, 3 skipped, 31 subtests. `tox -e run_self` and `black --check src` pass. No linked issue; this was found by bisecting the released versions rather than from an existing report.\n\n### Checklist - did you ...\n\n- [x] Implement any code style changes under the `--preview` style, following the stability policy? This is not a style change: it restores the indentation of unselected lines to the pre-26.10.0 (26.5.1) behavior.\n- [x] Add an entry in `CHANGES.md` if necessary? Yes, under Stable style; the PR number is filled in after opening.\n- [x] Add / update tests if necessary? Yes, two data cases, both fail before the change.\n- [x] Add new / update outdated documentation? No documentation change is needed for this regression fix.\n\nThis was prepared by an AI agent (Claude Code) operating the BlueX888 GitHub account; the account owner reviewed it and takes responsibility for the submission.\n\n",
    "closed_by": null,
    "reactions": {
      "url": "https://api.github.com/repos/psf/black/issues/5716/reactions",
      "total_count": 0,
      "+1": 0,
      "-1": 0,
      "laugh": 0,
      "hooray": 0,
      "confused": 0,
      "heart": 0,
      "rocket": 0,
      "eyes": 0
    },
    "timeline_url": "https://api.github.com/repos/psf/black/issues/5716/timeline",
    "performed_via_github_app": null,
    "state_reason": null
  },
  {
    "url": "https://api.github.com/repos/psf/black/issues/5715",
    "repository_url": "https://api.github.com/repos/psf/black",
    "labels_url": "https://api.github.com/repos/psf/black/issues/5715/labels{/name}",
    "comments_url": "https://api.github.com/repos/psf/black/issues/5715/comments",
    "events_url": "https://api.github.com/repos/psf/black/issues/5715/events",
    "html_url": "https://github.com/psf/black/pull/5715",
    "id": 6487874455,
    "node_id": "PR_kwDOB3dpmM8AAAABQXlCPw",
    "number": 5715,
    "title": "Optimize memory usage with __slots__ on blib2to3 pytree Base, Node, and Leaf (#5216)",
    "user": {
      "login": "YK-03",
      "id": 144125598,
      "node_id": "U_kgDOCJcung",
      "avatar_url": "https://avatars.githubusercontent.com/u/144125598?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/YK-03",
      "html_url": "https://github.com/YK-03",
      "followers_url": "https://api.github.com/users/YK-03/followers",
      "following_url": "https://api.github.com/users/YK-03/following{/other_user}",
      "gists_url": "https://api.github.com/users/YK-03/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/YK-03/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/YK-03/subscriptions",
      "organizations_url": "https://api.github.com/users/YK-03/orgs",
      "repos_url": "https://api.github.com/users/YK-03/repos",
      "events_url": "https://api.github.com/users/YK-03/events{/privacy}",
      "received_events_url": "https://api.github.com/users/YK-03/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "labels": [
      {
        "id": 2843125410,
        "node_id": "MDU6TGFiZWwyODQzMTI1NDEw",
        "url": "https://api.github.com/repos/psf/black/labels/ci:%20skip%20news",
        "name": "ci: skip news",
        "color": "000000",
        "default": false,
        "description": "Pull requests that don't need a changelog entry.",
        "archived_at": null,
        "archived_by": null
      }
    ],
    "state": "closed",
    "locked": false,
    "assignees": [],
    "milestone": null,
    "comments": 2,
    "created_at": "2026-11-19T10:49:35Z",
    "updated_at": "2026-11-20T05:55:04Z",
    "closed_at": "2026-11-20T05:55:03Z",
    "assignee": null,
    "author_association": "CONTRIBUTOR",
    "issue_field_values": [],
    "type": null,
    "active_lock_reason": null,
    "draft": false,
    "pull_request": {
      "url": "https://api.github.com/repos/psf/black/pulls/5715",
      "html_url": "https://github.com/psf/black/pull/5715",
      "diff_url": "https://github.com/psf/black/pull/5715.diff",
      "patch_url": "https://github.com/psf/black/pull/5715.patch",
      "merged_at": "2026-11-20T05:55:03Z"
    },
    "body": "## Summary of changes\n\nImplements memory optimizations on `blib2to3` AST nodes by introducing `__slots__` to `Base`, `Node`, and `Leaf` as suggested in #5216.\n\nBy defining `__slots__` across the hierarchy and moving default initialization into `__init__`:\n- Completely eliminates per-instance `__dict__` allocation for AST nodes.\n- Decreases single `Leaf` instance memory from 352 bytes to 128 bytes (**~63.6% reduction**).\n- Decreases single `Node` instance memory from 352 bytes to 72 bytes (**~79.5% reduction**).\n- Preserves full compatibility with AST traversal, `clone()`, and `pickle` serialization.\n\nCloses #5216.\n\n## Test plan\n\n- Added `tests/test_pytree.py` testing slot enforcement, attribute defaults, context unpacking, cloning, and pickle roundtrips.\n- Ran full formatting test suite: `pytest tests/test_format.py` (338 passed).\n- Ran core formatting and AST safety tests: `pytest -k \"test_format_str or TestASTSafety\" tests/test_black.py` (all passed).\n- Ran code style checks: `black --check src/blib2to3/pytree.py tests/test_pytree.py` (all clean).\n",
    "closed_by": {
      "login": "cobaltt7",
      "id": 61329810,
      "node_id": "MDQ6VXNlcjYxMzI5ODEw",
      "avatar_url": "https://avatars.githubusercontent.com/u/61329810?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/cobaltt7",
      "html_url": "https://github.com/cobaltt7",
      "followers_url": "https://api.github.com/users/cobaltt7/followers",
      "following_url": "https://api.github.com/users/cobaltt7/following{/other_user}",
      "gists_url": "https://api.github.com/users/cobaltt7/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/cobaltt7/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/cobaltt7/subscriptions",
      "organizations_url": "https://api.github.com/users/cobaltt7/orgs",
      "repos_url": "https://api.github.com/users/cobaltt7/repos",
      "events_url": "https://api.github.com/users/cobaltt7/events{/privacy}",
      "received_events_url": "https://api.github.com/users/cobaltt7/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "reactions": {
      "url": "https://api.github.com/repos/psf/black/issues/5715/reactions",
      "total_count": 0,
      "+1": 0,
      "-1": 0,
      "laugh": 0,
      "hooray": 0,
      "confused": 0,
      "heart": 0,
      "rocket": 0,
      "eyes": 0
    },
    "timeline_url": "https://api.github.com/repos/psf/black/issues/5715/timeline",
    "performed_via_github_app": null,
    "state_reason": null
  },
  {
    "url": "https://api.github.com/repos/psf/black/issues/5714",
    "repository_url": "https://api.github.com/repos/psf/black",
    "labels_url": "https://api.github.com/repos/psf/black/issues/5714/labels{/name}",
    "comments_url": "https://api.github.com/repos/psf/black/issues/5714/comments",
    "events_url": "https://api.github.com/repos/psf/black/issues/5714/events",
    "html_url": "https://github.com/psf/black/pull/5714",
    "id": 6487608776,
    "node_id": "PR_kwDOB3dpmM8AAAABQXXRGA",
    "number": 5714,
    "title": "Add --show-files to list the files Black would format",
    "user": {
      "login": "SnakeO",
      "id": 136700,
      "node_id": "MDQ6VXNlcjEzNjcwMA==",
      "avatar_url": "https://avatars.githubusercontent.com/u/136700?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/SnakeO",
      "html_url": "https://github.com/SnakeO",
      "followers_url": "https://api.github.com/users/SnakeO/followers",
      "following_url": "https://api.github.com/users/SnakeO/following{/other_user}",
      "gists_url": "https://api.github.com/users/SnakeO/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/SnakeO/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/SnakeO/subscriptions",
      "organizations_url": "https://api.github.com/users/SnakeO/orgs",
      "repos_url": "https://api.github.com/users/SnakeO/repos",
      "events_url": "https://api.github.com/users/SnakeO/events{/privacy}",
      "received_events_url": "https://api.github.com/users/SnakeO/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "labels": [],
    "state": "open",
    "locked": false,
    "assignees": [],
    "milestone": null,
    "comments": 1,
    "created_at": "2026-11-19T10:33:43Z",
    "updated_at": "2026-11-20T05:49:26Z",
    "closed_at": null,
    "assignee": null,
    "author_association": "NONE",
    "issue_field_values": [],
    "type": null,
    "active_lock_reason": null,
    "draft": false,
    "pull_request": {
      "url": "https://api.github.com/repos/psf/black/pulls/5714",
      "html_url": "https://github.com/psf/black/pull/5714",
      "diff_url": "https://github.com/psf/black/pull/5714.diff",
      "patch_url": "https://github.com/psf/black/pull/5714.patch",
      "merged_at": null
    },
    "body": "### Description\n\ncloses #3560.\n\nadds a `--show-files` flag that prints the files Black would format, one per line, and exits without formatting anything. it uses the same file discovery as a normal run, so `--include`, `--exclude`, `--extend-exclude`, `--force-exclude` and `.gitignore` all apply, and excluded files are just left out (what the reporter asked for, same as isort's `--show-files`). the list goes to stdout while the `-v` messages stay on stderr so it can be piped into a script. stdin shows up as `-`, or as the `--stdin-filename` when one is given, and passing `--show-files` with `--code` is an error.\n\ntested with new tests in `tests/test_black.py` (directory discovery with an exclude and a `.gitignore`, with and without `-v`; stdin and `--stdin-filename`; the `--code` error), then `tox -e py`, `tox -e run_self`, `tox -e generate_schema` and `pre-commit run -a`.\n\n### Checklist - did you ...\n\n- [x] Implement any code style changes under the `--preview` style, following the stability policy?\n- [x] Add an entry in `CHANGES.md` if necessary?\n- [x] Add / update tests if necessary?\n- [x] Add new / update outdated documentation?\n",
    "closed_by": null,
    "reactions": {
      "url": "https://api.github.com/repos/psf/black/issues/5714/reactions",
      "total_count": 0,
      "+1": 0,
      "-1": 0,
      "laugh": 0,
      "hooray": 0,
      "confused": 0,
      "heart": 0,
      "rocket": 0,
      "eyes": 0
    },
    "timeline_url": "https://api.github.com/repos/psf/black/issues/5714/timeline",
    "performed_via_github_app": null,
    "state_reason": null
  },
  {
    "url": "https://api.github.com/repos/psf/black/issues/5713",
    "repository_url": "https://api.github.com/repos/psf/black",
    "labels_url": "https://api.github.com/repos/psf/black/issues/5713/labels{/name}",
    "comments_url": "https://api.github.com/repos/psf/black/issues/5713/comments",
    "events_url": "https://api.github.com/repos/psf/black/issues/5713/events",
    "html_url": "https://github.com/psf/black/pull/5713",
    "id": 6482829532,
    "node_id": "PR_kwDOB3dpmM8AAAABQThtfw",
    "number": 5713,
    "title": "Support scoped configuration variables in the Vim plugin",
    "user": {
      "login": "CharoenwitKunna",
      "id": 198737307,
      "node_id": "U_kgDOC9h9mw",
      "avatar_url": "https://avatars.githubusercontent.com/u/198737307?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/CharoenwitKunna",
      "html_url": "https://github.com/CharoenwitKunna",
      "followers_url": "https://api.github.com/users/CharoenwitKunna/followers",
      "following_url": "https://api.github.com/users/CharoenwitKunna/following{/other_user}",
      "gists_url": "https://api.github.com/users/CharoenwitKunna/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/CharoenwitKunna/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/CharoenwitKunna/subscriptions",
      "organizations_url": "https://api.github.com/users/CharoenwitKunna/orgs",
      "repos_url": "https://api.github.com/users/CharoenwitKunna/repos",
      "events_url": "https://api.github.com/users/CharoenwitKunna/events{/privacy}",
      "received_events_url": "https://api.github.com/users/CharoenwitKunna/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "labels": [],
    "state": "open",
    "locked": false,
    "assignees": [],
    "milestone": null,
    "comments": 0,
    "created_at": "2026-11-19T05:07:07Z",
    "updated_at": "2026-11-19T23:17:57Z",
    "closed_at": null,
    "assignee": null,
    "author_association": "NONE",
    "issue_field_values": [],
    "type": null,
    "active_lock_reason": null,
    "draft": false,
    "pull_request": {
      "url": "https://api.github.com/repos/psf/black/pulls/5713",
      "html_url": "https://github.com/psf/black/pull/5713",
      "diff_url": "https://github.com/psf/black/pull/5713.diff",
      "patch_url": "https://github.com/psf/black/pull/5713.patch",
      "merged_at": null
    },
    "body": "Closes #1179\n\nAdds buffer/window/tabpage-local overrides for the Vim plugin's configuration variables, with a guarded fallback to the existing global defaults. Most-local scope wins (b: > w: > t: > g:). The line_length -> black_linelength name remapping is preserved in every scope.\n\nDocs updated in docs/integrations/editors.md. No automated Vim harness exists in CI; correctness rests on the exists()-guarded ternary, following the precedent at autoload/black.vim:94.",
    "closed_by": null,
    "reactions": {
      "url": "https://api.github.com/repos/psf/black/issues/5713/reactions",
      "total_count": 0,
      "+1": 0,
      "-1": 0,
      "laugh": 0,
      "hooray": 0,
      "confused": 0,
      "heart": 0,
      "rocket": 0,
      "eyes": 0
    },
    "timeline_url": "https://api.github.com/repos/psf/black/issues/5713/timeline",
    "performed_via_github_app": null,
    "state_reason": null
  },
  {
    "url": "https://api.github.com/repos/psf/black/issues/5712",
    "repository_url": "https://api.github.com/repos/psf/black",
    "labels_url": "https://api.github.com/repos/psf/black/issues/5712/labels{/name}",
    "comments_url": "https://api.github.com/repos/psf/black/issues/5712/comments",
    "events_url": "https://api.github.com/repos/psf/black/issues/5712/events",
    "html_url": "https://github.com/psf/black/pull/5712",
    "id": 6478476204,
    "node_id": "PR_kwDOB3dpmM8AAAABQQEhEQ",
    "number": 5712,
    "title": "Fix --line-ranges producing invalid code for match statements in 2-space or tab-indented code",
    "user": {
      "login": "anwang132",
      "id": 254722826,
      "node_id": "U_kgDODy7DCg",
      "avatar_url": "https://avatars.githubusercontent.com/u/254722826?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/anwang132",
      "html_url": "https://github.com/anwang132",
      "followers_url": "https://api.github.com/users/anwang132/followers",
      "following_url": "https://api.github.com/users/anwang132/following{/other_user}",
      "gists_url": "https://api.github.com/users/anwang132/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/anwang132/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/anwang132/subscriptions",
      "organizations_url": "https://api.github.com/users/anwang132/orgs",
      "repos_url": "https://api.github.com/users/anwang132/repos",
      "events_url": "https://api.github.com/users/anwang132/events{/privacy}",
      "received_events_url": "https://api.github.com/users/anwang132/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "labels": [],
    "state": "open",
    "locked": false,
    "assignees": [],
    "milestone": null,
    "comments": 2,
    "created_at": "2026-11-18T23:01:04Z",
    "updated_at": "2026-11-20T05:28:43Z",
    "closed_at": null,
    "assignee": null,
    "author_association": "NONE",
    "issue_field_values": [],
    "type": null,
    "active_lock_reason": null,
    "draft": false,
    "pull_request": {
      "url": "https://api.github.com/repos/psf/black/pulls/5712",
      "html_url": "https://github.com/psf/black/pull/5712",
      "diff_url": "https://github.com/psf/black/pull/5712.diff",
      "patch_url": "https://github.com/psf/black/pull/5712.patch",
      "merged_at": null
    },
    "body": "### Description\n\n`--line-ranges` crashes or writes out invalid code for a `match` statement when the\nsource is not indented in multiples of four and the `case` blocks fall outside the\nselected lines.\n\n```console\n$ printf 'match command:\\n  case 1:\\n    pass\\n' > t.py\n$ black --line-ranges=1-1 t.py\nerror: cannot format t.py: INTERNAL ERROR: Black 26.10.2.dev125+gc0e143e75 on Python\n(CPython) 3.13.18 produced invalid code: cannot parse: 3:4\n```\n\nWhen the statement is preceded by blank lines the safety check doesn't catch it and the\ninvalid code is written to the file:\n\n```console\n$ printf '\\n\\n\\nmatch command:\\n  case 1:\\n    pass\\n' > t.py\n$ black --line-ranges=1-1 t.py\nreformatted t.py\n$ cat t.py\nmatch command:\n    case 1:\n    pass\n```\n\nThe `case` header is reindented to four spaces while its body keeps the original two, so\nthe body is no longer indented relative to its header. A tab-indented source gets the\nsame treatment and ends up with `inconsistent use of tabs and spaces in indentation`.\n`if`, `for`, `while`, `with` and `try` are all unaffected; only `match` is.\n\n### Root cause\n\n`match_stmt` is the one compound statement that doesn't hold its body in a `suite`:\n\n```\nmatch_stmt: \"match\" subject_expr ':' NEWLINE INDENT case_block+ DEDENT\n```\n\n`_TopLevelStatementsVisitor` has no `visit_match_stmt`, so `visit_default` descends\nthrough the `match_stmt` into each `case_block`, and `visit_suite` then fires on the case\nblock's own suite and converts the entire `case_block` to one `STANDALONE_COMMENT`. For\nevery other compound statement the visitor stops at the statement's top-level `suite` and\nso never reaches a nested one.\n\nA `STANDALONE_COMMENT` is written at the depth Black computes for it while its value is\nthe original text, so only its first line gets reindented. At depth 0 that is harmless,\nwhich is why converting an unchanged top-level function or class works. A `case_block`\nsits at depth 1, so its header moves and its body doesn't.\n\nThis is the same failure mode as #5672, where stacked decorators were being converted as\none block for the same reason.\n\n### Fix\n\nAdd `visit_match_stmt` to the visitor. It converts the statement as a whole when none of\nit is selected, which is safe at depth 0 and keeps that fast path, and otherwise stops\nthere and leaves the case blocks to `_convert_unchanged_line_by_line`, which converts\nthem a line at a time and reindents each one. `match` now follows the same route as the\nother compound statements.\n\n### Tests\n\n`tests/data/cases/line_ranges_match_case_indentation.py` covers both halves: a `match`\nwhose header is selected and whose 2-space `case` blocks are not, and a second `match`\nentirely outside the range, which was also being mangled before (its `case` header was\nreindented and its body left behind) and is now preserved verbatim.\n\nWithout the change the new case fails with\n`InvalidInput: ... produced invalid code: cannot parse: 7:4`, and with it the case\npasses.\n\nI also checked that nothing else changes behaviour: formatting every single line range of\nall 38 existing `pattern_matching*`, `line_ranges*` and `line_ranges_formatted` test\nsources (1,558 runs) gives byte-identical output before and after this commit. The full\nsuite passes (693 passed, 4 skipped), as do flake8, mypy, isort and prettier on the\nchanged files.\n\n### Checklist - did you ...\n\n- [x] Implement any code style changes under the `--preview` style, following the\n      stability policy? (not applicable: this fixes invalid output, it doesn't change\n      the style of valid output)\n- [x] Add an entry in `CHANGES.md` if necessary?\n- [x] Add / update tests if necessary?\n- [x] Add new / update outdated documentation? (not applicable)\n",
    "closed_by": null,
    "reactions": {
      "url": "https://api.github.com/repos/psf/black/issues/5712/reactions",
      "total_count": 0,
      "+1": 0,
      "-1": 0,
      "laugh": 0,
      "hooray": 0,
      "confused": 0,
      "heart": 0,
      "rocket": 0,
      "eyes": 0
    },
    "timeline_url": "https://api.github.com/repos/psf/black/issues/5712/timeline",
    "performed_via_github_app": null,
    "state_reason": null
  },
  {
    "url": "https://api.github.com/repos/psf/black/issues/5711",
    "repository_url": "https://api.github.com/repos/psf/black",
    "labels_url": "https://api.github.com/repos/psf/black/issues/5711/labels{/name}",
    "comments_url": "https://api.github.com/repos/psf/black/issues/5711/comments",
    "events_url": "https://api.github.com/repos/psf/black/issues/5711/events",
    "html_url": "https://github.com/psf/black/pull/5711",
    "id": 6464779208,
    "node_id": "PR_kwDOB3dpmM8AAAABQE_4jg",
    "number": 5711,
    "title": "Reject --line-ranges for notebooks detected by their .ipynb extension",
    "user": {
      "login": "divya0795",
      "id": 12871391,
      "node_id": "MDQ6VXNlcjEyODcxMzkx",
      "avatar_url": "https://avatars.githubusercontent.com/u/12871391?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/divya0795",
      "html_url": "https://github.com/divya0795",
      "followers_url": "https://api.github.com/users/divya0795/followers",
      "following_url": "https://api.github.com/users/divya0795/following{/other_user}",
      "gists_url": "https://api.github.com/users/divya0795/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/divya0795/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/divya0795/subscriptions",
      "organizations_url": "https://api.github.com/users/divya0795/orgs",
      "repos_url": "https://api.github.com/users/divya0795/repos",
      "events_url": "https://api.github.com/users/divya0795/events{/privacy}",
      "received_events_url": "https://api.github.com/users/divya0795/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "labels": [],
    "state": "closed",
    "locked": false,
    "assignees": [],
    "milestone": null,
    "comments": 2,
    "created_at": "2026-11-18T10:10:27Z",
    "updated_at": "2026-11-20T05:29:19Z",
    "closed_at": "2026-11-20T05:29:19Z",
    "assignee": null,
    "author_association": "CONTRIBUTOR",
    "issue_field_values": [],
    "type": null,
    "active_lock_reason": null,
    "draft": false,
    "pull_request": {
      "url": "https://api.github.com/repos/psf/black/pulls/5711",
      "html_url": "https://github.com/psf/black/pull/5711",
      "diff_url": "https://github.com/psf/black/pull/5711.diff",
      "patch_url": "https://github.com/psf/black/pull/5711.patch",
      "merged_at": "2026-11-20T05:29:19Z"
    },
    "body": "### Description\n\n`--line-ranges` is not supported for Jupyter notebooks, as [the docs](https://black.readthedocs.io/en/latest/usage_and_configuration/the_basics.html#line-ranges) say. `main()` already refuses it when `--ipynb` is passed. But a notebook is usually recognised by its `.ipynb` extension, not by the flag, and in that case the option is silently ignored. Black reformats every cell and exits 0.\n\n```console\n$ black --line-ranges=1-1 --diff nb.ipynb      # two unformatted cells\n--- nb.ipynb\t...:cell_0\n+++ nb.ipynb\t...:cell_0\n@@ -1,2 +1,2 @@\n-x=1\n-y=2\n+x = 1\n+y = 2\n--- nb.ipynb\t...:cell_1\n+++ nb.ipynb\t...:cell_1\n@@ -1 +1 @@\n-z  =  3\n+z = 3\nwould reformat nb.ipynb\n$ echo $?\n0\n$ black --line-ranges=1-1 --ipynb nb.ipynb\nCannot use --line-ranges with ipynb files.\n$ echo $?\n1\n```\n\n`black --line-ranges=1-1 --stdin-filename nb.ipynb - < nb.ipynb` also writes out the whole notebook reformatted. So does a directory that holds a single notebook. An editor running \"format selection\" on a notebook gets the whole file rewritten.\n\n**Fix.** `--line-ranges` is only accepted for a single source, so the single-source branch of `main()` now applies the same check to that source's extension. The same message and exit code as the existing `--ipynb` guard are used. This also covers `--stdin-filename`, because the stdin placeholder path keeps the given name's suffix.\n\n**Behaviour.** Before and after:\n\n| command | before | after |\n|---|---|---|\n| `--line-ranges=1-1 nb.ipynb` | whole notebook reformatted, exit 0 | `Cannot use --line-ranges with ipynb files.`, exit 1 |\n| `--line-ranges=1-1 --stdin-filename nb.ipynb -` | whole notebook reformatted, exit 0 | same error, exit 1 |\n| `--line-ranges=1-1 dir/` (dir holds one notebook) | whole notebook reformatted | same error, exit 1 |\n| `--line-ranges=…` on `a.py`, `dir/` with one `.py`, `-`, `--stdin-filename a.py` | formats the range | unchanged |\n| `nb.ipynb` without `--line-ranges` | formats | unchanged |\n\nTwo tests are added to `tests/test_ipynb.py`, one for a file and one for `--stdin-filename`. Both fail without the fix, with exit code 0.\n\n### Checklist - did you ...\n\n- [x] Implement any code style changes under the `--preview` style, following the stability policy? (no style change)\n- [x] Add an entry in `CHANGES.md` if necessary?\n- [x] Add / update tests if necessary?\n- [x] Add new / update outdated documentation? (docs already say this is unsupported)\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n",
    "closed_by": {
      "login": "cobaltt7",
      "id": 61329810,
      "node_id": "MDQ6VXNlcjYxMzI5ODEw",
      "avatar_url": "https://avatars.githubusercontent.com/u/61329810?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/cobaltt7",
      "html_url": "https://github.com/cobaltt7",
      "followers_url": "https://api.github.com/users/cobaltt7/followers",
      "following_url": "https://api.github.com/users/cobaltt7/following{/other_user}",
      "gists_url": "https://api.github.com/users/cobaltt7/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/cobaltt7/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/cobaltt7/subscriptions",
      "organizations_url": "https://api.github.com/users/cobaltt7/orgs",
      "repos_url": "https://api.github.com/users/cobaltt7/repos",
      "events_url": "https://api.github.com/users/cobaltt7/events{/privacy}",
      "received_events_url": "https://api.github.com/users/cobaltt7/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "reactions": {
      "url": "https://api.github.com/repos/psf/black/issues/5711/reactions",
      "total_count": 0,
      "+1": 0,
      "-1": 0,
      "laugh": 0,
      "hooray": 0,
      "confused": 0,
      "heart": 0,
      "rocket": 0,
      "eyes": 0
    },
    "timeline_url": "https://api.github.com/repos/psf/black/issues/5711/timeline",
    "performed_via_github_app": null,
    "state_reason": null
  },
  {
    "url": "https://api.github.com/repos/psf/black/issues/5710",
    "repository_url": "https://api.github.com/repos/psf/black",
    "labels_url": "https://api.github.com/repos/psf/black/issues/5710/labels{/name}",
    "comments_url": "https://api.github.com/repos/psf/black/issues/5710/comments",
    "events_url": "https://api.github.com/repos/psf/black/issues/5710/events",
    "html_url": "https://github.com/psf/black/pull/5710",
    "id": 6463922836,
    "node_id": "PR_kwDOB3dpmM8AAAABQETXrg",
    "number": 5710,
    "title": "Fix crash on dict values that need parens when the key has an operator (preview)",
    "user": {
      "login": "divya0795",
      "id": 12871391,
      "node_id": "MDQ6VXNlcjEyODcxMzkx",
      "avatar_url": "https://avatars.githubusercontent.com/u/12871391?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/divya0795",
      "html_url": "https://github.com/divya0795",
      "followers_url": "https://api.github.com/users/divya0795/followers",
      "following_url": "https://api.github.com/users/divya0795/following{/other_user}",
      "gists_url": "https://api.github.com/users/divya0795/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/divya0795/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/divya0795/subscriptions",
      "organizations_url": "https://api.github.com/users/divya0795/orgs",
      "repos_url": "https://api.github.com/users/divya0795/repos",
      "events_url": "https://api.github.com/users/divya0795/events{/privacy}",
      "received_events_url": "https://api.github.com/users/divya0795/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "labels": [],
    "state": "closed",
    "locked": false,
    "assignees": [],
    "milestone": null,
    "comments": 2,
    "created_at": "2026-11-18T09:21:02Z",
    "updated_at": "2026-11-20T05:30:29Z",
    "closed_at": "2026-11-20T05:30:29Z",
    "assignee": null,
    "author_association": "CONTRIBUTOR",
    "issue_field_values": [],
    "type": null,
    "active_lock_reason": null,
    "draft": false,
    "pull_request": {
      "url": "https://api.github.com/repos/psf/black/pulls/5710",
      "html_url": "https://github.com/psf/black/pull/5710",
      "diff_url": "https://github.com/psf/black/pull/5710.diff",
      "patch_url": "https://github.com/psf/black/pull/5710.patch",
      "merged_at": "2026-11-20T05:30:29Z"
    },
    "body": "### Description\n\nWith `--preview`, `wrap_long_dict_values_in_parens` removes the parentheses a dict value needs when the key contains an operator, so Black produces invalid code and fails with an internal error. This is a regression from #5627 and does not happen with 26.10.1.\n\n```console\n$ printf 'ranges = {name + \"_range\": (lo, hi)}\\n' > t.py\n$ black --preview --check t.py\nerror: INTERNAL ERROR: Black 26.10.2.dev125+gc0e143e75 on Python (CPython) 3.14.10 produced invalid code:\ncannot parse: t.py:1:33\n    ranges = {name + \"_range\": lo, hi}\n                                    ^\n```\n\n`{key + suffix: (n := compute())}` and `{a + b: (yield)}` fail the same way. They come out as `{key + suffix: n := compute()}` and `{a + b: yield}`. Stable style is not affected.\n\n**Cause.** In `visit_dictsetmaker`, when the value or the key has delimiters, a `while` loop steps through the value's paren layers to wrap the innermost expression in invisible parens. The loop also steps through **visible** parens, the ones `maybe_make_parens_invisible_in_atom` just refused to remove because the value is a tuple, a walrus or a `yield`. `wrap_in_parentheses(..., index=i)` then replaces the whole value with an invisible atom around the inner expression, so the required parens are lost.\n\n**Fix.** The loop now only steps through invisible parens. Any parens `maybe_make_parens_invisible_in_atom` judged redundant are already invisible by that point, so the loop keeps exactly the pairs it refused to remove.\n\n**Behaviour.** Before and after, with `--preview`:\n\n| input | before | after |\n|---|---|---|\n| `{name + \"_range\": (lo, hi)}` | INTERNAL ERROR | unchanged |\n| `{key + suffix: (n := compute())}` | INTERNAL ERROR | unchanged |\n| `{a + b: (yield)}` (in a `def`) | INTERNAL ERROR | unchanged |\n| `{a + b: (*c,)}`, `{a + b: (c, d) for a in z}` | INTERNAL ERROR | unchanged |\n| `{a + b: ((c))}`, `{a: (b + c)}`, `{a or b: (lambda: 1)}` | `{a + b: c}`, `{a: b + c}`, `{a or b: lambda: 1}` | same |\n\nI also compared outputs before and after the fix for every `tests/data/cases` input plus these snippets, at line lengths 88, 40, 20 and 1, in stable and preview. That was 2,800 runs. Only 31 outputs changed, and every one went from an internal error to valid output. No output that was already valid changed.\n\nThe regression test cases are added to `preview_long_dict_values.py`, and that test fails without the fix.\n\n### Checklist - did you ...\n\n- [x] Implement any code style changes under the `--preview` style, following the stability policy?\n- [x] Add an entry in `CHANGES.md` if necessary?\n- [x] Add / update tests if necessary?\n- [x] Add new / update outdated documentation? (not needed: crash fix)\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n",
    "closed_by": {
      "login": "cobaltt7",
      "id": 61329810,
      "node_id": "MDQ6VXNlcjYxMzI5ODEw",
      "avatar_url": "https://avatars.githubusercontent.com/u/61329810?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/cobaltt7",
      "html_url": "https://github.com/cobaltt7",
      "followers_url": "https://api.github.com/users/cobaltt7/followers",
      "following_url": "https://api.github.com/users/cobaltt7/following{/other_user}",
      "gists_url": "https://api.github.com/users/cobaltt7/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/cobaltt7/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/cobaltt7/subscriptions",
      "organizations_url": "https://api.github.com/users/cobaltt7/orgs",
      "repos_url": "https://api.github.com/users/cobaltt7/repos",
      "events_url": "https://api.github.com/users/cobaltt7/events{/privacy}",
      "received_events_url": "https://api.github.com/users/cobaltt7/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "reactions": {
      "url": "https://api.github.com/repos/psf/black/issues/5710/reactions",
      "total_count": 0,
      "+1": 0,
      "-1": 0,
      "laugh": 0,
      "hooray": 0,
      "confused": 0,
      "heart": 0,
      "rocket": 0,
      "eyes": 0
    },
    "timeline_url": "https://api.github.com/repos/psf/black/issues/5710/timeline",
    "performed_via_github_app": null,
    "state_reason": null
  },
  {
    "url": "https://api.github.com/repos/psf/black/issues/5709",
    "repository_url": "https://api.github.com/repos/psf/black",
    "labels_url": "https://api.github.com/repos/psf/black/issues/5709/labels{/name}",
    "comments_url": "https://api.github.com/repos/psf/black/issues/5709/comments",
    "events_url": "https://api.github.com/repos/psf/black/issues/5709/events",
    "html_url": "https://github.com/psf/black/pull/5709",
    "id": 6461497671,
    "node_id": "PR_kwDOB3dpmM8AAAABQCWuAA",
    "number": 5709,
    "title": "Fix # fmt: skip inside f-string and t-string replacement fields",
    "user": {
      "login": "Cyber-Marty",
      "id": 221965144,
      "node_id": "U_kgDODTrrWA",
      "avatar_url": "https://avatars.githubusercontent.com/u/221965144?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/Cyber-Marty",
      "html_url": "https://github.com/Cyber-Marty",
      "followers_url": "https://api.github.com/users/Cyber-Marty/followers",
      "following_url": "https://api.github.com/users/Cyber-Marty/following{/other_user}",
      "gists_url": "https://api.github.com/users/Cyber-Marty/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/Cyber-Marty/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/Cyber-Marty/subscriptions",
      "organizations_url": "https://api.github.com/users/Cyber-Marty/orgs",
      "repos_url": "https://api.github.com/users/Cyber-Marty/repos",
      "events_url": "https://api.github.com/users/Cyber-Marty/events{/privacy}",
      "received_events_url": "https://api.github.com/users/Cyber-Marty/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "labels": [],
    "state": "open",
    "locked": false,
    "assignees": [],
    "milestone": null,
    "comments": 2,
    "created_at": "2026-11-18T06:35:25Z",
    "updated_at": "2026-11-20T05:36:11Z",
    "closed_at": null,
    "assignee": null,
    "author_association": "CONTRIBUTOR",
    "issue_field_values": [],
    "type": null,
    "active_lock_reason": null,
    "draft": false,
    "pull_request": {
      "url": "https://api.github.com/repos/psf/black/pulls/5709",
      "html_url": "https://github.com/psf/black/pull/5709",
      "diff_url": "https://github.com/psf/black/pull/5709.diff",
      "patch_url": "https://github.com/psf/black/pull/5709.patch",
      "merged_at": null
    },
    "body": "### Description\n\nFixes #5708.\n\nUsing `# fmt: skip` inside a multiline f-string or t-string replacement field removes the trailing newline after the comment, concatenating the next token onto the `# fmt: skip` comment line and crashing with `InvalidInput`, `ASTSafetyError`, or an idempotency `AssertionError`. Standalone `# fmt: skip` lines inside `{...}` also lost their preceding newlines, altering the text preserved in debug `f\"{...=}\"` fields and PEP 750 t-strings.\n\n**Cause:**\n- Unlike regular code formatted through `LineGenerator`, f-string and t-string subtrees are serialized verbatim via `fstring_tstring_to_string()` (`str(node)`).\n- `_generate_ignored_nodes_from_fmt_skip()` sliced `leaf.prefix` at `comment.consumed`, eating the newline after `# fmt: skip` and gluing the following token (`}`, `+ c`, `=}`, `!r`, `:spec`, `# comment`) onto the comment line.\n- `_handle_regular_fmt_block()` appended `whitespace + comment.value` without `\"\\n\" * comment.newlines` when folding a standalone `# fmt: skip` line onto `hidden_value`.\n- When an outer `# fmt: skip` or `# fmt: off` enclosed an f-string/t-string whose inner `# fmt: skip` kept its newline on the next leaf, `_needs_newline_after()` and `stringify_node()` inserted a second newline (and `_remove_preceding_newline_for_comment()` stripped the newline before standalone comments on closing braces).\n\n**Fix (`src/black/comments.py`):**\n- Add `_is_in_fstring()` and extract `_next_leaf_starts_with_newline()`.\n- Keep the trailing line break on `leaf.prefix` in `_generate_ignored_nodes_from_fmt_skip()` when `_is_in_fstring(leaf)` is true.\n- Preserve `\"\\n\" * comment.newlines` before standalone `# fmt: skip` comments inside f-strings/t-strings in `_handle_regular_fmt_block()`.\n- Skip duplicate newline insertion / newline removal in `_needs_newline_after()` and `stringify_node()` when an inner `# fmt: skip` inside an f-string/t-string already kept its newline on the next leaf.\n\n**Stability policy:** Fixes crashes (`InvalidInput` / `ASTSafetyError` / `AssertionError`) and corrupted `# fmt: skip` output inside f-strings and t-strings; no style formatting change.\n\n**Verification:**\n- `black --check src/black/comments.py`: `1 file would be left unchanged`\n- `flake8` (`flake8-bugbear`, `flake8-comprehensions`, `flake8-simplify`) and `isort --check-only` on `src/black/comments.py`: clean\n- `pytest tests/test_format.py -k \"fmtskip_in_fstring or fmtskip_in_tstring\"`: failed before the fix (`InvalidInput`), `2 passed, 338 deselected` after\n- `pytest tests/`: `787 passed, 13 skipped`\n- Added regression fixtures in `tests/data/cases/fmtskip_in_fstring.py` and `tests/data/cases/fmtskip_in_tstring.py`.\n\n### Checklist - did you ...\n\n- [x] Implement any code style changes under the `--preview` style, following the stability policy?\n- [x] Add an entry in `CHANGES.md` if necessary?\n- [x] Add / update tests if necessary?\n- [x] Add new / update outdated documentation?\n",
    "closed_by": null,
    "reactions": {
      "url": "https://api.github.com/repos/psf/black/issues/5709/reactions",
      "total_count": 0,
      "+1": 0,
      "-1": 0,
      "laugh": 0,
      "hooray": 0,
      "confused": 0,
      "heart": 0,
      "rocket": 0,
      "eyes": 0
    },
    "timeline_url": "https://api.github.com/repos/psf/black/issues/5709/timeline",
    "performed_via_github_app": null,
    "state_reason": null
  },
  {
    "url": "https://api.github.com/repos/psf/black/issues/5708",
    "repository_url": "https://api.github.com/repos/psf/black",
    "labels_url": "https://api.github.com/repos/psf/black/issues/5708/labels{/name}",
    "comments_url": "https://api.github.com/repos/psf/black/issues/5708/comments",
    "events_url": "https://api.github.com/repos/psf/black/issues/5708/events",
    "html_url": "https://github.com/psf/black/issues/5708",
    "id": 6461491027,
    "node_id": "I_kwDOB3dpmM8AAAABgSKHUw",
    "number": 5708,
    "title": "# fmt: skip inside f-string and t-string replacement fields drops the following newline and produces invalid code",
    "user": {
      "login": "Cyber-Marty",
      "id": 221965144,
      "node_id": "U_kgDODTrrWA",
      "avatar_url": "https://avatars.githubusercontent.com/u/221965144?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/Cyber-Marty",
      "html_url": "https://github.com/Cyber-Marty",
      "followers_url": "https://api.github.com/users/Cyber-Marty/followers",
      "following_url": "https://api.github.com/users/Cyber-Marty/following{/other_user}",
      "gists_url": "https://api.github.com/users/Cyber-Marty/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/Cyber-Marty/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/Cyber-Marty/subscriptions",
      "organizations_url": "https://api.github.com/users/Cyber-Marty/orgs",
      "repos_url": "https://api.github.com/users/Cyber-Marty/repos",
      "events_url": "https://api.github.com/users/Cyber-Marty/events{/privacy}",
      "received_events_url": "https://api.github.com/users/Cyber-Marty/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "labels": [],
    "state": "open",
    "locked": false,
    "assignees": [],
    "milestone": null,
    "comments": 0,
    "created_at": "2026-11-18T06:34:54Z",
    "updated_at": "2026-11-18T06:34:54Z",
    "closed_at": null,
    "assignee": null,
    "author_association": "CONTRIBUTOR",
    "issue_field_values": [],
    "type": null,
    "active_lock_reason": null,
    "sub_issues_summary": {
      "total": 0,
      "completed": 0,
      "percent_completed": 0
    },
    "issue_dependencies_summary": {
      "blocked_by": 0,
      "total_blocked_by": 0,
      "blocking": 0,
      "total_blocking": 0
    },
    "body": "**Describe the bug**\n\nUsing `# fmt: skip` inside a multiline f-string or t-string replacement field drops the newline after the comment, concatenating the following token onto the `# fmt: skip` comment line and failing with `InvalidInput`, `ASTSafetyError`, or an idempotency `AssertionError`.\n\n**To Reproduce**\n\n```python\nimport black\n\nsrc = 'x = f\"{\\n    a+b  # fmt: skip\\n}\"\\n'\nblack.format_file_contents(src, fast=False, mode=black.Mode())\n```\n\n1. **Closing brace or continuation expression** crashes or silently comments out code:\n   - `x = f\"{\\n    a+b  # fmt: skip\\n}\"` -> `InvalidInput` (`x = f\"{\\n    a+b  # fmt: skip}\"`)\n   - `x = f\"{\\n    a+b  # fmt: skip\\n    + c\\n}\"` -> `ASTSafetyError` (`a+b  # fmt: skip    + c`)\n   - The same issue occurs before `=}` debug fields, `!r` / `:spec` boundaries, dynamic format specs `f\"{val:{\\n    w+1  # fmt: skip\\n}}\"`, container items inside `{...}`, subsequent comments or blank lines, CRLF line endings, and PEP 750 `t\"...\"` template strings (`--target-version py314`).\n2. **Standalone `# fmt: skip` on its own line** inside `{...}` also drops the newline between the expression and `# fmt: skip`, altering the source text kept in debug f-strings (`f\"{\\n    a+b\\n    # fmt: skip\\n    =}\"`) and t-strings (`t\"{\\n    a+b\\n    # fmt: skip\\n}\"`).\n\n**Expected behavior**\n\nBlack should preserve the newlines around `# fmt: skip` inside f-string and t-string replacement fields, keep the skipped expression and following tokens intact, and produce valid, idempotent output in both stable and preview styles.\n\n**Environment**\n\n- Black version: `main` (`c0e143e`)\n- Python version: CPython 3.13.15\n- OS: Windows\n",
    "closed_by": null,
    "reactions": {
      "url": "https://api.github.com/repos/psf/black/issues/5708/reactions",
      "total_count": 0,
      "+1": 0,
      "-1": 0,
      "laugh": 0,
      "hooray": 0,
      "confused": 0,
      "heart": 0,
      "rocket": 0,
      "eyes": 0
    },
    "timeline_url": "https://api.github.com/repos/psf/black/issues/5708/timeline",
    "performed_via_github_app": null,
    "state_reason": null,
    "pinned_comment": null
  },
  {
    "url": "https://api.github.com/repos/psf/black/issues/5707",
    "repository_url": "https://api.github.com/repos/psf/black",
    "labels_url": "https://api.github.com/repos/psf/black/issues/5707/labels{/name}",
    "comments_url": "https://api.github.com/repos/psf/black/issues/5707/comments",
    "events_url": "https://api.github.com/repos/psf/black/issues/5707/events",
    "html_url": "https://github.com/psf/black/pull/5707",
    "id": 6457443781,
    "node_id": "PR_kwDOB3dpmM8AAAABP_IulQ",
    "number": 5707,
    "title": "Stop including pip & build dependencies in Docker build",
    "user": {
      "login": "cobaltt7",
      "id": 61329810,
      "node_id": "MDQ6VXNlcjYxMzI5ODEw",
      "avatar_url": "https://avatars.githubusercontent.com/u/61329810?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/cobaltt7",
      "html_url": "https://github.com/cobaltt7",
      "followers_url": "https://api.github.com/users/cobaltt7/followers",
      "following_url": "https://api.github.com/users/cobaltt7/following{/other_user}",
      "gists_url": "https://api.github.com/users/cobaltt7/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/cobaltt7/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/cobaltt7/subscriptions",
      "organizations_url": "https://api.github.com/users/cobaltt7/orgs",
      "repos_url": "https://api.github.com/users/cobaltt7/repos",
      "events_url": "https://api.github.com/users/cobaltt7/events{/privacy}",
      "received_events_url": "https://api.github.com/users/cobaltt7/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "labels": [],
    "state": "closed",
    "locked": false,
    "assignees": [],
    "milestone": null,
    "comments": 0,
    "created_at": "2026-11-18T00:54:57Z",
    "updated_at": "2026-11-19T21:35:09Z",
    "closed_at": "2026-11-19T21:35:07Z",
    "assignee": null,
    "author_association": "COLLABORATOR",
    "issue_field_values": [],
    "type": null,
    "active_lock_reason": null,
    "draft": false,
    "pull_request": {
      "url": "https://api.github.com/repos/psf/black/pulls/5707",
      "html_url": "https://github.com/psf/black/pull/5707",
      "diff_url": "https://github.com/psf/black/pull/5707.diff",
      "patch_url": "https://github.com/psf/black/pull/5707.patch",
      "merged_at": "2026-11-19T21:35:07Z"
    },
    "body": "<!-- Hello! Thanks for submitting a PR. To help make things go a bit smoother\n     we would appreciate that you go through this template. -->\n\n### Description\n\n<!-- Good things to put here include: reasoning for the change (please link\n     any relevant issues!), any noteworthy (or hacky) choices to be aware of,\n     or what the problem resolved here looked like ... we won't mind a ranty\n     story :) -->\n\nAlmost halves image size\n\n<img width=\"1714\" height=\"321\" alt=\"image\" src=\"https://github.com/user-attachments/assets/d3252344-da33-41b3-851c-1ad3fe8684f0\" />\n\nFYI this branch was published to Docker Hub as `cobaltt7/test`\n\n### Checklist - did you ...\n\n<!-- If any of the following items aren't relevant for your contribution,\n     please still tick them so we know you've gone through the checklist.\n\n     - Please familiarize yourself with Black's stability policy, linked\n       below. Code style changes are only allowed under the `--preview` flag\n       until maintainers move them to stable in the next calendar year.\n     - All user-facing changes should get a changelog entry. If this isn't\n       user-facing, signal to us that this should get the magical label to\n       silence the check.\n     - Tests are required for all bugfixes and new features.\n     - Documentation changes are necessary for most formatting changes and\n       other enhancements. -->\n\n- [-] Implement any code style changes under the `--preview` style, following the stability policy?\n- [y] Add an entry in `CHANGES.md` if necessary?\n- [-] Add / update tests if necessary?\n- [-] Add new / update outdated documentation?\n\n<!-- Just as a reminder, everyone in all psf/black spaces, including PRs, must\n     follow the PSF Code of Conduct (link below).\n\n     Finally, thanks once again for your time and effort. If you have any\n     feedback regarding your experience contributing here, please let us know!\n\n     Helpful links:\n\n     - PSF COC: https://www.python.org/psf/conduct/\n     - Contributing docs: https://black.readthedocs.io/en/latest/contributing/index.html\n     - Chat on Python Discord: https://discord.gg/RtVdv86PrH\n     - Stability policy: https://black.readthedocs.io/en/stable/the_black_code_style/index.html -->\n",
    "closed_by": {
      "login": "cobaltt7",
      "id": 61329810,
      "node_id": "MDQ6VXNlcjYxMzI5ODEw",
      "avatar_url": "https://avatars.githubusercontent.com/u/61329810?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/cobaltt7",
      "html_url": "https://github.com/cobaltt7",
      "followers_url": "https://api.github.com/users/cobaltt7/followers",
      "following_url": "https://api.github.com/users/cobaltt7/following{/other_user}",
      "gists_url": "https://api.github.com/users/cobaltt7/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/cobaltt7/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/cobaltt7/subscriptions",
      "organizations_url": "https://api.github.com/users/cobaltt7/orgs",
      "repos_url": "https://api.github.com/users/cobaltt7/repos",
      "events_url": "https://api.github.com/users/cobaltt7/events{/privacy}",
      "received_events_url": "https://api.github.com/users/cobaltt7/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "reactions": {
      "url": "https://api.github.com/repos/psf/black/issues/5707/reactions",
      "total_count": 0,
      "+1": 0,
      "-1": 0,
      "laugh": 0,
      "hooray": 0,
      "confused": 0,
      "heart": 0,
      "rocket": 0,
      "eyes": 0
    },
    "timeline_url": "https://api.github.com/repos/psf/black/issues/5707/timeline",
    "performed_via_github_app": null,
    "state_reason": null
  },
  {
    "url": "https://api.github.com/repos/psf/black/issues/5706",
    "repository_url": "https://api.github.com/repos/psf/black",
    "labels_url": "https://api.github.com/repos/psf/black/issues/5706/labels{/name}",
    "comments_url": "https://api.github.com/repos/psf/black/issues/5706/comments",
    "events_url": "https://api.github.com/repos/psf/black/issues/5706/events",
    "html_url": "https://github.com/psf/black/pull/5706",
    "id": 6457049689,
    "node_id": "PR_kwDOB3dpmM8AAAABP-0jww",
    "number": 5706,
    "title": "Cleanup integrations docs",
    "user": {
      "login": "cobaltt7",
      "id": 61329810,
      "node_id": "MDQ6VXNlcjYxMzI5ODEw",
      "avatar_url": "https://avatars.githubusercontent.com/u/61329810?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/cobaltt7",
      "html_url": "https://github.com/cobaltt7",
      "followers_url": "https://api.github.com/users/cobaltt7/followers",
      "following_url": "https://api.github.com/users/cobaltt7/following{/other_user}",
      "gists_url": "https://api.github.com/users/cobaltt7/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/cobaltt7/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/cobaltt7/subscriptions",
      "organizations_url": "https://api.github.com/users/cobaltt7/orgs",
      "repos_url": "https://api.github.com/users/cobaltt7/repos",
      "events_url": "https://api.github.com/users/cobaltt7/events{/privacy}",
      "received_events_url": "https://api.github.com/users/cobaltt7/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "labels": [
      {
        "id": 2843125410,
        "node_id": "MDU6TGFiZWwyODQzMTI1NDEw",
        "url": "https://api.github.com/repos/psf/black/labels/ci:%20skip%20news",
        "name": "ci: skip news",
        "color": "000000",
        "default": false,
        "description": "Pull requests that don't need a changelog entry.",
        "archived_at": null,
        "archived_by": null
      }
    ],
    "state": "closed",
    "locked": false,
    "assignees": [],
    "milestone": null,
    "comments": 0,
    "created_at": "2026-11-18T00:23:38Z",
    "updated_at": "2026-11-19T21:34:57Z",
    "closed_at": "2026-11-19T21:34:55Z",
    "assignee": null,
    "author_association": "COLLABORATOR",
    "issue_field_values": [],
    "type": null,
    "active_lock_reason": null,
    "draft": false,
    "pull_request": {
      "url": "https://api.github.com/repos/psf/black/pulls/5706",
      "html_url": "https://github.com/psf/black/pull/5706",
      "diff_url": "https://github.com/psf/black/pull/5706.diff",
      "patch_url": "https://github.com/psf/black/pull/5706.patch",
      "merged_at": "2026-11-19T21:34:55Z"
    },
    "body": "<!-- Hello! Thanks for submitting a PR. To help make things go a bit smoother\n     we would appreciate that you go through this template. -->\n\n### Description\n\n- **Remove compatible configs - the docs are enough**\n- **Correct the docstring formatting docs**\n- **Mention immutibility in gha docs**\n- **Update vsc docs**\n\n### Checklist - did you ...\n\n<!-- If any of the following items aren't relevant for your contribution,\n     please still tick them so we know you've gone through the checklist.\n\n     - Please familiarize yourself with Black's stability policy, linked\n       below. Code style changes are only allowed under the `--preview` flag\n       until maintainers move them to stable in the next calendar year.\n     - All user-facing changes should get a changelog entry. If this isn't\n       user-facing, signal to us that this should get the magical label to\n       silence the check.\n     - Tests are required for all bugfixes and new features.\n     - Documentation changes are necessary for most formatting changes and\n       other enhancements. -->\n\n- [-] Implement any code style changes under the `--preview` style, following the stability policy?\n- [-] Add an entry in `CHANGES.md` if necessary?\n- [-] Add / update tests if necessary?\n- [y] Add new / update outdated documentation?\n\n<!-- Just as a reminder, everyone in all psf/black spaces, including PRs, must\n     follow the PSF Code of Conduct (link below).\n\n     Finally, thanks once again for your time and effort. If you have any\n     feedback regarding your experience contributing here, please let us know!\n\n     Helpful links:\n\n     - PSF COC: https://www.python.org/psf/conduct/\n     - Contributing docs: https://black.readthedocs.io/en/latest/contributing/index.html\n     - Chat on Python Discord: https://discord.gg/RtVdv86PrH\n     - Stability policy: https://black.readthedocs.io/en/stable/the_black_code_style/index.html -->\n",
    "closed_by": {
      "login": "cobaltt7",
      "id": 61329810,
      "node_id": "MDQ6VXNlcjYxMzI5ODEw",
      "avatar_url": "https://avatars.githubusercontent.com/u/61329810?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/cobaltt7",
      "html_url": "https://github.com/cobaltt7",
      "followers_url": "https://api.github.com/users/cobaltt7/followers",
      "following_url": "https://api.github.com/users/cobaltt7/following{/other_user}",
      "gists_url": "https://api.github.com/users/cobaltt7/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/cobaltt7/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/cobaltt7/subscriptions",
      "organizations_url": "https://api.github.com/users/cobaltt7/orgs",
      "repos_url": "https://api.github.com/users/cobaltt7/repos",
      "events_url": "https://api.github.com/users/cobaltt7/events{/privacy}",
      "received_events_url": "https://api.github.com/users/cobaltt7/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "reactions": {
      "url": "https://api.github.com/repos/psf/black/issues/5706/reactions",
      "total_count": 0,
      "+1": 0,
      "-1": 0,
      "laugh": 0,
      "hooray": 0,
      "confused": 0,
      "heart": 0,
      "rocket": 0,
      "eyes": 0
    },
    "timeline_url": "https://api.github.com/repos/psf/black/issues/5706/timeline",
    "performed_via_github_app": null,
    "state_reason": null
  },
  {
    "url": "https://api.github.com/repos/psf/black/issues/5705",
    "repository_url": "https://api.github.com/repos/psf/black",
    "labels_url": "https://api.github.com/repos/psf/black/issues/5705/labels{/name}",
    "comments_url": "https://api.github.com/repos/psf/black/issues/5705/comments",
    "events_url": "https://api.github.com/repos/psf/black/issues/5705/events",
    "html_url": "https://github.com/psf/black/pull/5705",
    "id": 6452292377,
    "node_id": "PR_kwDOB3dpmM8AAAABP6-GzQ",
    "number": 5705,
    "title": "Keep trailing comments on the string line when only the comment is too long in string_processing",
    "user": {
      "login": "cleoanka",
      "id": 115870061,
      "node_id": "U_kgDOBugJbQ",
      "avatar_url": "https://avatars.githubusercontent.com/u/115870061?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/cleoanka",
      "html_url": "https://github.com/cleoanka",
      "followers_url": "https://api.github.com/users/cleoanka/followers",
      "following_url": "https://api.github.com/users/cleoanka/following{/other_user}",
      "gists_url": "https://api.github.com/users/cleoanka/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/cleoanka/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/cleoanka/subscriptions",
      "organizations_url": "https://api.github.com/users/cleoanka/orgs",
      "repos_url": "https://api.github.com/users/cleoanka/repos",
      "events_url": "https://api.github.com/users/cleoanka/events{/privacy}",
      "received_events_url": "https://api.github.com/users/cleoanka/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "labels": [],
    "state": "open",
    "locked": false,
    "assignees": [],
    "milestone": null,
    "comments": 1,
    "created_at": "2026-11-17T19:20:25Z",
    "updated_at": "2026-11-17T22:04:26Z",
    "closed_at": null,
    "assignee": null,
    "author_association": "NONE",
    "issue_field_values": [],
    "type": null,
    "active_lock_reason": null,
    "draft": false,
    "pull_request": {
      "url": "https://api.github.com/repos/psf/black/pulls/5705",
      "html_url": "https://github.com/psf/black/pull/5705",
      "diff_url": "https://github.com/psf/black/pull/5705.diff",
      "patch_url": "https://github.com/psf/black/pull/5705.patch",
      "merged_at": null
    },
    "body": "<!-- Hello! Thanks for submitting a PR. To help make things go a bit smoother\n     we would appreciate that you go through this template. -->\n\n### Description\n\nWith the unstable `string_processing` feature, a line whose string fits but whose trailing comment pushes it over the limit gets wrapped by `StringParenWrapper`, and the comment moves to the opening parenthesis:\n\n```python\n        return (  # pyright: ignore[reportGeneralTypeIssues] -- This is some special Django magic ...\n            \"foo bar baz qux\"\n        )\n```\n\nThe pragma no longer sits on the line of the expression it is meant to silence, and writing the comment next to the string inside the parentheses gets moved back up as well, so there is no place left for it. Without `string_processing`, `--preview` keeps `return \"foo bar baz qux\"  # pyright: ...` on one line.\n\nThe wrap happens because the length check in `BaseStringSplitter._validate` subtracts the trailing comment from the room available to the string, so a long comment makes any string look responsible for the overflow. This PR adds a check in `StringParenWrapper.do_splitter_match`: if the line has comments and fits within the line length once its comments are left out, the wrapper does not match. The comment-free line is built the same way as in `Line.__str__` and measured with `str_width`. Lines where the string itself is too long are wrapped and split exactly as before. The rule applies to any trailing comment rather than only to `# pyright:`, since moving any trailing comment away from its string is the problem here; a narrower alternative would be to add `pyright:` to `contains_pragma_comment`.\n\nOne existing expectation changes: the first #3756 regression case in `preview_comments7.py` (a parenthesized string with a trailing comment in a list) used to have its comment moved to the `(` line and now becomes `\"aaa...\",  # aaa...`. That old output is the same behaviour reported here. The new output is stable (the test harness checks a second pass), and the second #3756 case (comments on both `(` and the string) is unchanged.\n\nCloses #3802\n\nTests:\n\n- New case `tests/data/cases/preview_long_strings__trailing_comment.py` (`# flags: --unstable`): the issue example, the parenthesized variant from the issue, and a plain assignment. The expected output equals what `--preview` without `string_processing` produces for the same input.\n- With the `trans.py` change reverted, the new case and `preview_comments7` both fail with the comment moved to the `(` line; with the change they pass.\n- `python -m pytest -n auto tests`: 791 passed, 6 skipped (Python 3.15.2, macOS).\n- `python -m black --check src tests`: 59 files would be left unchanged.\n- `tox` and `pre-commit run -a` were not run.\n\nThe PR number in the `CHANGES.md` entry is an estimate and will be corrected if it does not match.\n\n### Checklist - did you ...\n\n<!-- If any of the following items aren't relevant for your contribution,\n     please still tick them so we know you've gone through the checklist.\n\n     - Please familiarize yourself with Black's stability policy, linked\n       below. Code style changes are only allowed under the `--preview` flag\n       until maintainers move them to stable in the next calendar year.\n     - All user-facing changes should get a changelog entry. If this isn't\n       user-facing, signal to us that this should get the magical label to\n       silence the check.\n     - Tests are required for all bugfixes and new features.\n     - Documentation changes are necessary for most formatting changes and\n       other enhancements. -->\n\n- [x] Implement any code style changes under the `--preview` style, following the stability policy?\n- [x] Add an entry in `CHANGES.md` if necessary?\n- [x] Add / update tests if necessary?\n- [x] Add new / update outdated documentation?\n\n<!-- Just as a reminder, everyone in all psf/black spaces, including PRs, must\n     follow the PSF Code of Conduct (link below).\n\n     Finally, thanks once again for your time and effort. If you have any\n     feedback regarding your experience contributing here, please let us know!\n\n     Helpful links:\n\n     - PSF COC: https://www.python.org/psf/conduct/\n     - Contributing docs: https://black.readthedocs.io/en/latest/contributing/index.html\n     - Chat on Python Discord: https://discord.gg/RtVdv86PrH\n     - Stability policy: https://black.readthedocs.io/en/stable/the_black_code_style/index.html -->\n\nAI disclosure: this pull request was prepared and opened by an AI coding agent (Claude Code) on behalf of the account owner. The agent wrote the change and ran the checks listed above; no human has reviewed or manually tested it yet. Follow-up commits may also come from the agent; replies posted here are approved by the account owner before they are sent.\n",
    "closed_by": null,
    "reactions": {
      "url": "https://api.github.com/repos/psf/black/issues/5705/reactions",
      "total_count": 0,
      "+1": 0,
      "-1": 0,
      "laugh": 0,
      "hooray": 0,
      "confused": 0,
      "heart": 0,
      "rocket": 0,
      "eyes": 0
    },
    "timeline_url": "https://api.github.com/repos/psf/black/issues/5705/timeline",
    "performed_via_github_app": null,
    "state_reason": null
  },
  {
    "url": "https://api.github.com/repos/psf/black/issues/5704",
    "repository_url": "https://api.github.com/repos/psf/black",
    "labels_url": "https://api.github.com/repos/psf/black/issues/5704/labels{/name}",
    "comments_url": "https://api.github.com/repos/psf/black/issues/5704/comments",
    "events_url": "https://api.github.com/repos/psf/black/issues/5704/events",
    "html_url": "https://github.com/psf/black/pull/5704",
    "id": 6444616874,
    "node_id": "PR_kwDOB3dpmM8AAAABP0udcw",
    "number": 5704,
    "title": "Fix --line-ranges offset when --skip-source-first-line is enabled (#5691)",
    "user": {
      "login": "bigwalkdoe",
      "id": 132009230,
      "node_id": "U_kgDOB95NDg",
      "avatar_url": "https://avatars.githubusercontent.com/u/132009230?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/bigwalkdoe",
      "html_url": "https://github.com/bigwalkdoe",
      "followers_url": "https://api.github.com/users/bigwalkdoe/followers",
      "following_url": "https://api.github.com/users/bigwalkdoe/following{/other_user}",
      "gists_url": "https://api.github.com/users/bigwalkdoe/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/bigwalkdoe/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/bigwalkdoe/subscriptions",
      "organizations_url": "https://api.github.com/users/bigwalkdoe/orgs",
      "repos_url": "https://api.github.com/users/bigwalkdoe/repos",
      "events_url": "https://api.github.com/users/bigwalkdoe/events{/privacy}",
      "received_events_url": "https://api.github.com/users/bigwalkdoe/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "labels": [
      {
        "id": 9517371327,
        "node_id": "LA_kwDOB3dpmM8AAAACN0ePvw",
        "url": "https://api.github.com/repos/psf/black/labels/spam%20/%20ai",
        "name": "spam / ai",
        "color": "B60205",
        "default": false,
        "description": "",
        "archived_at": null,
        "archived_by": null
      }
    ],
    "state": "closed",
    "locked": false,
    "assignees": [],
    "milestone": null,
    "comments": 2,
    "created_at": "2026-11-17T12:33:30Z",
    "updated_at": "2026-11-17T21:36:36Z",
    "closed_at": "2026-11-17T21:36:32Z",
    "assignee": null,
    "author_association": "NONE",
    "issue_field_values": [],
    "type": null,
    "active_lock_reason": null,
    "draft": false,
    "pull_request": {
      "url": "https://api.github.com/repos/psf/black/pulls/5704",
      "html_url": "https://github.com/psf/black/pull/5704",
      "diff_url": "https://github.com/psf/black/pull/5704.diff",
      "patch_url": "https://github.com/psf/black/pull/5704.patch",
      "merged_at": null
    },
    "body": "### Description\n\nFixes #5691.\n\nWhen `--skip-source-first-line` is enabled, the first source line is removed before formatting and re-prepended afterward, but `--line-ranges` were applied against the shortened source without adjustment. This caused ranges to select the wrong original lines (off-by-one), including:\n- `--line-ranges=2-2` formatting line 3 instead of line 2\n- `--line-ranges=1-1` formatting line 2 instead of leaving the skipped header unchanged\n- selecting the final line being dropped after the source length shrank by one\n\nThis PR adds `adjust_lines_for_skipped_first_line()` in `black.ranges` and applies it in both `format_file_in_place()` and `format_stdin_to_stdout()` when `skip_source_first_line` is enabled and line ranges are provided:\n- shifts each `(start, end)` range down by 1 as `(max(1, start - 1), end - 1)` when `end >= 2`\n- drops ranges that select only the skipped header (`end < 2`)\n- returns `[(0, 0)]` when all requested ranges fall entirely on the skipped header so formatting treats it as \"specific ranges requested but none matched\" (avoids full-file reformat / raises `NothingChanged`)\n\n**Note:** This addresses the same issue as #5692.\n\n### Checklist\n\n- [x] Add an entry in `CHANGES.md` if necessary?\n- [x] Add / update tests if necessary? (unit tests in `tests/test_ranges.py`, integration tests in `tests/test_black.py`)\n\n### Verification\n\n- `PYTHONPATH=src python3 -m pytest tests/test_ranges.py -q` → 48 passed\n- `PYTHONPATH=src python3 -m pytest -q tests/test_black.py -k \"skip_source_first_line\"` → 7 passed, 228 deselected\n- Manual repro: `-x --line-ranges=2-2` now formats original line 2 only while preserving the skipped header.",
    "closed_by": {
      "login": "cobaltt7",
      "id": 61329810,
      "node_id": "MDQ6VXNlcjYxMzI5ODEw",
      "avatar_url": "https://avatars.githubusercontent.com/u/61329810?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/cobaltt7",
      "html_url": "https://github.com/cobaltt7",
      "followers_url": "https://api.github.com/users/cobaltt7/followers",
      "following_url": "https://api.github.com/users/cobaltt7/following{/other_user}",
      "gists_url": "https://api.github.com/users/cobaltt7/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/cobaltt7/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/cobaltt7/subscriptions",
      "organizations_url": "https://api.github.com/users/cobaltt7/orgs",
      "repos_url": "https://api.github.com/users/cobaltt7/repos",
      "events_url": "https://api.github.com/users/cobaltt7/events{/privacy}",
      "received_events_url": "https://api.github.com/users/cobaltt7/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "reactions": {
      "url": "https://api.github.com/repos/psf/black/issues/5704/reactions",
      "total_count": 0,
      "+1": 0,
      "-1": 0,
      "laugh": 0,
      "hooray": 0,
      "confused": 0,
      "heart": 0,
      "rocket": 0,
      "eyes": 0
    },
    "timeline_url": "https://api.github.com/repos/psf/black/issues/5704/timeline",
    "performed_via_github_app": null,
    "state_reason": null
  },
  {
    "url": "https://api.github.com/repos/psf/black/issues/5703",
    "repository_url": "https://api.github.com/repos/psf/black",
    "labels_url": "https://api.github.com/repos/psf/black/issues/5703/labels{/name}",
    "comments_url": "https://api.github.com/repos/psf/black/issues/5703/comments",
    "events_url": "https://api.github.com/repos/psf/black/issues/5703/events",
    "html_url": "https://github.com/psf/black/pull/5703",
    "id": 6440717753,
    "node_id": "PR_kwDOB3dpmM8AAAABPxkFoA",
    "number": 5703,
    "title": "Fix --line-ranges inserting blank lines in async statements with # fmt: skip headers",
    "user": {
      "login": "Cyber-Marty",
      "id": 221965144,
      "node_id": "U_kgDODTrrWA",
      "avatar_url": "https://avatars.githubusercontent.com/u/221965144?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/Cyber-Marty",
      "html_url": "https://github.com/Cyber-Marty",
      "followers_url": "https://api.github.com/users/Cyber-Marty/followers",
      "following_url": "https://api.github.com/users/Cyber-Marty/following{/other_user}",
      "gists_url": "https://api.github.com/users/Cyber-Marty/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/Cyber-Marty/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/Cyber-Marty/subscriptions",
      "organizations_url": "https://api.github.com/users/Cyber-Marty/orgs",
      "repos_url": "https://api.github.com/users/Cyber-Marty/repos",
      "events_url": "https://api.github.com/users/Cyber-Marty/events{/privacy}",
      "received_events_url": "https://api.github.com/users/Cyber-Marty/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "labels": [],
    "state": "closed",
    "locked": false,
    "assignees": [],
    "milestone": null,
    "comments": 2,
    "created_at": "2026-11-17T08:41:05Z",
    "updated_at": "2026-11-17T21:59:22Z",
    "closed_at": "2026-11-17T21:59:17Z",
    "assignee": null,
    "author_association": "CONTRIBUTOR",
    "issue_field_values": [],
    "type": null,
    "active_lock_reason": null,
    "draft": false,
    "pull_request": {
      "url": "https://api.github.com/repos/psf/black/pulls/5703",
      "html_url": "https://github.com/psf/black/pull/5703",
      "diff_url": "https://github.com/psf/black/pull/5703.diff",
      "patch_url": "https://github.com/psf/black/pull/5703.patch",
      "merged_at": "2026-11-17T21:59:17Z"
    },
    "body": "### Description\n\nFixes #5702.\n\nWhen a top-level `async def`, `async with`, or `async for` statement has `# fmt: skip` on its header and `--line-ranges` formats code without intersecting that statement's body, Black inserts two blank lines between the header and the body (and adds two more on each subsequent run when the selected range is before the statement).\n\n**Cause:** `_TopLevelStatementsVisitor.visit_suite` checked `semantic_parent.prev_sibling.type == ASYNC` to climb from `funcdef` / `with_stmt` / `for_stmt` up to `async_stmt` / `async_funcdef`. Because `normalize_fmt_off` has already folded `ASYNC` and the header tokens into a `STANDALONE_COMMENT` leaf inside `async_stmt` / `async_funcdef`, `semantic_parent.prev_sibling` is no longer `ASYNC`, leaving `funcdef` (containing only `suite` starting with `NEWLINE`) to be converted into a separate `STANDALONE_COMMENT`.\n\n**Fix:** Check `semantic_parent.parent.type in {syms.async_stmt, syms.async_funcdef}` so `_TopLevelStatementsVisitor.visit_suite` always climbs to the enclosing async statement node even after header `# fmt: skip` folding.\n\n**Stability policy:** This fixes corruption and non-idempotency on `# fmt: skip` statements under `--line-ranges`; it does not change formatting style.\n\n**Verification:**\n- `black --check src/black/ranges.py`: clean\n- `pytest tests/ -k \"not blackd\" -q`: 741 passed, 13 skipped, 44 deselected, 32 subtests passed\n- `pytest tests/test_blackd.py -q`: 44 passed, 30 subtests passed\n- Added regression cases in `tests/data/cases/line_ranges_fmt_skip_async.py` and `tests/data/line_ranges_formatted/fmt_skip_async.py`.\n\n### Checklist - did you ...\n\n- [x] Implement any code style changes under the `--preview` style, following the stability policy?\n- [x] Add an entry in `CHANGES.md` if necessary?\n- [x] Add / update tests if necessary?\n- [x] Add new / update outdated documentation?\n",
    "closed_by": {
      "login": "cobaltt7",
      "id": 61329810,
      "node_id": "MDQ6VXNlcjYxMzI5ODEw",
      "avatar_url": "https://avatars.githubusercontent.com/u/61329810?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/cobaltt7",
      "html_url": "https://github.com/cobaltt7",
      "followers_url": "https://api.github.com/users/cobaltt7/followers",
      "following_url": "https://api.github.com/users/cobaltt7/following{/other_user}",
      "gists_url": "https://api.github.com/users/cobaltt7/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/cobaltt7/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/cobaltt7/subscriptions",
      "organizations_url": "https://api.github.com/users/cobaltt7/orgs",
      "repos_url": "https://api.github.com/users/cobaltt7/repos",
      "events_url": "https://api.github.com/users/cobaltt7/events{/privacy}",
      "received_events_url": "https://api.github.com/users/cobaltt7/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "reactions": {
      "url": "https://api.github.com/repos/psf/black/issues/5703/reactions",
      "total_count": 0,
      "+1": 0,
      "-1": 0,
      "laugh": 0,
      "hooray": 0,
      "confused": 0,
      "heart": 0,
      "rocket": 0,
      "eyes": 0
    },
    "timeline_url": "https://api.github.com/repos/psf/black/issues/5703/timeline",
    "performed_via_github_app": null,
    "state_reason": null
  }
]