尝试更改 Ruff 默认线条长度

问题描述 投票:0回答:1

最近我向 Ruff 介绍了一个 python linter。我有一个包含大量文件的现有目录。我想尝试一下,并在目录中创建了一个 pyproject.toml 文件。我想将行长设置为高(150)以显示更少的错误,但默认值(88)不断出现。我还尝试了忽略选项,但这似乎也不起作用。我需要输入命令来启动 pyproject.toml 的使用吗?

来自 pyproject.toml 的代码

[tool.ruff]
extend-select = ["C4", "NPY", "PD", "SIM", "TCH"]
ignore = ["E501"]
show-fixes = true
# target-version = "py310"

# change the default line length number or characters.
line-length = 150

另一种选择是让 linter 忽略行长度。

python-3.x lint ruff
1个回答
0
投票

line-length
更改为
max-line-length
解决了我的问题。

# change the default line length number or characters.
max-line-length = 150
© www.soinside.com 2019 - 2024. All rights reserved.