标签:str tac scripts har 若是 pre 参数 date 长度
"HEADER":{
"prefix": "header",
"body": [
"# -*- encoding: utf-8 -*-",
"",
"# @File : $TM_FILENAME",
"# @Time : $CURRENT_YEAR/$CURRENT_MONTH/$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
"# @Author : H2o ",
"# @Version : 1.0",
"# @Contact : 515430193@qq.com",
"",
"",
""
],
}
快捷键: ctrl+shift+2, 或在函数定义后输入: """
修改autoDocstring.docstringFormat栏即可
修改autoDocstring.customTemplatePath为你新建的.mustache文件的地址
(详细关键字配置请查看插件介绍)
个人使用google注释模板,.mustache文件内容如下:
{{! Google Docstring Template }}
{{summaryPlaceholder}}
{{extendedSummaryPlaceholder}}
{{#parametersExist}}
Args:
{{#args}}
{{var}} ({{typePlaceholder}}): {{descriptionPlaceholder}}
{{/args}}
{{#kwargs}}
{{var}} ({{typePlaceholder}}, optional): {{descriptionPlaceholder}}. Defaults to {{&default}}.
{{/kwargs}}
{{/parametersExist}}
{{#exceptionsExist}}
Raises:
{{#exceptions}}
{{type}}: {{descriptionPlaceholder}}
{{/exceptions}}
{{/exceptionsExist}}
{{#returnsExist}}
Returns:
{{#returns}}
{{typePlaceholder}}: {{descriptionPlaceholder}}
{{/returns}}
{{/returnsExist}}
(以black为例)
(以pylint为例)
项目 | 说明 | 是否必需安装 |
---|---|---|
Python | 是 | |
vscode-icons | 美化文件图标 | 否 |
Better Comments | 美化行注释 | 否 |
Chinese (Simplified) Language Pack for Visual Studio Code |
中文汉化包 | 否 |
autoDocstring | 函数注释模板生成 | 否 |
{
"files.autoSave": "afterDelay",
"editor.renderWhitespace": "all",
"editor.wordWrap": "wordWrapColumn",
"workbench.startupEditor": "newUntitledFile",
"workbench.iconTheme": "vscode-icons",
"workbench.colorTheme": "Bluloco Light",
"editor.fontFamily": "InputMono, Consolas, 'Courier New', monospace",
"editor.fontSize": 15,
"editor.lineHeight": 27,
"python.formatting.provider": "black",
"python.formatting.blackPath": "C:\\Program Files\\Python36\\Scripts\\black.exe",
"python.formatting.blackArgs": [
"--line-length=80"
],
"editor.renderControlCharacters": false,
"autoDocstring.customTemplatePath": "C:\\Program Files\\Microsoft VS Code\\data\\google.mustache"
}
{
"python.pythonPath": "D:\\ENV\\Testtools\\Scripts\\python.exe",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
}
标签:str tac scripts har 若是 pre 参数 date 长度
原文地址:https://www.cnblogs.com/TesterH2o/p/11548086.html