python - 禁用所有 flake8-doc-strings 检查
问题描述
我在一个项目中使用wemake-python-styleguide linter。我有一个项目范围的setup.cfg
文件,如下所示:
[flake8]
# Base flake8 configuration:
format = wemake
show-source = True
statistics = True
doctests = False
# Plugins:
min-name-length = 1
max-returns = 2
max-arguments = 4
max-complexity = 6
max-line-length = 80
# Self settings:
max-imports = 16
# Excluding some directories:
exclude =
.git
__pycache__
.venv
.eggs
*.egg
.idea
# Exclude some violation checks globally:
ignore =
# WPS305: Found `f` string
WPS305
# WPS336 Found explicit string concat
WPS336
# Q000 Remove bad quotes -> ""
Q000
# WPS421 Found wrong function call
WPS421
我想禁用对文档字符串的所有检查。我知道我可以使用错误代码,但列表很长。
有没有办法关闭特定flake8
插件,在我的情况下,flake8-docstrings
插件?
据我所知,没有办法在setup.cfg
.
解决方案
您可以使用前缀忽略所有代码
您当前有一个ignore =
设置,您可以将D
(的代码flake8-docstrings
)添加到该设置
我还建议使用extend-ignore
over ,ignore
因为这将保留默认的忽略内容集(包括一些冲突的默认规则(W504/W503))
免责声明:我是 flake8 和 flake8-docstrings 的当前维护者
推荐阅读
- node.js - 无法从数字海洋中的外部 ip 访问 nodejs
- gradle - 使用 Gradle 和 Kotlin 在预编译脚本中应用插件
- python - 无法让我的脚本自动生成几个值以在有效负载中使用
- python - 从 Azure 中的托管标识生成的访问令牌如何与 Python SDK 一起使用?
- ios - 在 UITextView 中键入带有图像的属性文本
- javascript - 让 compare() 函数更优雅
- sql - 如何将十进制数限制为 3 位作为约束检查(SQL)
- g1ant - g1ant 机器人中的方向键或导航键的名称是什么?
- php - 即使我可以看到数组输出,PHP Array Undefined index 也会出现错误问题
- python - 使用具有全局上下文的 GradientTape