cloc(Count Lines of Code)是一款常用的统计代码量的工具,它能统计多种编程语言的代码行数
安装cloc
如果你使用的是 macOS 系统,可以通过 Homebrew 进行安装:
brew install cloc
MacBook-Pro ~ % brew install cloc
==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
ktexttemplate
==> New Casks
pastenow
You have 1 outdated formula installed.
==> Downloading https://ghcr.io/v2/homebrew/core/cloc/manifests/2.04
######################################################################### 100.0%
==> Fetching cloc
==> Downloading https://ghcr.io/v2/homebrew/core/cloc/blobs/sha256:b8283f66cc2a2
######################################################################### 100.0%
==> Pouring cloc--2.04.arm64_sequoia.bottle.tar.gz
🍺 /opt/homebrew/Cellar/cloc/2.04: 116 files, 1.9MB
==> Running `brew cleanup cloc`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
MacBook-Pro tech_code % cloc service
8166 text files.
4734 unique files.
9324 files ignored.
github.com/AlDanial/cloc v 2.04 T=10.48 s (451.7 files/s, 112832.1 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
JavaScript 1153 68561 87529 452892
Java 1844 43994 26356 168310
DOS Batch 1 8 14 13
Dockerfile 1 4 3 10
-------------------------------------------------------------------------------
SUM: 4734 132967 123431 926062
-------------------------------------------------------------------------------