Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions mfc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,6 @@ fi

echo

# Run the main.py bootstrap script
# If only flags given (no command), show help without passing flags
has_command=false
for arg in "$@"; do
case "$arg" in -*) ;; *) has_command=true; break ;; esac
done
if [ "$has_command" = true ]; then
python3 "$(pwd)/toolchain/main.py" "$@"
else
python3 "$(pwd)/toolchain/main.py"
fi
code=$?

echo

if [ $code -ne 0 ]; then

Copilot AI Feb 22, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable $code is referenced but never set after the removal of the python3 execution block. This will cause the script to fail or behave unexpectedly. Either remove this conditional check or ensure $code is set by adding back the main.py execution with proper exit code capture.

Copilot uses AI. Check for mistakes.
error "main.py finished with a $code exit code."
Comment on lines 101 to 102

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Safely handle the exit status by defaulting to zero when it is unset and avoid unquoted numeric comparison. [custom_rule]

Severity Level: Minor ⚠️

Suggested change
if [ $code -ne 0 ]; then
error "main.py finished with a $code exit code."
if [ "${code:-0}" -ne 0 ]; then
error "main.py finished with a ${code:-0} exit code."
Why it matters? ⭐

The existing numeric test can fail with "integer expression expected" when $code is unset or empty; the improved code uses a safe default ("${code:-0}") and quotes the expansion so the test is robust. This directly fixes a correctness/robustness issue in the shell script (avoid unquoted/unset variable in numeric comparison), which is in line with the repository's emphasis on correctness over style.

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** mfc.sh
**Line:** 87:88
**Comment:**
	*Custom Rule: Safely handle the exit status by defaulting to zero when it is unset and avoid unquoted numeric comparison.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
👍 | 👎

Expand Down
Loading