prettier-cli icon indicating copy to clipboard operation
prettier-cli copied to clipboard

Running the CLI inside of a Github action triggers an stdin warning

Open janpieterz opened this issue 1 year ago • 8 comments

See the run here.

Run npx prettier --write . Error: UndefinedParserError: No parser could be inferred for file "stdin". Error: Process completed with exit code 1.

Looks like something is falsy around this detection of TTY on GitHub runners (we've ran into other odd issues with that but I am struggling to find a quick fix).

janpieterz avatar Jun 26 '24 23:06 janpieterz

Looks like this pull request fixes running it - based off of this GitHub Actions thread.

janpieterz avatar Jun 26 '24 23:06 janpieterz

I'm seeing this on my computer as of the last alpha version update.

mareksuscak avatar Aug 07 '24 16:08 mareksuscak

Does anyone have a repro that I can try locally? 🤔 "npx prettier --write ." doesn't do it for me.

fabiospampinato avatar Sep 01 '24 22:09 fabiospampinato

This commit should fix it in the next release.

fabiospampinato avatar Sep 01 '24 23:09 fabiospampinato

@fabiospampinato happy to help test this fix. Is there a pre-release available on npm yet?

mareksuscak avatar Sep 02 '24 10:09 mareksuscak

@mareksuscak not yet, but I've asked the maintainers to make a new release, it shouldn't take too long.

fabiospampinato avatar Sep 02 '24 10:09 fabiospampinato

@mareksuscak alpha10 just got released

fabiospampinato avatar Sep 03 '24 06:09 fabiospampinato

@mareksuscak could you check if this fixes the issue for you? Thanks.

fabiospampinato avatar Sep 03 '24 18:09 fabiospampinato

@fabiospampinato alpha10 works for us (on GitHub runner) 🎉

janpieterz avatar Nov 24 '24 16:11 janpieterz

Awesome, thanks for confirming 👍

fabiospampinato avatar Nov 24 '24 18:11 fabiospampinato