Skip to content

Add pre-commit destroyed-symlinks as builtin hook #1848

@janosh

Description

@janosh

destroyed-symlinks detects symlinks that were converted to regular files containing the target path (common when checking out a repo on Windows without symlink support, or after a bad merge). It should check if a file's content looks like a symlink target (single line, no newline, points to an existing path or looks like a relative path) and alert the user.

repos:
  - repo: builtin
    hooks:
      - id: destroyed-symlinks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions