Autopep8PEP8 风格代码排版工具
Autopep8 是一个将 Python 代码自动排版为 PEP8 风格的工具。它使用 pycodestyle 程序来确定代码的哪些部分需要排版。Autopep8 可以修复大部分 pycodestyle 报告的排版问题。
示例
排版前:
import math, sys; def example1(): ####This is a long comment. This should be wrapped to fit within 72 characters. some_tuple=( 1,2, 3,'a' ); some_variable={'long':'Long code lines should be wrapped within 79 characters.', 'other':[math.pi, 100,200,300,9876543210,'This is a long string that goes on'], 'more':{'inner':'This whole logical line should be wrapped.',some_tuple:[1, 20,300,40000,500000000,60000000000000000]}} return (some_tuple, some_variable) def example2(): return {'has_key() is deprecated':True}.has_key({'f':2}.has_key('')); class Example3( object ): def __init__ ( self, bar ): #Comments should have a space after the hash. if bar : bar+=1; bar=bar* bar ; return bar else: some_string = """ Indentation in multiline strings should not be touched. Only actual code should be reindented. """ return (sys.path, some_string)
排版后:
import math import sys def example1(): # This is a long comment. This should be wrapped to fit within 72 # characters. some_tuple = (1, 2, 3, 'a') some_variable = { 'long': 'Long code lines should be wrapped within 79 characters.', 'other': [ math.pi, 100, 200, 300, 9876543210, 'This is a long string that goes on'], 'more': { 'inner': 'This whole logical line should be wrapped.', some_tuple: [ 1, 20, 300, 40000, 500000000, 60000000000000000]}} return (some_tuple, some_variable) def example2(): return ('' in {'f': 2}) in {'has_key() is deprecated': True} class Example3(object): def __init__(self, bar): # Comments should have a space after the hash. if bar: bar += 1 bar = bar * bar return bar else: some_string = """ Indentation in multiline strings should not be touched. Only actual code should be reindented. """ return (sys.path, some_string)
评论
RSTMALLCell天猫排版风格克隆工具
RSTMALLCell实现了类似天猫app的排版风格。克隆,这次的目标是天猫。最新的更新包含一个很酷的功能,如果不释放手指,则可以用手指移动单元格右侧的图像,并且当释放手指时,图像会下降然后不可见。此
RSTMALLCell天猫排版风格克隆工具
0
FECS前端代码风格工具
FECS是基于Node.js的前端代码风格工具。灵活安装简单,深度可配置性高效基于Stream,文件流转从未如此迅速齐全四大语言支持,前端代码质量有保障基于四个工具 htmlcs 检查、格式化HTML
FECS前端代码风格工具
0
TWRSkewedCollectionViewiOS 图片排版工具
TWRSkewedCollectionView用来显示一组倾斜的图片。
TWRSkewedCollectionViewiOS 图片排版工具
0
TWRSkewedCollectionViewiOS 图片排版工具
TWRSkewedCollectionView 用来显示一组倾斜的图片。
TWRSkewedCollectionViewiOS 图片排版工具
0