Skip to content

pre-commit hangs on Windows with parallel: true #1256

@CuriousStork

Description

@CuriousStork

Description

When parallel: true is set, pre-commit hangs:

Image
  • The hanged job output is interrupted. Please note, that the hanged job varies from run to run. For me sometimes it was Vale, sometimes Prettier.

  • CTRL + C doesn't help.

  • The terminal processes consume CPU continuously:

    Image

    Only killing via the task manager helps.

Sometimes all jobs seem to pass (or the terminal isn't stuck), but the output isn't full. For example, some jobs and Lefthook summary are missing. Maybe it's another issue, like #1047

Windows 10, Windows Terminal: 1.23.13503.0, PowerShell: 7.5.4.

The issue isn't reproduced when parallel is disabled.

.lefthook.yaml

assert_lefthook_installed: true
min_version: 2.0.12

pre-commit:
  parallel: true
  jobs:
    - name: "🔍Lint:"
      group:
        jobs:
          - name: markdownlint
            run: npx markdownlint-cli2 "{staged_files}" 2>&1
            glob:
              - "*.md"
          - name: Prettier
            run: npx prettier --list-different "{staged_files}"
            glob:
              - "*.md"
    - name: "💄Style:"
      group:
        jobs:
          - name: Vale
            run: vale --output=line "{staged_files}"
            glob:
              - "*.md"

Commands to reproduce

npx lefthook run pre-commit

Lefthook version

2.0.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    WindowsWindows casebugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions