【问题标题】:Exclude entire directory with whitespace in name排除名称中带有空格的整个目录
【发布时间】:2019-04-10 02:38:20
【问题描述】:

我有一个名为“旧东西”的目录,我希望 flake8 不在此目录中检查代码。

排除它的正确语法是什么?

我查看了用于配置 flake8 的 documentation,但没有找到我想要的。

我在我的.flake8 文件中尝试过:

[flake8]
max-line-length = 99
exclude =
    # Don't check the Old directories
    # Attempt 1
    Old\ stuff
    # Attempt 2
    "Old stuff"
    # Attempt 3
    /Old stuff/
    # Attempt 4
    ./Old stuff/
    # Attempt 5
    /Old\ stuff/

这些语法都不起作用。

在命令行中尝试排除时出现同样的问题:

flake8 --exclude=Old\ stuff

【问题讨论】:

    标签: python flake8 linter


    【解决方案1】:

    要让flake8 忽略带有空格的目录,此语法有效:

    [flake8]
    max-line-length = 99
    exclude =
        # Don't check the Old directories
        Old*stuff
    

    对于命令行:

    flake8 --exclude=Old*stuff
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-20
      • 2019-04-02
      • 1970-01-01
      • 2014-08-20
      • 2012-08-15
      • 1970-01-01
      • 2016-02-27
      • 2013-08-21
      相关资源
      最近更新 更多