Skip to content

id with colon is not matched by selector #1781

@my1e5

Description

@my1e5

Summary

Example:

# prek.toml

[[repos]]
repo = "local"
hooks = [
  {
    id = "lint:ruff",
    name = "Check Python files",
    language = "system",
    entry = "ruff check",
    types = ["python"],
  },
]
$ prek run lint:ruff
warning: selector `lint:ruff` did not match any hooks
error: No hooks found after filtering with the given selectors

hint: If you just added a new `prek.toml` or `.pre-commit-config.yaml`, try rerunning your command with the `--refresh` flag to rescan the workspace.

But if I take away the colon it works.

Willing to submit a PR?

  • Yes — I’m willing to open a PR to fix this.

Platform

Windows 11

Version

prek 0.3.4 (04b1308 2026-02-28)

.pre-commit-config.yaml

Log file


Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions