zoukankan      html  css  js  c++  java
  • VScode 配置yapf格式化

    GitHub - google/yapf: A formatter for Python files

    "editor.formatOnSave": true,
    "python.formatting.provider": "yapf",
    "python.formatting.yapfArgs": [
            "--style",
            "{BASED_ON_STYLE = pep8, COLUMN_LIMIT = 120, BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF = true, DEDENT_CLOSING_BRACKETS = true, SPACES_BEFORE_COMMENT = '1,20'}"
    ],
    

    配置选项参数:

    BASED_ON_STYLE 基础样式

    INDENT_WIDTH 缩进宽度,默认为4

    COLUMN_LIMIT 编辑器列宽

    BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF 在函数和类之间插入空行

    DEDENT_CLOSING_BRACKETS 括号缩进换行

    SPACES_BEFORE_COMMENT 注释前面的空格数量,当为数组时可以动态进行格式对齐

  • 相关阅读:
    CF258D
    CF662C
    CF1295F
    CF1406E
    CF1270F
    CF1278F
    CF1523E
    CF1554E
    算法第四章上机实践报告
    LCA RMQ+ST表学习笔记
  • 原文地址:https://www.cnblogs.com/li1234yun/p/15153031.html
Copyright © 2011-2022 走看看