From c77550603b3e5f52514552008bd8ac329bfe79f0 Mon Sep 17 00:00:00 2001 From: Charles Gibert Date: Wed, 8 Apr 2026 13:49:44 +0200 Subject: [PATCH] fix(validator): remove zsh-specific setopt block The setopt block (BASH_REMATCH, RE_MATCH_PCRE, KSH_ARRAYS) was meant for zsh compatibility but caused 'setopt: command not found' errors when ZSH_NAME leaked from a parent zsh session into bash subprocesses. Since the scripts use #!/usr/bin/env bash and pre-commit runs them in bash, the zsh compat code is unnecessary. Removing it fixes the issue without any change in behavior. --- check.sh | 6 ------ validator.sh | 6 ------ 2 files changed, 12 deletions(-) diff --git a/check.sh b/check.sh index 7f9ee15..d6967f0 100755 --- a/check.sh +++ b/check.sh @@ -2,12 +2,6 @@ set -eu -if [[ -v ZSH_NAME ]]; then - setopt BASH_REMATCH - setopt RE_MATCH_PCRE - setopt KSH_ARRAYS -fi - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" source $DIR/validator.sh diff --git a/validator.sh b/validator.sh index 33d2595..a07c113 100644 --- a/validator.sh +++ b/validator.sh @@ -1,9 +1,3 @@ -if [[ -v ZSH_NAME ]]; then - setopt BASH_REMATCH - setopt RE_MATCH_PCRE - setopt KSH_ARRAYS -fi - readonly HEADER_PATTERN="^([^\(]+)\(([^\)]+)\): (.+)$" readonly TYPE_PATTERN="^(feat|fix|docs|gen|lint|refactor|test|chore)$" readonly SCOPE_PATTERN="^([a-z][a-z0-9]*)(-[a-z0-9]+)*$"