pokerogue/lefthook.yml
NightKev af2bad96f1
[Dev] Add lefthook command to update packages on checkout/merge (#6820)
* [Dev] Add lefthook command to update packages on checkout/merge

* Modify post-checkout to only run on branch checkout

Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>

---------

Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
2025-12-03 18:02:31 -08:00

31 lines
801 B
YAML

# SPDX-FileCopyrightText: 2024-2025 Pagefault Games
#
# SPDX-License-Identifier: AGPL-3.0-only
pre-commit:
skip:
- merge
- rebase
commands:
biome-lint:
# Disable colors as certain IDEs (such as VSCode) don't support it in the output pane.
# Summary mode looks decent in plain ASCII anyhow
run: pnpm biome:staged --colors=off --reporter=summary
stage_fixed: true
ls-lint:
run: pnpm exec ls-lint
post-merge:
commands:
update-submodules:
run: pnpm update-submodules
update-packages:
run: pnpm i
post-checkout:
commands:
update-packages:
# cf https://git-scm.com/docs/githooks#_post_checkout:
# The 3rd argument is 1 for branch checkouts and 0 for file checkouts.
run: if test {3} -eq "1"; then pnpm i; fi