Skip to content

Don't output stdin on errors πŸ™‹β€β™‚οΈ - #300

Open
thatch wants to merge 1 commit into
omnilib:mainfrom
thatch:thatch/stdin-no-write
Open

thatch wants to merge 1 commit into
omnilib:mainfrom
thatch:thatch/stdin-no-write

Conversation

@thatch

@thatch thatch commented Apr 25, 2026

Copy link
Copy Markdown
Member

With test. I'm not sure if diff makes sense to keep though.

@thatch
thatch marked this pull request as ready for review April 25, 2026 14:44
@thatch
thatch force-pushed the thatch/stdin-no-write branch from 66ed902 to a2e6ca2 Compare May 15, 2026 03:33
@thatch thatch changed the title Don't write to stdout when ufmt_stdin encounters a formatting error Don't output stdin on errors πŸ™‹β€β™‚οΈ May 15, 2026
@thatch
thatch force-pushed the thatch/stdin-no-write branch from a2e6ca2 to b919656 Compare May 15, 2026 03:36
With test.  I'm not sure if diff makes sense to keep though.
@thatch
thatch force-pushed the thatch/stdin-no-write branch from b919656 to d967ccc Compare May 15, 2026 03:38
@amyreese

Copy link
Copy Markdown
Member

My concern with this is user tooling that doesn't check the exit code when formatting stdin, and just blindly takes the resulting code and writes it to wherever. I'd rather the tool output unchanged original content along with an exit code than have workflows accidentally erase the entire file because they didn't check exit codes. Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants