From e219ecb7c98cd84b5cf9a092a30b796ae292edf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81s=20Sainz=20de=20Aja?= Date: Sat, 4 Jul 2026 13:00:49 +0200 Subject: [PATCH] fix: resolve ShellCheck lint failures in CI # Current problem The Lint workflow has been failing on every push: scripts/dock.sh declares a #!/bin/sh shebang but uses bash-only syntax (function keyword, [[ ]], arrays, declare), so ShellCheck evaluated it against POSIX sh rules and flagged the bash-isms as violations. dotfiles/.zshrc had an unquoted source path and two SC1090 warnings for inherently dynamic source paths. scripts/gdone.zsh is a zsh script, which ShellCheck cannot parse at all (SC1071), failing the job outright. # Proposed solution Correct dock.sh's shebang to #!/bin/bash to match the syntax it actually uses, quote the offending variables in .zshrc and dock.sh, silence the two unavoidable SC1090 false positives with directives, and exclude gdone.zsh from the workflow's ShellCheck scan since the tool doesn't support zsh. --- .github/workflows/lint.yml | 2 ++ dotfiles/.zshrc | 4 +++- scripts/dock.sh | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b21cfa8..ed602b3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,3 +11,5 @@ jobs: uses: actions/checkout@v6 - name: Run ShellCheck uses: ludeeus/action-shellcheck@master + with: + ignore_names: gdone.zsh diff --git a/dotfiles/.zshrc b/dotfiles/.zshrc index 5c850b6..ded3df1 100644 --- a/dotfiles/.zshrc +++ b/dotfiles/.zshrc @@ -31,7 +31,7 @@ export PATH="$PATH:$ANDROID_HOME/emulator" export PATH="$PATH:$ANDROID_HOME/platform-tools" # source $HOMEBREW_PREFIX/share/zsh-autocomplete/zsh-autocomplete.plugin.zsh -source $HOMEBREW_PREFIX/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +source "$HOMEBREW_PREFIX/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" source "$HOMEBREW_PREFIX/opt/fzf-tab/share/fzf-tab/fzf-tab.zsh" # Load Antidote and plugins @@ -43,6 +43,7 @@ antidote load [[ -f $HOME/.extra ]] && source "$HOME/.extra" +# shellcheck disable=SC1090 for file in "$HOME/bin/"*.zsh; do [ -f "$file" ] && source "$file" done @@ -52,6 +53,7 @@ autoload -Uz compinit && compinit eval "$(starship init zsh)" +# shellcheck disable=SC1090 [[ "$TERM_PROGRAM" == "kiro" ]] && . "$(kiro --locate-shell-integration-path zsh)" export CODEX_HOME="$HOME/.codex" diff --git a/scripts/dock.sh b/scripts/dock.sh index 734d3d6..a8c974c 100644 --- a/scripts/dock.sh +++ b/scripts/dock.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # https://github.com/rpavlick/add_to_dock @@ -159,7 +159,7 @@ for app in "${apps[@]}"; do done for folder in "${folders[@]}"; do - add_folder_to_dock $folder + add_folder_to_dock "$folder" done killall Dock \ No newline at end of file