lefthook icon indicating copy to clipboard operation
lefthook copied to clipboard

"Unable to expand glob patterns"

Open ivancuric opened this issue 5 years ago • 4 comments

lefthook.yml:

pre-commit:
  parallel: true
  commands:
    typecheck:
      run: 'npx tsc -p .'
    react-templates:
      glob: '*.{jsx,tsx}'
      run: >
        npx eslint {staged_files} --fix &&
        npx prettier {staged_files} --write &&
        git add {staged_files}
    scripts:
      glob: '*.{js,ts}'
      exclude: '.eslintrc.js'
      run: >
        npx eslint {staged_files} --fix &&
        npx prettier {staged_files} --write &&
        git add {staged_files}
    css:
      glob: '*.{css,scss}'
      run: >
        npx prettier {staged_files} --write &&
        npx stylelint {staged_files} --fix &&
        git add {staged_files}
    other:
      glob: '*.{html,md,yml}'
      run: >
        npx prettier {staged_files} --write &&
        git add {staged_files}

This is the error output:

RUNNING HOOKS GROUP: pre-commit

  EXECUTE > css
(SKIP. NO FILES FOR INSPECTING)

  EXECUTE > other
[error] Unable to expand glob patterns:  !**/node_modules/** !./node_modules/** !**/.{git,svn,hg}/** !./.{git,svn,hg}/**
[error] must provide pattern
lefthook.yml 79ms

  EXECUTE > scripts
(SKIP. NO FILES FOR INSPECTING)

  EXECUTE > react-templates
(SKIP. NO FILES FOR INSPECTING)

  EXECUTE > typecheck
[error] Unable to expand glob patterns:  !**/node_modules/** !./node_modules/** !**/.{git,svn,hg}/** !./.{git,svn,hg}/**
[error] must provide pattern
[error] Unable to expand glob patterns:  !**/node_modules/** !./node_modules/** !**/.{git,svn,hg}/** !./.{git,svn,hg}/**
[error] must provide pattern

SUMMARY: (done in 13.20 seconds)
✔️  other
✔️  typecheck

ivancuric avatar Aug 02 '19 09:08 ivancuric

@ivancuric thank you for issue! I will test it in a few days.

Arkweid avatar Aug 04 '19 10:08 Arkweid

Is it also happens if you run it under Windows SubSystem for Linux?

Arkweid avatar Aug 04 '19 19:08 Arkweid

Haven't tried, the project I'm working on sadly can't run on WSL

ivancuric avatar Aug 05 '19 15:08 ivancuric

Hey @ivancuric! Did you try v1 version of lefthook? Of course, this issue is rather stale but I just want to understand do we still have such a bug.

mrexox avatar Jul 18 '22 07:07 mrexox