huacnlee / autocorrect

A linter and formatter to help you to improve copywriting, correct spaces, words, and punctuations between CJK (Chinese, Japanese, Korean).
https://huacnlee.github.io/autocorrect
MIT License
894 stars 31 forks source link

--fix 时的 print 占用太多时间 #187

Closed cathaysia closed 3 months ago

cathaysia commented 4 months ago

--fix 时会自动打印一行

.

AutoCorrect spend time: 21.413ms

这个在使用脚本批量格式化文件时会打印过多的 log,并且导致程序运行很慢。

目前 clang-format 等格式化器在格式化成功时不会打印消息。autocorrect 是否也应该考虑这种做法。或者是当 -vv 标志时打开时才打印log。

huacnlee commented 4 months ago

https://github.com/huacnlee/autocorrect/releases/tag/v2.9.1

cathaysia commented 4 months ago

现在虽然不会打印 . 了,但是依然会打印:

AutoCorrect spend time: 21.139ms

一共是两行 log

huacnlee commented 4 months ago

这个是需要的,否则是否执行成功完全无法知道,我看过其他的一些工具,他们的结果都有打印。

花时间的地方不是这个打印

cathaysia commented 4 months ago

https://github.com/huacnlee/autocorrect/assets/42114817/427629e6-8b8b-41df-992f-bc10e6ad1c2d

clang-forma 这种看起来并不会打印一条耗时。而且打印耗时感觉很奇怪。

image

这个地方文件太多就会导致滚屏

huacnlee commented 4 months ago

好的,我懂你的场景问题了,我调整一下