Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix --stdin append newline #232

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

phanen
Copy link

@phanen phanen commented Jan 13, 2025

Regression of 60f7953.

reproduce

echo "hello你好" | cargo run -q -- --stdin

Expected:

hello 你好

Result:

hello 你好

@huacnlee
Copy link
Owner

huacnlee commented Jan 13, 2025

This is bug, but it looks like not fixed by this change, this is not the right way to solve same issue.

@phanen
Copy link
Author

phanen commented Jan 14, 2025

Weird, it works on my machine, then how about now? I just silent the println cause the issue.

Result of make test:stdin:

hello 你好
{"count": 1,"messages": [{"filepath":"<STDIN>","lines":[{"l":1,"c":1,"new":"hello 你好","old":"hello你好","severity":1}],"error":""}]}
.<STDIN>:1:1
-hello你好
+hello 你好


Error: 1, Warning: 0
AutoCorrect spend time: 398.284ms

make: *** [Makefile:25: test:stdin] Error 1

Sorry again if I do something wrong. But I think that's easy and quick one-line fix. It would be better if log never print to stdout when people just do piping to get result of --stdin mode, that's why I just set --quiet before.

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