gpt4 book ai didi

python - pep8 警告 8 空格缩进

转载 作者:太空宇宙 更新时间:2023-11-03 11:24:50 29 4
gpt4 key购买 nike

这段代码:

def foo():
print("hello")

违反PEP 0008 , 说明

Use 4 spaces per indentation level.

但是 pep8pyflakesflake8 命令都没有发出警告。

我怎样才能让他们中的一个人提示这个非 Python 代码?

最佳答案

pylint会警告这种违规行为:

$ pylint test.py
No config file found, using default configuration
************* Module test
W: 2, 0: Bad indentation. Found 8 spaces, expected 4 (bad-indentation)

请注意,pep8 只会在 缩进 is not a multiple of four 时警告您(E111 错误代码)。

关于python - pep8 警告 8 空格缩进,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36184142/

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