forked from daos-stack/daos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DAOS-623 ci: Modify githooks to allow skip (daos-stack#13885)
*Allow one to set DAOS_SKIP=exp1,exp2 to skip git hooks on a case by case basis as needed. *Unify the scripts in one file Signed-off-by: Jeff Olivier <[email protected]>
- Loading branch information
1 parent
de031fd
commit 8d8d224
Showing
5 changed files
with
48 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
run-parts() { | ||
local dir="$1" | ||
shift | ||
|
||
for i in $(LC_ALL=C; echo ${dir%/}/*[^~,]); do | ||
# don't run vim .swp files | ||
[ "${i%.sw?}" != "${i}" ] && continue | ||
$i "$@" | ||
done | ||
} | ||
|
||
run-parts utils/githooks/${0##*/}.d "$@" 1>&2 | ||
. utils/githooks/hook_base.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
. utils/githooks/find_base.sh | ||
export TARGET | ||
|
||
hook=${0##*/} | ||
rm -f ".${hook}" | ||
|
||
IFS=', ' read -r -a skip_list <<< "${DAOS_GITHOOK_SKIP:-}" | ||
|
||
run-parts() { | ||
local dir="$1" | ||
shift | ||
|
||
for i in $(LC_ALL=C; echo "${dir%/}"/*[^~,]); do | ||
# don't run vim .swp files | ||
[ "${i%.sw?}" != "${i}" ] && continue | ||
skip_item=false | ||
for skip in "${skip_list[@]}"; do | ||
if [[ "${i}" =~ ${skip} ]]; then | ||
skip_item=true | ||
echo "Skipping ${i}" | ||
break | ||
fi | ||
done | ||
$skip_item && continue | ||
$i "$@" | ||
done | ||
} | ||
|
||
run-parts utils/githooks/"${hook}".d "$@" 1>&2 | ||
|
||
touch ".${hook}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,4 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
. utils/githooks/find_base.sh | ||
export TARGET | ||
|
||
hook=${0##*/} | ||
rm -f ".${hook}" | ||
|
||
run-parts() { | ||
local dir="$1" | ||
shift | ||
|
||
for i in $(LC_ALL=C; echo "${dir%/}"/*[^~,]); do | ||
# don't run vim .swp files | ||
[ "${i%.sw?}" != "${i}" ] && continue | ||
$i "$@" | ||
done | ||
} | ||
|
||
run-parts utils/githooks/"${hook}".d "$@" 1>&2 | ||
|
||
touch ".${hook}" | ||
. utils/githooks/hook_base.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,3 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
hook=${0##*/} | ||
rm -f ".${hook}" | ||
|
||
run-parts() { | ||
local dir="$1" | ||
shift | ||
|
||
for i in $(LC_ALL=C; echo "${dir%/}"/*[^~,]); do | ||
# don't run vim .swp files | ||
[ "${i%.sw?}" != "${i}" ] && continue | ||
$i "$@" | ||
done | ||
} | ||
|
||
run-parts utils/githooks/"${hook}".d "$@" 1>&2 | ||
|
||
touch ".${hook}" | ||
. utils/githooks/hook_base.sh |