Hi, has someone already hooked up `update-build-fi...
# general
Hi, has someone already hooked up
to their git hooks? I want them to run like any other pre-commit hook. I have already connected pants to git hooks thanks to @wide-midnight-78598
Yes, I’ve added
update-build-files —check
to our pre commit hooks at work.
I would imagine you wrote a custom git hook then?
No, I’m using https://pre-commit.com/
Copy code
$ cat .pre-commit-config.yaml
- repo: local
  - id: lint-check-test
    name: Checking source files and running tests
    entry: "./pants lint check test ::"
    language: script
    types: [python]
    pass_filenames: false
    verbose: true
  - id: lint-build-files
    name: Checking BUILD files
    entry: "./pants --no-pantsd update-build-files --check"
    language: script
    files: BUILD
    pass_filenames: false
    verbose: true
🙌 2
For the
lint check test
step, you could have
pass_filenames: true
and omit the
spec, but I have fmt issues then: https://github.com/pantsbuild/pants/pull/15002
I actually didn't realize the update-build-files check wasn't in the pre-commit hook in my sample repo! It should run just like the other two, as @curved-television-6568 mentioned. https://github.com/sureshjoshi/pants-example-plugin/issues/13 Should have it fixed in a couple hours when I'm back at my computer
👍 1
❤️ 1