【发布时间】:2023-01-12 20:48:00
【问题描述】:
我正在为我的 Django 项目使用 pylint_django。我想禁用 print 语句使用或至少警告它。因为我正在使用自定义记录器类。但是没有任何关于打印使用的警告。
extension-pkg-whitelist=
ignore=CVS
ignore-patterns=
jobs=1
limit-inference-results=100
load-plugins=
persistent=yes
suggestion-mode=yes
unsafe-load-any-extension=no
[MESSAGES CONTROL]
confidence=
disable=missing-docstring,
invalid-name,
astroid-error,
protected-access,
broad-except
enable=c-extension-no-member, print-statement
[REPORTS]
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
output-format=text
reports=no
score=yes
[REFACTORING]
max-nested-blocks=5
never-returning-functions=sys.exit
[LOGGING]
logging-format-style=old
logging-modules=logging
....
我该如何解决这个问题?
VsCode 设置.json
{
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.linting.flake8Enabled": false,
"python.linting.prospectorEnabled": false,
"python.linting.pylintArgs": [
"--load-plugins=pylint_django",
"--rcfile=.pylintrc",
"--enable=print-statement"
]
}
【问题讨论】: