Skip to content

Conversation

@miparnisari
Copy link
Contributor

@miparnisari miparnisari commented Dec 29, 2025

Now the command works correctly in all scenarios:

  1. zed schema compile file.zed → writes to stdout
  2. zed schema compile file.zed 1> out.txt → writes to redirected stdout
  3. zed schema compile file.zed --out out.txt → writes to specified file

Previously, number 2 didn't work.

@miparnisari miparnisari marked this pull request as ready for review December 29, 2025 18:24
@codecov-commenter
Copy link

codecov-commenter commented Dec 29, 2025

Codecov Report

❌ Patch coverage is 70.37037% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.35%. Comparing base (74c5e66) to head (c089234).

Files with missing lines Patch % Lines
internal/cmd/schema.go 70.37% 5 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #613      +/-   ##
==========================================
+ Coverage   41.18%   41.35%   +0.16%     
==========================================
  Files          38       38              
  Lines        4987     4998      +11     
==========================================
+ Hits         2054     2067      +13     
  Misses       2684     2684              
+ Partials      249      247       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@miparnisari miparnisari force-pushed the fix-schema-compile-and-write branch from 1604df9 to c089234 Compare December 29, 2025 18:29
@miparnisari miparnisari changed the title fix: #612 fix: schema compilation (#612) Dec 29, 2025
@miparnisari miparnisari enabled auto-merge (squash) December 29, 2025 18:29
Copy link
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

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

Seems fine but see comment

Comment on lines -371 to -372
if outputFilepath == "" && !termChecker.IsTerminal(stdOutFd) {
return errors.New("must provide stdout or output file path")
Copy link
Contributor

Choose a reason for hiding this comment

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

If we don't have this do we get weird behavior in environments that don't have stdout available? Or is that captured by the error behavior of writing to os.Stdout?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's captured by the call to fmt.Fprint.

@miparnisari miparnisari merged commit b7d11ff into main Dec 29, 2025
12 checks passed
@miparnisari miparnisari deleted the fix-schema-compile-and-write branch December 29, 2025 18:49
@github-actions github-actions bot locked and limited conversation to collaborators Dec 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants