cargo-warloc
: Rust 项目代码统计工具
软件项目中的代码行数统计这块儿,已经有很多优秀的工具了。例如,在 Github 上拥有 20k+ 星标的老牌代码行数统计工具 cloc
(https://github.com/AlDanial/cloc)。今天介绍的这款 cargo-warloc
是使用 Rust 开发的,并且专门针对 Rust 项目统计的。除了可以统计代码的行数,还可以统计文档、测试、示例等相关数据。例如,对 cargo
这个项目的统计信息如下:
File count: 1188
Type | Code | Blank | Doc comments | Comments | Total
-------------|--------------|--------------|--------------|--------------|-------------
Main | 82530 | 9682 | 12625 | 6220 | 111057
Tests | 144421 | 20538 | 588 | 10151 | 175698
Examples | 169 | 27 | 5 | 19 | 220
-------------|--------------|--------------|--------------|--------------|-------