【问题标题】:How do I run cloc to check all python files of a directory including subdirectories but ignore any subdirectories that have the word migrations?如何运行 cloc 来检查目录的所有 python 文件,包括子目录,但忽略任何包含迁移一词的子目录?
【发布时间】:2021-06-25 02:39:03
【问题描述】:

我使用 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.

【问题讨论】:

    标签: python cloc


    【解决方案1】:

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-17
      • 2011-02-21
      • 2021-01-05
      • 2023-01-04
      • 2014-12-04
      • 1970-01-01
      • 2014-01-07
      • 2018-05-02
      相关资源
      最近更新 更多