Skip to content

Commit b223310

Browse files
committed
fix ci error
1 parent 9606069 commit b223310

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

‎home/dot_gitconfig.tmpl‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
st = status
3838
graph = log --graph --decorate --oneline --all
3939
root = rev-parse --show-toplevel
40+
[filter "lfs"]
41+
smudge = git-lfs smudge -- %f
42+
process = git-lfs filter-process
43+
required = true
44+
clean = git-lfs clean -- %f
4045
[includeIf "gitdir:~/src/personal/"]
4146
path = ~/.gitconfig-personal
4247
[includeIf "gitdir:~/src/work/"]

‎tests/test-packages.sh‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ confirm() { return 0; }
2222
package_calls=''
2323
# shellcheck disable=SC2329
2424
run() { package_calls="${package_calls}|$*"; }
25+
# The real function is sourced above; ShellCheck only sees the test override below.
26+
# shellcheck disable=SC2218
2527
install_brewfile "${SOURCE_DIR}/packages/Brewfile.dev" >/dev/null 2>&1
2628
case "$package_calls" in
2729
*'|brew unlink bazel'*'|env HOMEBREW_NO_INSTALL_CLEANUP=1 brew bundle install --no-upgrade'*) ;;
2830
*) die 'Bazel was not unlinked before Brewfile installation continued.' ;;
2931
esac
3032

33+
# shellcheck disable=SC2218
3134
install_brewfile "${SOURCE_DIR}/packages/Brewfile.infra" >/dev/null 2>&1
3235
case "$package_calls" in
3336
*'|brew trust --formula hashicorp/tap/terraform'*'|env HOMEBREW_NO_INSTALL_CLEANUP=1 brew bundle install --no-upgrade'*) ;;
@@ -46,6 +49,7 @@ run() {
4649
*) return 0 ;;
4750
esac
4851
}
52+
# shellcheck disable=SC2218
4953
MACHINE_SETUP_CI=1 install_brewfile "${SOURCE_DIR}/packages/Brewfile.core" >/dev/null 2>&1
5054
[ "$ci_bundle_attempts" -eq 2 ] || die 'CI did not retry a transient Homebrew bundle failure exactly once.'
5155

‎tests/test-static.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ grep -Fq 'nvim/mason/bin' "$SOURCE_DIR/scripts/doctor.sh"
2323
grep -Fq '/Applications/Utilities/XQuartz.app' "$SOURCE_DIR/scripts/doctor.sh"
2424
grep -Fq "nvim --headless '+Lazy! restore'" "$SOURCE_DIR/scripts/install-editor.sh"
2525
grep -Fq "mise exec -- nvim --headless '+Lazy! restore'" "$SOURCE_DIR/setup.sh"
26-
if rg -n "Lazy! sync" "$SOURCE_DIR/setup.sh" "$SOURCE_DIR/scripts"; then
26+
if grep -RFn 'Lazy! sync' "$SOURCE_DIR/setup.sh" "$SOURCE_DIR/scripts"; then
2727
printf 'Normal apply must not upgrade Neovim plugins.\n' >&2
2828
exit 1
2929
fi
@@ -55,7 +55,7 @@ fi
5555

5656
git -C "$SOURCE_DIR" diff --check
5757

58-
if rg -n --hidden --glob '!.git/**' --glob '!tests/**' \
58+
if grep -REn --exclude-dir=.git --exclude-dir=tests --binary-files=without-match \
5959
'(BEGIN (RSA|OPENSSH|EC|DSA) PRIVATE KEY|AKIA[0-9A-Z]{16}|ghp_[A-Za-z0-9]{30,})' "$SOURCE_DIR"; then
6060
printf 'Potential secret material found.\n' >&2
6161
exit 1

‎tests/test-templates.sh‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ for profile in $MACHINE_SETUP_PROFILES; do
3939
[ -d "$test_home/src/$workspace" ] || die "${profile} did not create src/${workspace}."
4040
done
4141
[ "$(git config --file "$test_home/.gitconfig" --get user.useConfigOnly)" = true ] || die 'Git identity guard is missing.'
42+
[ "$(git config --file "$test_home/.gitconfig" --get filter.lfs.smudge)" = 'git-lfs smudge -- %f' ] || die 'Git LFS smudge filter is missing.'
43+
[ "$(git config --file "$test_home/.gitconfig" --get filter.lfs.process)" = 'git-lfs filter-process' ] || die 'Git LFS process filter is missing.'
44+
[ "$(git config --file "$test_home/.gitconfig" --get filter.lfs.required)" = true ] || die 'Git LFS required guard is missing.'
45+
[ "$(git config --file "$test_home/.gitconfig" --get filter.lfs.clean)" = 'git-lfs clean -- %f' ] || die 'Git LFS clean filter is missing.'
4246
expected_work_config="$home_token/.gitconfig-work"
4347
[ "$(git config --file "$test_home/.gitconfig" --get "includeIf.gitdir:~/src/${company_folder}/.path")" = "$expected_work_config" ] || die 'The configured company folder must use the work Git identity.'
4448
[ -z "$(git config --file "$test_home/.gitconfig" --get commit.gpgSign 2>/dev/null || true)" ] || die 'Signing must not be enabled globally.'

0 commit comments

Comments
 (0)