【发布时间】:2018-03-17 13:02:27
【问题描述】:
我在 64 位 PC 上使用 Windows 10。最近,我开始在 Windows 上使用 VS Code 和 Ubuntu Bash。除了掉毛,一切都很好。我试图让它与 pylint 和 pep8 一起工作,但它们都不起作用。我认为问题是由于 linter 的位置引起的。但是,我不知道如何解决这个问题。您可以检查我的 pylint 设置:
// Whether to lint Python files using pylint.
"python.linting.pylintEnabled": true,
// Severity of Pylint message type 'Convention/C'.
"python.linting.pylintCategorySeverity.convention": "Information",
// Severity of Pylint message type 'Refactor/R'.
"python.linting.pylintCategorySeverity.refactor": "Hint",
// Severity of Pylint message type 'Warning/W'.
"python.linting.pylintCategorySeverity.warning": "Warning",
// Severity of Pylint message type 'Error/E'.
"python.linting.pylintCategorySeverity.error": "Error",
// Severity of Pylint message type 'Fatal/F'.
"python.linting.pylintCategorySeverity.fatal": "Error",
// Path to Pylint, you can use a custom version of pylint by modifying this
// setting to include the full path.
"python.linting.pylintPath": "pylint",
// Arguments passed in. Each argument is a separate item in the array.
"python.linting.pylintArgs": [],
如果有任何帮助,我将不胜感激。谢谢...
【问题讨论】:
-
“Bash on Windows”又名 WSL 是一个命令行环境。在其中使用 GUI 编辑器(VS Code)有什么意义?无论如何,主机 Windows 和“bash”容器共享的文件夹的路径以 /mnt/c (或其他驱动器号)开头,是的,您需要在 Windows 和 bash 端使用不同的路径。 RTFM。
-
@ddbug 感谢您的评论。 VS Code 是适用于任何编程语言的代码编辑器。我正在使用 bash 通过编辑器编译代码。但是,linter 已经安装在 bash 中。因此,我不需要 /mnt/c 在 Windows 中访问我的文档。我试过 "C:\\Users\\user\\AppData\\Local\\lxss\rootfs\\usr\bin\\pylint" 但也没有用。
标签: python visual-studio-code vscode-settings windows-subsystem-for-linux bash-on-windows