Skip to content

run -v should provide file search information for easy troubleshooting #2179

@DanKaplanSES

Description

@DanKaplanSES

I am trying to write something similar to this config file so I can run a prettier in a subdirectory:

-   repo: local
    hooks:
    -   id: go-unit-tests
        name: run go test s(go test)
        language: system
        entry: bash -c 'cd subdir && exec go test ./...'
        pass_filenames: false
        types: [go]
        files: ^subdir/

Here's my version:

repos:
    - repo: local
      hooks:
          - id: firebase-formatter
            name: Firebase Formatter
            language: system
            entry: bash -c 'cd firebase/functions && echo "$PWD"'
            pass_filenames: false
            types: [ts]
            files: ^firebase/functions/

Here's my command line:

➜  backend git:(chore/prettier--#179125952) ✗ pre-commit run -v firebase-formatter
Firebase Formatter...................................(no files to check)Skipped
- hook id: firebase-formatter

I've tried variations of this configuration file, but it always outputs the same thing. How can I troubleshoot this further? It would be helpful if the verbose flag could tell me how it searched. Output like this would help a lot:

➜  backend git:(chore/prettier--#179125952) ✗ pre-commit run -v firebase-formatter
Looking for ts files in firebase/functions.........................(nothing found)
Looking for ts files in firebase/functions/src.........................(nothing found)
Looking for ts files in firebase/functions/src/foo.........................(nothing found)
Firebase Formatter...................................(no files to check)Skipped

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions