Skip to content

Run hooks on files in specific dir, rather than using --all-files #1173

@ghost

Description

I am able to successfully use pre-commit run --all-files to run hooks on all my files.

Now, I'm trying to run the hooks just on files in a particular directory. I think I'm not understanding the docs and I can't find an example to work from.

Here's what the docs say:

--files [FILES [FILES ...]]: specific filenames to run hooks on.

I've tried the following variations:
pre-commit run --files web/modules/custom
pre-commit run --files web/modules/custom/*
pre-commit run --files [web/modules/custom]
pre-commit run --files [web/modules/custom/*]
pre-commit run --files [FILES [web/modules/custom]
pre-commit run --files [FILES [web/modules/custom/*]

I feel really dumb having to ask, but can someone please point me in the right direction?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions