Skip to content

Shebang #!/usr/bin/env -S uv run bash incorrectly detected as python #512

Closed

Description

@mattmess1221

I have a bash script scripts/test which is incorrectly detected as python by tags_from_path. It uses uv to run inside a virtualenv and automatically install dependencies. It is not a python script.

#!/usr/bin/env -S uv run --group test bash
# shellcheck shell=bash
set -euo pipefail
set -x

coverage run -m pytest "$@"
coverage report || true
coverage xml || true

This is causing pre-commit to run hooks for python.

Workaround is to rename the script to end in .sh

Activity

  1. warsawnv commented on Jan 20, 2026

    @warsawnv

    Was this reverted because it won't/can't be fixed?

  2. asottile commented on Jan 20, 2026

    @asottile
    Member

    click on the linked issues and find out!

  3. locked as off topic and limited conversation to collaborators on Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions