Skip to content

Commit

Permalink
FIX pre-commit hook
Browse files Browse the repository at this point in the history
We can not run bash_unit test with an old version of bash_unit
as they will never pass when we introduce a new feature.

We're just keeping it here as a comment to document how one can
use it.
  • Loading branch information
pgrange committed Mar 4, 2024
1 parent 980315c commit 878a362
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ jobs:
pre-commit gc
# Run default pre-commit hooks
pre-commit run --show-diff-on-failure --color=always --all-files | tee ${RAW_LOG}
# Run manual pre-commit hook that runs bash_unit@rev
# defined in .pre-commit-config.yaml
pre-commit run bash-unit --hook-stage manual -a | tee -a ${RAW_LOG}
# Run this version of bash_unit using it's current pre-commit-hook.yaml config
# Useful for testing that the current version works
pre-commit try-repo . --verbose --all-files | tee -a ${RAW_LOG}
Expand Down
20 changes: 13 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,16 @@ repos:
entry: bash -c "./bash_unit tests/*"
pass_filenames: false

- repo: https://github.com/pgrange/bash_unit
rev: 308c139639269b89c26911098b7739ee2400fcbd
hooks:
- id: bash-unit
stages: [manual]
always_run: true
verbose: true
# This is how one can use bash_unit with pre-commit
# Only for documentation purpose as it can't be
# used in bash_unit itself: we always want to test
# bash_unit with the last version of bash_unit.
# Otherwise tests would always fail when we introduce
# a new feature.
# - repo: https://github.com/pgrange/bash_unit
# rev: v2.2.0
# hooks:
# - id: bash-unit
# stages: [manual]
# always_run: true
# verbose: true

0 comments on commit 878a362

Please sign in to comment.