YAPFGoogle 开发的一个用来格式化 Python 代码的工具。

使用方法:

usage: yapf [-h] [--style STYLE] [-d | -i] [-l START-END | -r] ...

Formatter for Python CODE.

positional arguments:
  files

optional arguments:
  -h, --help            show this help message and exit
  --style STYLE         SPEcify formatting style: either a style name (for
                        example "pep8" or "google"), or the name of a file
                        with style settings
  -d, --diff            print the diff for the fixed source
  -i, --in-plACE        Make changes to files in place
  -l START-END, --lines START-END
                        range of lines to reformat, one-based
  -r, --recursive       run recursively over direcTorIEs
YAPF 0.17.0 发布,Python 代码格式化工具
YAPF 0.17.0 已发布,YAPF 是 Google 开源的一个用来格式化 Python 代码的工具。目前用于 Python 的格式化程序(如 autopep8 和 pep8ify)都用于删除代码中的 lint 错误。这有很明显的局限性。YAPF 采用了不同的方法,基于 Daniel Jasper 开发的 “clang-format” 。从本质上来说,该算法取走代码并重新排版,以符合样式指

发布于 2017-08-26 23:24:25 | 91 次阅读


Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务