numtide / treefmt

one CLI to format your repo
https://treefmt.com
MIT License
534 stars 32 forks source link

fix: --stdin flag #313

Closed brianmcgee closed 4 weeks ago

brianmcgee commented 1 month ago

This was incorrectly ported from Rust to Go.

When --stdin is provided, treefmt will copy stdin into a temporary file, using the first path argument as the filename. This allows the user to control which formatters will match this temp file based on their treefmt config.

After the formatters have been applied, the contents of this temporary file are then printed to stdout and the temp file is removed.

Closes #https://github.com/numtide/treefmt/issues/310

Signed-off-by: Brian McGee brian@bmcgee.ie

brianmcgee commented 4 weeks ago

@mergify queue

mergify[bot] commented 4 weeks ago

queue

🛑 The pull request has been removed from the queue default

The pull request #313 has been manually updated. You can take a look at `Queue: Embarked in merge queue` check runs for more details. In case of a failure due to a flaky test, you should first retrigger the CI. Then, re-embark the pull request into the merge queue by posting the comment `@mergifyio refresh` on the pull request.
brianmcgee commented 4 weeks ago

@mergifyio refresh

mergify[bot] commented 4 weeks ago

refresh

✅ Pull request refreshed