pyrefly
pyrefly copied to clipboard
Fix singular and plural in summary
Computers are really bad at some things, but one thing they're really good at is counting :)
So let's replace:
INFO 0 errors shown, 0 errors ignored, 1 modules, 65 transitive dependencies, 18,208 lines, took 0.10s, peak memory physical 76 MiB
With:
INFO 0 errors shown, 0 errors ignored, 1 module, 65 transitive dependencies, 18,208 lines, took 0.57s, peak memory physical 89.3 MiB
I'm mixed on this overall, I generally prefer these types of outputs to have exact same text and only the numbers differ, because then it's easier to do some find/replace or regex to turn it into a CSV.
These days you could probably feed it to an LLM to extract the numbers, so maybe it's no big deal.
This is human-readable output, intended for humans to read, not machine-readable JSON or other format. If someone does want to parse these, it's not too difficult either.
By the same token, you may at some point want to change this summary for other reasons, like adding or removing more info. This could also cause problems with parsing the output, but that shouldn't stop you.
Here's a couple of other tools that do human output:
# git
1 file changed, 1 insertion(+), 2 deletions(-)
...
55 files changed, 1364 insertions(+), 866 deletions(-)
# mypy
Success: no issues found in 1 source file
...
Success: no issues found in 6 source files
Alternatively, it could be rewritten:
INFO errors shown: 0, errors ignored: 0, modules: 1, transitive dependencies: 65, lines: 18,208, took 0.10s, peak memory physical 76 MiB
@yangdanny97 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
I like the idea of flipping the order - then the benefits @yangdanny97 mentioned are there without the grammatical error. It also keeps the code more concise
Thanks, order flipped.
@yangdanny97 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@yangdanny97 merged this pull request in facebook/pyrefly@e6d566be7e2c860872fe757a16edcef26df60ada.
Thanks for your contribution @hugovk :)