Skip to content

Commit ff802e1

Browse files
committed
fix(lint): resolve shellcheck errors SC2296 and SC2155
- Add shellcheck disable directive for zsh-specific indirect expansion syntax - Separate variable declaration and assignment in config parsing
1 parent 0d3fdcb commit ff802e1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

llm-env

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ get_match() {
143143
get_var_value() {
144144
local var_name="$1"
145145
if [[ "${CURRENT_SHELL}" == "zsh" ]]; then
146+
# shellcheck disable=SC2296 # zsh-specific indirect expansion syntax
146147
echo "${(P)var_name}"
147148
else
148149
echo "${!var_name}"
@@ -343,8 +344,10 @@ load_config() {
343344

344345
# Parse key=value pairs
345346
if [[ "$line" =~ $keyval_pattern ]]; then
346-
local key="$(get_match 1)"
347-
local value="$(get_match 2)"
347+
local key
348+
local value
349+
key="$(get_match 1)"
350+
value="$(get_match 2)"
348351

349352
# Trim whitespace
350353
key="$(echo "$key" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"

0 commit comments

Comments
 (0)