gpt4 book ai didi

python - 排除名称中带有空格的整个目录

转载 作者:行者123 更新时间:2023-12-01 08:49:43 25 4
gpt4 key购买 nike

我有一个名为“Old stuff”的目录,我希望 flake8 不在该目录中检查代码。

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

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

我在我的 .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

最佳答案

要让 flake8 忽略带有空格的目录,可以使用以下语法:

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

对于命令行:

flake8 --exclude=Old*stuff

关于python - 排除名称中带有空格的整个目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53176371/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com