From 6f9ab0f7da490904b327739a4d0904a433aa1c3b Mon Sep 17 00:00:00 2001 From: AhFei Date: Thu, 29 Jan 2026 12:50:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20cloc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- justfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/justfile b/justfile index 8780c18..7c96c2b 100644 --- a/justfile +++ b/justfile @@ -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 管理命令 ===