From cac0b53ac5e4e25b2f7e82d3cf43e55aed47d8c8 Mon Sep 17 00:00:00 2001 From: actions-bot <58130806+actions-bot@users.noreply.github.com> Date: Fri, 10 Jul 2020 00:05:03 +0000 Subject: [PATCH] [black-command] fixes --- example.py | 48 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/example.py b/example.py index ec7eab77c..e7bca8b12 100644 --- a/example.py +++ b/example.py @@ -1,21 +1,41 @@ -import math, sys; +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]}} + 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 = """ + + +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) + return (sys.path, some_string)