Skip to content

refactor: add line counting command for Verus source files - #41

Merged
rikosellic merged 3 commits into
asterinas:mainfrom
Marsman1996:fix-count_line
Aug 18, 2026
Merged

refactor: add line counting command for Verus source files#41
rikosellic merged 3 commits into
asterinas:mainfrom
Marsman1996:fix-count_line

Conversation

@Marsman1996

Copy link
Copy Markdown
Collaborator

No description provided.

@Marsman1996

Copy link
Copy Markdown
Collaborator Author

Since xinyi is busy writing paper, maybe you can try this to see whether count_line works for you.
@hiroki-chen

@Marsman1996
Marsman1996 requested a review from rikosellic August 18, 2026 02:15
@rikosellic

Copy link
Copy Markdown
Collaborator

Is this based on the new line-count?

@Marsman1996

Marsman1996 commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator Author

Is this based on the new line-count?

It is based on the new version of line-count (exactly this one)

@rikosellic

Copy link
Copy Markdown
Collaborator

It works, but we may make the interaction nicer. I've run cargo dv verify --count-line, and the terminal output will print every line of the entire project, which is very noisy and flushes the verification result. Can we silence the line-level output and only reserve the file-level table at the end in this case?

If the line-level output is useful in some cases, we may add a cargo dv count function and add an option to decide whether the lines will be printed.

@Marsman1996

Copy link
Copy Markdown
Collaborator Author

It works, but we may make the interaction nicer. I've run cargo dv verify --count-line, and the terminal output will print every line of the entire project, which is very noisy and flushes the verification result. Can we silence the line-level output and only reserve the file-level table at the end in this case?

If the line-level output is useful in some cases, we may add a cargo dv count function and add an option to decide whether the lines will be printed.

It's because in the original version it adds the --print-all arg, and I keep it.
Just add an option for it will work.

@Marsman1996

Copy link
Copy Markdown
Collaborator Author

Actually for a large scale project like VOSTD, I do not think this --print-all option useful 🤔

@rikosellic

rikosellic commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Actually for a large scale project like VOSTD, I do not think this --print-all option useful 🤔

Indeed, we can delete this option.

@rikosellic

Copy link
Copy Markdown
Collaborator

Another question: cargo dv verify --targets ostd --count-line -- --verifyonly-module sync::rwlock will also count the whole project. It may be better to remove the count-line option in verify and add a dedicated cargo dv count so that we can handle the module counting properly there.

@Marsman1996

Copy link
Copy Markdown
Collaborator Author

cargo dv verify --targets ostd --count-line -- --verifyonly-module sync::rwlock will also count the whole project.

This is caused by line_count reads the generated .d dependency file, which includes the file information of the whole crate.

Maybe I shall use the folder scan feature added in the new count line for the folder I guess.

@Marsman1996

Copy link
Copy Markdown
Collaborator Author

@rikosellic Now it works

@Marsman1996 Marsman1996 changed the title fix: re-enable count_line refactor: add line counting command for Verus source files Aug 18, 2026
@rikosellic

Copy link
Copy Markdown
Collaborator

It works very well! Thanks!

@rikosellic
rikosellic merged commit f601298 into asterinas:main Aug 18, 2026
1 check passed
@rikosellic

Copy link
Copy Markdown
Collaborator

Please also sync this in vostd.

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