[英]How do I identify all .txt files in a directory and subdirectories in 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.