Skip to content

Commit

Permalink
add fmt prepush
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryang20718 committed Jun 7, 2024
1 parent b4f2927 commit fa9aee7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions actions/trunk/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ actions:
- git_hooks: [pre-commit]
notify_on_error: false

- id: trunk-fmt-pre-push
description: Run 'trunk fmt' whenever you run 'git push'
display_name: Trunk Fmt Pre-Push Hook
run: trunk fmt -t "git-commit" --index-file '${env.GIT_INDEX_FILE}' --upstream=HEAD
interactive: optional
triggers:
- git_hooks: [pre-push]
notify_on_error: false

# We do not auto-suggest turning on check pre-commit for several reasons:
# - Linters can often be much slower than formatters, and we don't want to unnecessarily block iteration.
# - The trunk-fmt-pre-commit action is usually sufficient for enforcing style.
Expand Down

0 comments on commit fa9aee7

Please sign in to comment.