Repository navigation
feat: add shell simplification option - #143
Conversation
🦋 Changeset detectedLatest commit: 77b64bc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe print API adds a ChangesShell syntax simplification
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant TypeScriptProcessor
participant GoProcess
participant Printer
participant SyntaxSimplify
TypeScriptProcessor->>GoProcess: Pass simplify option
GoProcess->>Printer: Set PrinterOptions.Simplify
Printer->>SyntaxSimplify: Simplify file when Simplify or Minify is enabled
SyntaxSimplify-->>Printer: Return simplified syntax tree
Printer-->>TypeScriptProcessor: Return printed output
Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue was identified. The focused test remains unrun because dependencies are unavailable, so verify it in the normal project environment. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 golangci-lint (2.13.2)level=error msg="[linters_context] typechecking error: build constraints exclude all Go files in " 🔧 ESLint
src/processor.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. src/types.tsESLint skipped: the matched ESLint configuration already failed (missing-dependency). test/basic.spec.tsESLint skipped: the matched ESLint configuration already failed (missing-dependency). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
size-limit report 📦
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #143 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 76 77 +1
Branches 29 30 +1
=========================================
+ Hits 76 77 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|



Adds an opt-in
simplifyprint option backed bymvdan/sh/syntax.Simplify.The option is carried through the TypeScript API and WASM boundary, applied after parsing and before printing, and enabled implicitly by
minifyto match shfmt behavior. The committed WASM artifact and focused coverage are updated.This enables downstream formatters such as
prettier-plugin-shto expose mvdan's syntax simplification without invoking the shfmt CLI.Validation:
yarn buildyarn testyarn lintSummary by CodeRabbit
simplifyprint option that removes redundant shell syntax. It is disabled by default and can be used alongside existing print options.