共有スクリプトのクォート修正 + shellcheck の CI 導入 - #178
Open
k-yoshimi wants to merge 3 commits into
Open
Conversation
- util.sh: quote "$@"/command substitutions (check_cc/check_fc args, toupper/tolower/capitalize, is_macos, find_tool), reject MA_ROOT/ BUILD_DIR/SOURCE_DIR containing whitespace at set_prefix, anchor the filename match in calc_strip_components, and fall back to c++ instead of the nonexistent cxx in check_header - Quote remaining word-splitting hazards in list_maversion.sh, fix_dylib.sh, and setup/config/default/setup.sh - Add a shellcheck job (severity=warning, -s sh) over the shared scripts, with SC1090/SC1091/SC3043 disabled via .shellcheckrc as intentional design choices Fixes #172 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 7, 2026
- Docs (how_to_use en/ja) and README now state that MA_ROOT/ BUILD_DIR/SOURCE_DIR must not contain whitespace and how to work around a home directory that does - reject_whitespace now tells the user where to fix the path - Quote the util.sh source lines in check_prefix.sh and list_maversion.sh so a repo checkout path with spaces fails inside the guard rather than at the source statement Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collaborator
Author
AI review cycle (Codex + Antigravity) 結果Phase 1 (Codex): must_fix 0 / should_fix 2 / optional 1。
Phase 2 (Antigravity): must_fix_docs 2 → 追加コミットで対応:
Phase 1 再レビュー(エスカレーション): must_fix 0(optional の dirname クォートも適用済み)。 → 両フェーズ収束。 |
This was referenced Jul 7, 2026
This was referenced Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
Fixes #172
util.sh の修正
check_cc/check_fcの$@、toupper/tolower/capitalizeのecho $@、is_macosのコマンド置換、find_toolの eval 部分をクォートset_prefixでMA_ROOT/BUILD_DIR/SOURCE_DIRに空白を含むパスを検出したらexit 127(全域が未クォート前提のため、暗黙の制約を明示的なエラーに)calc_strip_components:grep $2の無アンカー部分一致をgrep -E "(^|/)$2\$"に(xREADME.mdやREADME.md.bakへの誤マッチを防止)check_header: 存在しないcxxへのフォールバックをc++にその他のクォート修正
list_maversion.sh、fix_dylib.sh(1 行、#174 と軽微に競合する可能性あり→どちらを先にマージしても解消は自明です)、setup/config/default/setup.shCI
main.ymlに shellcheck ジョブを追加(--severity=warning -s sh、対象はscripts/*.sh+setup/+check_prefix.sh)。動的 source(SC1090/91)とlocal(SC3043)は設計上意図的なため.shellcheckrcで除外。apps/tools 配下への対象拡大は、触ったファイルから漸進的に行う想定です。検証(macOS で実施)
shellcheck --severity=warning -s shが対象全ファイルでクリーン、sh -nも全て通過set_prefix+print_prefixが通常の設定で従来どおり動作MA_ROOTがFatal: ... must not contain whitespaceで exit 127(ディレクトリ未作成)になることを確認calc_strip_components:pkg-1.0/README.md+ 妨害ファイル(xREADME.md,NOTREADME.md.bak)入り tarball で正しく 1 を返すfind_tool zlibが実際のツール検出フロー(eval 書き換え箇所)で1.2.12を返す🤖 Generated with Claude Code