改进 cloc
All checks were successful
ci/woodpecker/push/ci-test Pipeline was successful

This commit is contained in:
2026-01-29 12:50:47 +08:00
parent 5a39d2e185
commit 6f9ab0f7da

View File

@@ -20,9 +20,13 @@ machine_ip := `ip -4 addr show scope global | grep -oP '(?<=inet\s)\d+(\.\d+){3}
@amend:
cd "{{root}}" && git add . && git commit --amend || (git restore --staged . && false)
# 统计代码量
cloc:
cd {{invocation_directory()}} && git ls-files | xargs cloc
# 统计代码量(支持文件名包含空格)
cloc range="":
cd {{invocation_directory()}} && git ls-files -z \
| grep -z -v -E '\.(g|freezed)\.dart$' \
{{ if range != "all" { "| grep -z -v '^test/'" } else { "" } }} \
| xargs -0 cloc
# === just 管理命令 ===