Skip to content

Commit 19e0790

Browse files
committed
refactor: update shellcheck directives for improved script validation and maintain consistency in source paths across command and test scripts
1 parent 09ea37a commit 19e0790

14 files changed

Lines changed: 20 additions & 7 deletions

src/commands/init.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ source "$FLOWAI_HOME/src/os/platform.sh"
2222
# are available during the wizard without hardcoding tool names.
2323
for _init_tool_plugin in "$FLOWAI_HOME/src/tools/"*.sh; do
2424
[[ -f "$_init_tool_plugin" ]] || continue
25+
# shellcheck source=/dev/null # dynamic plugin path — intentional
2526
source "$_init_tool_plugin"
2627
done
2728
unset _init_tool_plugin

src/commands/logs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
set -euo pipefail
88

9-
# shellcheck source=../core/log.sh
9+
# shellcheck source=src/core/log.sh
1010
source "$FLOWAI_HOME/src/core/log.sh"
11-
# shellcheck source=../core/session.sh
11+
# shellcheck source=src/core/session.sh
1212
source "$FLOWAI_HOME/src/core/session.sh"
1313

1414
if ! command -v tmux >/dev/null 2>&1; then

src/commands/models.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ declare -a available_tools=()
4242
if [[ -d "$FLOWAI_HOME/src/tools" ]]; then
4343
for tool_file in "$FLOWAI_HOME/src/tools/"*.sh; do
4444
[[ -f "$tool_file" ]] || continue
45+
# shellcheck source=/dev/null # dynamic plugin path — intentional
4546
source "$tool_file"
4647
tool_name="$(basename "$tool_file" .sh)"
4748
available_tools+=("$tool_name")

src/core/config-validate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# shellcheck source=src/core/log.sh
66
source "$FLOWAI_HOME/src/core/log.sh"
7-
# shellcheck source=models-catalog.sh
7+
# shellcheck source=src/core/models-catalog.sh
88
[[ -n "${FLOWAI_HOME:-}" ]] && source "$FLOWAI_HOME/src/core/models-catalog.sh"
99

1010
# Check one (tool, model) pair. Returns 0 if ok or empty; 1 if invalid (strict).

src/core/config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
export FLOWAI_DIR="${FLOWAI_DIR:-$PWD/.flowai}"
66
export FLOWAI_CONFIG="${FLOWAI_DIR}/config.json"
77

8-
# shellcheck source=models-catalog.sh
8+
# shellcheck source=src/core/models-catalog.sh
99
[[ -n "${FLOWAI_HOME:-}" ]] && source "$FLOWAI_HOME/src/core/models-catalog.sh"
1010

1111
# Reject absolute paths and ".." segments so stored paths cannot escape $PWD at read time.

tests/suites/ai_resolution.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Tests for flowai_ai_resolve_model_for_tool, flowai_ai_resolve_tool_and_model_for_phase,
44
# and flowai_ai_tool_is_paste_only in src/core/ai.sh.
55
# shellcheck shell=bash
6+
# shellcheck disable=SC2016 # bash -c strings use $ vars for inner shell, not outer
67
#
78
# Isolated temp projects use: env FLOWAI_DIR=… FLOWAI_HOME=… bash -s <<'EOS' … EOS
89
# so ShellCheck does not treat exports as lost subshell assignments (SC2030/SC2031).

tests/suites/graph_edge_cases.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#
1414
# Expects tests/lib/harness.sh sourced first (see tests/run.sh).
1515
# shellcheck shell=bash
16+
# shellcheck disable=SC2016 # tests use single-quoted bash -c with $ vars intentionally
1617

1718
source "$FLOWAI_HOME/src/core/log.sh"
1819

tests/suites/logs_command.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Logs command — tests for src/commands/logs.sh
33
# Expects tests/lib/harness.sh sourced first (see tests/run.sh).
44
# shellcheck shell=bash
5+
# shellcheck disable=SC2016 # grep patterns contain $ for literal matching, not shell expansion
56

67
# shellcheck source=../../src/core/log.sh
78
source "$FLOWAI_HOME/src/core/log.sh"

tests/suites/master_orchestration.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# runs interactive AI sessions), so we do NOT source it. Tests use grep/pattern
66
# analysis on the source file or validate extracted regex patterns inline.
77
# shellcheck shell=bash
8+
# shellcheck disable=SC2016 # grep patterns match literal $ in source files
89

910
# shellcheck source=../../src/core/log.sh
1011
source "$FLOWAI_HOME/src/core/log.sh"

tests/suites/orchestration_extended.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# phase timeout / pre-signal fast path, feature directory resolution,
44
# constraint reminder constant, and tool plugin API completeness.
55
# shellcheck shell=bash
6+
# shellcheck disable=SC2016 # bash -c strings use $ vars for inner shell, not outer
67

78
# shellcheck source=../../src/core/log.sh
89
source "$FLOWAI_HOME/src/core/log.sh"

0 commit comments

Comments
 (0)