繁体   English   中英

如何运行 cloc 来检查一个目录(包括子目录)的所有 python 文件,但忽略任何带有迁移一词的子目录?

[英]How do I run cloc to check all python files of a directory including subdirectories but ignore any subdirectories that have the word migrations?

我使用 brew 安装了 cloc。

我喜欢检查 Django 项目的代码行数。

我绝对不想计算那些在迁移中并且只限于 python 文件的。

我试过cloc --not-match-d=migrations --include-lang=python . cloc --not-match-d=migrations --include-lang=py . 在项目根目录下,但它们被忽略了。

这是结果:

± cloc --not-match-d=migrations --include-lang=python .
   18714 text files.
   13100 unique files.
   18771 files ignored.

你快到了...语言名称区分大小写。 这应该工作

cloc --not-match-d=migrations --include-lang=Python .

语言名称必须与cloc --show-lang的条目之一匹配。 如果名称中有空格,请将其用引号括起来,例如--include-lang="Visual Basic"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM