Skip to content

Promote Develop: Read a uv run Shebang as Python in the Prose Gate - #3678

Merged
ptr727 merged 1 commit into
mainfrom
develop
Oct 30, 2026
Merged

ptr727 merged 1 commit into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Promotes the changes merged into develop since promotion #3675 to main.

  • #3676 Reads a uv run shebang as Python in the prose gate. A new files.runner map in the gate's data names the interpreter a runner runs, so an extensionless uv run --script file gets the Python reading, the PEP 723 metadata block exemption among it.

Closes #3673

🤖 Generated with Claude Code

## Summary

Fixes #3673. The prose gate picks an extensionless file's lexer from the
program its shebang names. `#!/usr/bin/env -S uv run --script` names
`uv`, which Pygments has no lexer for. So the file fell back to `bash`
and missed every Python reading, including the PEP 723 metadata block
exemption from #3634.

- `prose-gate.json` gains `files.runner`, which maps a runner program to
the interpreter it runs: `{ "uv": "python" }`.
- `lexer_name` looks up the shebang's program in that map before it asks
Pygments.
- Tests: four `uv` shebang forms select `python`, with and without `-S`
and `--script`. An extensionless `tool` holding a PEP 723 block reports
no `comment-added`. The file-mapping test now also checks that each
`runner` value names a declared language.

Both new tests fail when the lookup is removed. The 644 prose-lint tests
pass, and so do ruff, mypy, the prose gate, and the eol gate.

## Local review

Two `local-strict-review` passes ran at the `frontier` tier. The first
raised one `introduced` finding: the mapping test did not cover the new
map. That was fixed in 5ac8f52. The second pass over the full diff
raised nothing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 30, 2026 21:58
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the uv shebang-to-Python mapping and its associated lexer and metadata-block handling changes.

No open issues 🎉

What changed in this PR

This pull request promotes the prose-gate fix that recognizes extensionless Python scripts launched through uv run, enabling Python-specific handling such as PEP 723 metadata-block exemptions.

Changes:

  • Adds a uv runner-to-python mapping to the prose-gate configuration.
  • Resolves configured runners before selecting the Pygments lexer from a shebang.
  • Adds regression coverage for supported uv shebang forms and metadata blocks.
File Description
tests/​test_prose_lint.py Tests uv shebang resolution, metadata-block handling, and runner mapping validation.
.github/​actions/​prose-gate/​prose-gate.json Declares that uv runs Python files.
.github/​actions/​prose-gate/​prose_lint.py Applies runner mappings during shebang-based lexer selection.

Review effort: Lite

@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.72%. Comparing base (e8ea7b1) to head (90813a0).
⚠️ Report is 450 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3678   +/-   ##
=======================================
  Coverage   81.72%   81.72%           
=======================================
  Files          27       27           
  Lines        9128     9128           
=======================================
  Hits         7460     7460           
  Misses       1668     1668           
Flag Coverage Δ
python-3.13 81.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727
ptr727 merged commit b19bf38 into main Oct 30, 2026
14 checks passed
ptr727 added a commit that referenced this pull request Oct 31, 2026
…on an Attested Head (#3681)

Promotes the changes merged into `develop` since promotion #3678 to
`main`.

- [#3680](#3680) Ends
`pr_review.py wait`'s held poll on an attested head when an unresolved
review thread is open, with a new exit `46` and a
`status=THREADS_UNRESOLVED` line naming the threads' authors. The poll's
read now carries each thread's state and author, and a thread read cut
at 100 is walked to its end first.
- [#3682](#3682) Walks a
cut thread page once per poll read, keeping the answer on the payload it
judged, which answers this promotion's first Copilot round.

Closes #3671

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

Read a uv run Shebang as Python in the Prose Gate

2 participants