chore: apply shfmt formatting and fix pyright config#701
chore: apply shfmt formatting and fix pyright config#701cv wants to merge 2 commits intoNVIDIA:mainfrom
Conversation
Auto-formatted with `shfmt -i 2 -ci -bn` to match the project's pre-commit configuration. Also fix SC2206 shellcheck warning in version_gte() by using `read -ra` instead of unquoted word splitting. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Drop stray '.' arg from pyright in Makefile and pre-commit hook (overrides pyproject.toml include/exclude, causing it to scan .venv) - Exclude test_*.py from pyright strict checking (pytest is a dev dep) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughUpdates to shell script formatting and configuration across multiple build and installation scripts. Changes include standardizing Bash syntax consistency in control-flow statements, removing trailing arguments from pyright invocations, and adding exclusion rules for test files in the pyright configuration. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/backup-workspace.sh`:
- Around line 83-84: The current pipeline `ts="$(ls -1 "$BACKUP_BASE"
2>/dev/null | sort -r | head -n1)"` can cause the script to exit under set -euo
pipefail if $BACKUP_BASE doesn't exist, so first explicitly check that the
directory exists and is readable (test -d "$BACKUP_BASE") before running the ls
pipeline; if the test fails call the existing fail function with the message "No
backups found in ${BACKUP_BASE}/" or a clearer "Backup directory ${BACKUP_BASE}
does not exist" and only then run the ts assignment (or run a safe glob/read
with find) so that the explicit fail in the check always executes instead of
being short-circuited by errexit when computing ts.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5cc9acbe-7cc0-4b71-aac5-e3867649312d
📒 Files selected for processing (6)
.pre-commit-config.yamlinstall.shnemoclaw-blueprint/Makefilenemoclaw-blueprint/pyproject.tomlscripts/backup-workspace.shscripts/install-openshell.sh
| ts="$(ls -1 "$BACKUP_BASE" 2>/dev/null | sort -r | head -n1)" | ||
| [ -n "$ts" ] || fail "No backups found in ${BACKUP_BASE}/" |
There was a problem hiding this comment.
Handle missing backup directory without errexit short-circuit
Line 83 can exit the script early under set -euo pipefail if ${BACKUP_BASE} does not exist, so Line 84’s explicit fail message may never run.
Suggested fix
- ts="$(ls -1 "$BACKUP_BASE" 2>/dev/null | sort -r | head -n1)"
- [ -n "$ts" ] || fail "No backups found in ${BACKUP_BASE}/"
+ ts="$(
+ find "$BACKUP_BASE" -mindepth 1 -maxdepth 1 -type d -printf '%f\n' 2>/dev/null \
+ | sort -r \
+ | head -n1
+ )"
+ [ -n "$ts" ] || fail "No backups found in ${BACKUP_BASE}/"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@scripts/backup-workspace.sh` around lines 83 - 84, The current pipeline
`ts="$(ls -1 "$BACKUP_BASE" 2>/dev/null | sort -r | head -n1)"` can cause the
script to exit under set -euo pipefail if $BACKUP_BASE doesn't exist, so first
explicitly check that the directory exists and is readable (test -d
"$BACKUP_BASE") before running the ls pipeline; if the test fails call the
existing fail function with the message "No backups found in ${BACKUP_BASE}/" or
a clearer "Backup directory ${BACKUP_BASE} does not exist" and only then run the
ts assignment (or run a safe glob/read with find) so that the explicit fail in
the check always executes instead of being short-circuited by errexit when
computing ts.
Summary
shfmt -i 2 -ci -bntoinstall.sh,scripts/backup-workspace.sh, andscripts/install-openshell.shto match the project's pre-commit configversion_gte()— useread -rainstead of unquoted word splitting.arg from pyright invocations in Makefile and pre-commit hook (overridespyproject.tomlinclude/exclude, causing 17k+ errors from scanning.venv), and excludetest_*.pyfrom strict type-checkingTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
Refactor
Configuration