Search code examples
pre-commit.com

precommit: running a linter that only takes one filename at a time


We have a linter that runs with xqlint lint target_file but doesn't seem to support multiple filenames.

Is there a way in precommit to run against each file separately, without resorting to

entry: bash -c "for $f in $@; do xqlint lint $f; done"

(which seems to work but is ugly and less portable.)


Solution

  • there is intentionally not. starting and stopping processes repeatedly is slow and wasteful. the tool should adjust to take multiple positional arguments

    __

    disclaimer: I wrote pre-commit