【发布时间】:2021-02-05 11:44:34
【问题描述】:
我正在使用 flake8(带有 flakehell 但不应该干扰)并将其配置保存在 pyproject.toml 文件中。我想添加一个per-file-ignores 配置,但没有任何效果,也没有关于它应该如何在 toml 文件中格式化的文档。
Flake8 docs 仅显示“本机”配置文件格式:
per-file-ignores =
project/__init__.py:F401
setup.py:E121
other_project/*:W9
pyproject.toml 没有描述/示例。
我试过了:
per-file-ignores=["file1.py:W0621", "file2.py:W0621"]
和
per-file-ignores={"file1.py" = "W0621", "file2.py" = "W0621"}
两者都静默失败并且没有效果(警告仍然出现)。
在使用 pyproject.toml 时,在 flake8/flakehell 中设置每个文件忽略设置的正确语法是什么?
【问题讨论】:
标签: python configuration lint flake8