From 484aa13dbb556cb99e825fff88643ff446962ef8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 4 Jan 2026 19:43:21 +0000 Subject: [PATCH 1/2] Fix ShellCheck CI failures - Exclude markdown files from ShellCheck scanning via ignore_names - Remove unsupported zsh script from additional_files - Fix SC2155 warnings by separating variable declaration and assignment - Fix SC1083 by quoting @{u} in git commands - Fix SC2206 by quoting array element in provision --- .github/workflows/lint.yml | 3 ++- bin/git-repo-checker | 15 ++++++++++----- bin/provision | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4328c83..784d936 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,4 +21,5 @@ jobs: uses: ludeeus/action-shellcheck@2.0.0 with: scandir: './bin' - additional_files: '.config/shell/common-profile.sh .config/zsh/update-completions.sh' + ignore_names: '*.md' + additional_files: '.config/shell/common-profile.sh' diff --git a/bin/git-repo-checker b/bin/git-repo-checker index bb89be3..eb0bf21 100755 --- a/bin/git-repo-checker +++ b/bin/git-repo-checker @@ -79,7 +79,8 @@ is_git_repo() { # Function to check for uncommitted changes check_uncommitted_changes() { local dir="$1" - local repo_name=$(basename "$dir") + local repo_name + repo_name=$(basename "$dir") cd "$dir" @@ -123,10 +124,12 @@ check_unpushed_commits() { cd "$dir" # Get current branch - local current_branch=$(git rev-parse --abbrev-ref HEAD) + local current_branch + current_branch=$(git rev-parse --abbrev-ref HEAD) # Check if branch has upstream - local upstream=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null || echo "") + local upstream + upstream=$(git rev-parse --abbrev-ref --symbolic-full-name "@{u}" 2>/dev/null || echo "") if [[ -z "$upstream" ]]; then echo -e "${YELLOW} ⚠️ No upstream branch set for '$current_branch'${NC}" @@ -134,7 +137,8 @@ check_unpushed_commits() { fi # Check for unpushed commits - local unpushed_count=$(git rev-list --count HEAD ^"$upstream" 2>/dev/null || echo "0") + local unpushed_count + unpushed_count=$(git rev-list --count HEAD ^"$upstream" 2>/dev/null || echo "0") if [[ "$unpushed_count" -gt 0 ]]; then echo -e "${YELLOW} ⚠️ $unpushed_count unpushed commit(s) on '$current_branch'${NC}" @@ -151,7 +155,8 @@ check_unpushed_commits() { # Function to process a single repository process_repo() { local dir="$1" - local repo_name=$(basename "$dir") + local repo_name + repo_name=$(basename "$dir") echo -e "${BLUE}📁 $repo_name${NC}" diff --git a/bin/provision b/bin/provision index 7149765..5fae3fa 100755 --- a/bin/provision +++ b/bin/provision @@ -77,7 +77,7 @@ ANSIBLE_CMD=( # Add optional arguments [[ -n "$ASK_BECOME_PASS" ]] && ANSIBLE_CMD+=("$ASK_BECOME_PASS") -[[ -n "$SETUP_ONLY" ]] && ANSIBLE_CMD+=($SETUP_ONLY) +[[ -n "$SETUP_ONLY" ]] && ANSIBLE_CMD+=("$SETUP_ONLY") [[ ${#REMAINING_ARGS[@]} -gt 0 ]] && ANSIBLE_CMD+=("${REMAINING_ARGS[@]}") # Run the Ansible playbook From 0cc42469d8d5ed7c626029bf04efa22bf3427359 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 4 Jan 2026 20:18:47 +0000 Subject: [PATCH 2/2] Change update-completions.sh to bash for CI linting The script uses no zsh-specific syntax, so bash works fine. This allows ShellCheck to lint it in CI. --- .config/zsh/update-completions.sh | 2 +- .github/workflows/lint.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/zsh/update-completions.sh b/.config/zsh/update-completions.sh index 20e27e7..d5f4287 100755 --- a/.config/zsh/update-completions.sh +++ b/.config/zsh/update-completions.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env zsh +#!/usr/bin/env bash # Update shell completions for installed tools # This script should be run after installing or updating tools diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 784d936..f9af08a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,4 +22,4 @@ jobs: with: scandir: './bin' ignore_names: '*.md' - additional_files: '.config/shell/common-profile.sh' + additional_files: '.config/shell/common-profile.sh .config/zsh/update-completions.sh'