不多说,多说也说不明白,直接上配置吧
{
"files.associations": {
"*.spec": "properties"
},
// 配置cmder为默认terminal
"terminal.integrated.shell.windows": "cmd.exe",
"terminal.integrated.shellArgs.windows": [
"/k",
"D:\\cmder\\vendor\\init.bat"
],
"python.dataScience.askForKernelRestart": false,
"git.autofetch": true,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"files.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true
},
// java/maven配置
"java.home": "D:\\Java\\jdk1.8.0_202",
"maven.executable.path": "D:\\apache-maven-3.6.3\\bin\\mvn",
"java.configuration.maven.userSettings": "D:\\apache-maven-3.6.3\\conf\\settings.xml",
"maven.terminal.customEnv": [
{
"environmentVariable": "JAVA_HOME",
"value": "D:\\Java\\jdk1.8.0_202"
}
],
// 图标
"workbench.iconTheme": "vscode-icons",
// 同步配置
"sync.autoUpload": true,
"sync.gist": "6e1953e9fb1bbe112ddaab239db4f925",
"sync.quietSync": true,
"sync.autoDownload": true,
"python.jediEnabled": false,
"sqltools.connections": [],
// python配置
"[python]": {
"editor.defaultFormatter": "ms-python.python"
},
"python.linting.flake8Enabled": true,
"cornflakes.linter.executablePath": "D:\\Python37\\Scripts\\flake8.exe",
"vsintellicode.features.python.deepLearning": "enabled",
"python.linting.flake8Path": "D:\\Python37\\Scripts\\flake8.exe",
"extensions.ignoreRecommendations": false,
"python.testing.unittestArgs": [
"-v",
"-s",
".",
"-p"
],
"python.testing.autoTestDiscoverOnSaveEnabled": false,
"python.testing.promptToConfigure": false,
"liveServer.settings.donotShowInfoMsg": true,
"git.path": "D:\\Program Files\\Git\\bin\\git.exe",
// vscode默认启用了根据文件类型自动设置tabsize的选项
"editor.detectIndentation": false,
// 重新设定tabsize
"editor.tabSize": 2,
//autoFixedOnSave 设置已废弃,采用如下新的设置
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.format.enable": true,
//autoFix默认开启,只需输入字符串数组即可
"eslint.validate": [
"javascript",
"vue",
"html"
],
// #去掉代码结尾的分号
"prettier.semi": false,
// #使用带引号替代双引号
"prettier.singleQuote": true,
// #让函数(名)和后面的括号之间加个空格
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
// #这个按用户自身习惯选择
"vetur.format.defaultFormatter.html": "js-beautify-html",
// #让vue中的js按编辑器自带的ts格式进行格式化
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "force-aligned"
// #vue组件中html代码格式化样式
}
},
// 格式化stylus, 需安装Manta's Stylus Supremacy插件
"stylusSupremacy.insertColons": false, // 是否插入冒号
"stylusSupremacy.insertSemicolons": false, // 是否插入分好
"stylusSupremacy.insertBraces": false, // 是否插入大括号
"stylusSupremacy.insertNewLineAroundImports": false, // import之后是否换行
"stylusSupremacy.insertNewLineAroundBlocks": false,
"python.autoComplete.addBrackets": true,
"python.globalModuleInstallation": true,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"html.format.endWithNewline": true,
"html.format.indentInnerHtml": true // 两个选择器中是否换行
}
在vscode中运行python,会出现导入自己的包报错的问题
该问题是:py文件中右键“在终端中运行python文件”
我们抛弃这种方式,改为F5来跑,需要在launch.json中加入一行
“env”: {“PYTHONPATH”:"${workspaceRoot}"}
最终如下:
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: 当前文件",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"env": {"PYTHONPATH":"${workspaceRoot}"}
}
]
}
真正可以干掉line too long提示的解决方案来了
修改D:\Python37\Lib\site-packages\flake8\defaults.py文件中的IGNORE,添加上E501
settings.json文件中指定flake8.exe的路径,如下:
效果如下: