pyrefly icon indicating copy to clipboard operation
pyrefly copied to clipboard

Incorrect number of lines reported in INFO

Open rosmur opened this issue 7 months ago • 5 comments

Describe the Bug

When checking with uvx pyrefly check, the reported number of lines (eg: 180400) is far larger than number of lines in my source code. It is likely including in this number everything in the venv.

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

rosmur avatar May 17 '25 20:05 rosmur

It is indeed reporting the entire venv, since it is checking everything in the venv. This makes sense in terms of how much work Pyrefly did, which is why we were initially displaying. I guess you were hoping to see how many lines are in your code?

ndmitchell avatar May 18 '25 19:05 ndmitchell

I guess you were hoping to see how many lines are in your code?

Yep correct

I guess you were hoping to see how many lines are in your code?

Hmm, isn't it ignoring the venv by default?

Also, the modules reported are correct (dont include the venv) but the lines aren't, thus there's an internal inconsistency (example attached). Image Reporting the N lines of your project code that pyrefly went over is what the user would care about more?

rosmur avatar May 19 '25 01:05 rosmur

Would it be better if we clarify the message of "XXX lines" to "XXX lines in transitive dependencies"? Or do you want us to report "XXX lines in my project" as well?

grievejia avatar May 19 '25 14:05 grievejia

Maybe the format could be like:

7 modules (XXX lines), 492 transitive dependencies (180,400 lines)

yangdanny97 avatar May 20 '25 17:05 yangdanny97

yeah that looks good! I'd propose a minor modification for readability like:

SOURCE CODE: x modules, y lines
TRANSITIVE DEPENDENCIES: x models, y lines

rosmur avatar May 26 '25 03:05 rosmur

Hello, new contributor here, I’d like to attempt this issue!

zriser avatar Jul 23 '25 02:07 zriser

Assigned, thanks! Let us know if you have questions or need any assistance.

yangdanny97 avatar Jul 23 '25 03:07 yangdanny97

Will do, thank you!

zriser avatar Jul 23 '25 10:07 zriser

I see the log line has changed a bit since the initial issue was created, and would like some feedback on the preferred verbiage before I begin prepping a PR. At the moment I have it generating: INFO 4 modules (269 dependent modules); 82,204 lines (17 lines in your project, 82,187 lines in dependencies); took 1.84s; memory (physical 173.7 MiB)

zriser avatar Aug 01 '25 22:08 zriser