Fix variable scoping and quoting issues in systemd.zsh#25
Conversation
- Add local declarations to SCOPE and STATE in _sysls() - Add local declarations to all variables in _sysexec() - Remove dead code (echo $HI) - Quote $full_cmd in eval and print -s commands Fixes #16 Co-authored-by: Scott Hyndman <shyndman@users.noreply.github.com>
Pull Request ReviewThanks for this PR! This is a solid fix that addresses important shell scripting best practices. Here's my detailed review: ✅ What's Done Well
🔍 Code QualityExcellent improvements:
|
Code Review: Fix variable scoping and quoting issues in systemd.zshSummaryThis PR addresses important shell scripting best practices by adding proper variable scoping and quoting. The changes are solid and fix real issues that could cause bugs in production. Strengths
Code Quality ObservationsGood:
Minor considerations:
Potential IssuesNone identified - The changes are straightforward improvements with no apparent downsides. Security ConsiderationsThe quoting changes actually improve security:
PerformanceNo impact - The local declarations and quoting have negligible performance overhead. Test CoverageObservation: The repository does not appear to have automated tests for rc.d scripts. Given this is a shell configuration framework, manual testing is appropriate. However, consider:
Recommendations
Final VerdictApproved - This is a quality improvement that fixes legitimate issues without introducing new problems. The code is cleaner, safer, and follows shell scripting best practices. Ready to merge. Review conducted by Claude Code |
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #16 by fixing variable scoping and quoting issues in the systemd.zsh configuration file. The changes improve code quality and prevent potential variable pollution in the global scope.
Key Changes
- Added proper
localdeclarations to all function-scoped variables in_sysls()and_sysexec() - Removed dead code (
echo $HI) - Fixed quoting of
$full_cmdin bothevalandprint -scommands for safer command execution
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #16
@claude