You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Read a uv run Shebang as Python in the Prose Gate #3673
The prose gate picks an extensionless file's lexer from its shebang, taking the program env runs. The shebang uv documents for a standalone script is #!/usr/bin/env -S uv run --script, and that names uv, which Pygments has no lexer for. The file then falls back to the extensionless lexer, bash, and is read with the hash language data rather than the python data.
A constructed case, saved as an extensionless file named tool:
comment-added reports lines 2 and 3 there, since the hash data declares no metadata_block. The same text saved as tool.py reports nothing. Every other Python-only reading misses that file as well, its docstrings and trailing directives among them.
lexer_name in .github/actions/prose-gate/prose_lint.py makes the choice. Its shebang branch skips env's options, -S included, and looks up the program after them, which is uv rather than the interpreter uv runs.
Done Means
A shebang running a Python script through uv run, with or without -S and --script, selects the Python lexer.
A test reads that extensionless file with the PEP 723 block above and reports no comment-added finding.
Found by the local review of the #3634 fix, and left out of that change since the lexer choice predates it.
Activity
Exempt a PEP 723 Script Metadata Block From the Comment Rules (#3674)
Read a uv run Shebang as Python in the Prose Gate (#3676)
Promote Develop: Read a uv run Shebang as Python in the Prose Gate (#…