fix: require mutation expression when using --in-place#7
Conversation
Validates that the expression is a mutation (contains =, |=, del, etc.)
before allowing --in-place. This prevents silent data loss when users
accidentally use query expressions like `. + {}` instead of `. += {}`.
Users must use proper jq mutation syntax:
- `.field = value`
- `. += {field: value}`
- `del(.field)`
PR Review: Require mutation expression when using --in-placeSummaryThis PR adds important validation to prevent data loss when using the Code Quality and Best PracticesPositives:
Suggestions:
Potential Bugs or IssuesEdge Cases in
Test CoverageStrengths:
Suggestions:
Performance and Security
Overall AssessmentThis is a well-implemented safety feature. Main recommendations:
The PR is ready to merge after addressing the comparison operators issue. Great work on improving user safety! |
Validates that the expression is a mutation (contains =, |=, del, etc.) before allowing --in-place. This prevents silent data loss when users accidentally use query expressions like
. + {}instead of. += {}.Users must use proper jq mutation syntax:
.field = value. += {field: value}del(.field)