From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id C362756236E; Thu, 3 Aug 2023 10:46:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C362756236E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1691048817; bh=uFkPcBiVC53xJfTfdGOZAlXg/biqHoegdMolKG5Brdw=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ynyAgyOuGP6t+vVS2vyoONg6A4GDavGJdkPDlnv1QqAO5muBhjJXkNIBccY2JLWIG oF0iLmOXtXBg8/CcCCWj+I108n4obEGPVbVmekgjV0supT5oo6j9AZmoH5oG0/2uQr HjMW/hQlKCEbIvH0/EOa6Dpx4CrHumrLzwrWDwD8= Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [95.163.41.96]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 4FA0756236E for ; Thu, 3 Aug 2023 10:44:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4FA0756236E Received: by smtp58.i.mail.ru with esmtpa (envelope-from ) id 1qRT02-000EDQ-0y; Thu, 03 Aug 2023 10:43:58 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Thu, 3 Aug 2023 07:30:31 +0000 Message-Id: <43076e542b6f8d86bed92c467753b5162b444416.1691047132.git.imun@tarantool.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD93761F2630DFFAF41A06C3F00224CE1B2857C7744A811472E182A05F53808504087AA886E611390A038BF7337F593683A531469F40F6B2D1E676777FFCBB34BDD X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE72FFC9A718DD021A9EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063745B6F93C788775E78638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8FD1A6D19B89F932B17C199C31E51ED1B117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC55D5BE2F85BDEC5FA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520C65AC60A1F0286FE618001F51B5FD3F9D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EEB28585415E75ADA9B2D370F7B14D4BC4D8FC6C240DEA76429C9F4D5AE37F343AA9539A8B242431040A6AB1C7CE11FEE3034D30FDF2F620DB6136E347CC761E07C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947C062BEEFFB5F8EA3E2E808ACE2090B5E1725E5C173C3A84C3E478A468B35FE767089D37D7C0E48F6C8AA50765F7900637EC3198ECE464ADAEEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A598E2D331C42862D143F7D6B393291FE06A178B9A15A9CEF5F87CCE6106E1FC07E67D4AC08A07B9B01DAA61796BF5227B9C5DF10A05D560A950611B66E3DA6D700B0A020F03D25A0997E3FB2386030E77 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFB62AB263E7C6EF79E8BAA871197971B8783F39674524E65E0C9D2C880ECD59E5A08A323FE4E4FE848553022043D0BC9A2BED1F8B4D909F80A9FB8571D3747406A74DFFEFA5DC0E7F02C26D483E81D6BEECAEF3E2CCC1ED8C383653B6C8D9AE0FD16FCAA6493B703A X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojcir52QaMQ83Pr6R7cRmR6Q== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D531C55F6AC43F6B0328036023DF36484674931F1E698EF251A52326FE6F2A341ACE0FB9F97486540B4CD9E8847AB8CFED4D9ABF8A61C016C2CFB0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 06/15] test: fix E251 errors by pycodestyle X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Fixed 208 occurrences of E251 ("unexpected spaces around keyword / parameter equals") error reported by pycodestyle[1]. [1]: https://www.flake8rules.com/rules/E251.html Signed-off-by: Igor Munkin --- src/luajit-gdb.py | 102 ++++++++++++++++++++++---------------------- src/luajit_lldb.py | 104 ++++++++++++++++++++++----------------------- 2 files changed, 103 insertions(+), 103 deletions(-) diff --git a/src/luajit-gdb.py b/src/luajit-gdb.py index 09899f58..f87063f8 100644 --- a/src/luajit-gdb.py +++ b/src/luajit-gdb.py @@ -347,8 +347,8 @@ def dump_lj_tlightud(tv): def dump_lj_tstr(tv): return 'string {body} @ {address}'.format( - body = strdata(gcval(tv['gcr'])), - address = strx64(gcval(tv['gcr'])) + body=strdata(gcval(tv['gcr'])), + address=strx64(gcval(tv['gcr'])) ) def dump_lj_tupval(tv): @@ -367,10 +367,10 @@ def dump_lj_tfunc(tv): if ffid == 0: pt = funcproto(func) return 'Lua function @ {addr}, {nupvals} upvalues, {chunk}:{line}'.format( - addr = strx64(func), - nupvals = int(func['nupvalues']), - chunk = strdata(cast('GCstr *', gcval(pt['chunkname']))), - line = pt['firstline'] + addr=strx64(func), + nupvals=int(func['nupvalues']), + chunk=strdata(cast('GCstr *', gcval(pt['chunkname']))), + line=pt['firstline'] ) elif ffid == 1: return 'C function @ {}'.format(strx64(func['f'])) @@ -380,8 +380,8 @@ def dump_lj_tfunc(tv): def dump_lj_ttrace(tv): trace = cast('struct GCtrace *', gcval(tv['gcr'])) return 'trace {traceno} @ {addr}'.format( - traceno = strx64(trace['traceno']), - addr = strx64(trace) + traceno=strx64(trace['traceno']), + addr=strx64(trace) ) def dump_lj_tcdata(tv): @@ -390,9 +390,9 @@ def dump_lj_tcdata(tv): def dump_lj_ttab(tv): table = cast('GCtab *', gcval(tv['gcr'])) return 'table @ {gcr} (asize: {asize}, hmask: {hmask})'.format( - gcr = strx64(table), - asize = table['asize'], - hmask = strx64(table['hmask']), + gcr=strx64(table), + asize=table['asize'], + hmask=strx64(table['hmask']), ) def dump_lj_tudata(tv): @@ -436,16 +436,16 @@ def dump_framelink_slot_address(fr): def dump_framelink(L, fr): if fr == frame_sentinel(L): return '{addr} [S ] FRAME: dummy L'.format( - addr = dump_framelink_slot_address(fr), + addr=dump_framelink_slot_address(fr), ) return '{addr} [ ] FRAME: [{pp}] delta={d}, {f}'.format( - addr = dump_framelink_slot_address(fr), - pp = 'PP' if frame_ispcall(fr) else '{frname}{p}'.format( - frname = frametypes(int(frame_type(fr))), - p = 'P' if frame_typep(fr) & FRAME_P else '' + addr=dump_framelink_slot_address(fr), + pp='PP' if frame_ispcall(fr) else '{frname}{p}'.format( + frname=frametypes(int(frame_type(fr))), + p='P' if frame_typep(fr) & FRAME_P else '' ), - d = cast('TValue *', fr) - cast('TValue *', frame_prev(fr)), - f = dump_lj_tfunc(fr - LJ_FR2), + d=cast('TValue *', fr) - cast('TValue *', frame_prev(fr)), + f=dump_lj_tfunc(fr - LJ_FR2), ) def dump_stack_slot(L, slot, base=None, top=None): @@ -453,12 +453,12 @@ def dump_stack_slot(L, slot, base=None, top=None): top = top or L['top'] return '{addr}{padding} [ {B}{T}{M}] VALUE: {value}'.format( - addr = strx64(slot), - padding = PADDING, - B = 'B' if slot == base else ' ', - T = 'T' if slot == top else ' ', - M = 'M' if slot == mref('TValue *', L['maxstack']) else ' ', - value = dump_tvalue(slot), + addr=strx64(slot), + padding=PADDING, + B='B' if slot == base else ' ', + T='T' if slot == top else ' ', + M='M' if slot == mref('TValue *', L['maxstack']) else ' ', + value=dump_tvalue(slot), ) def dump_stack(L, base=None, top=None): @@ -470,8 +470,8 @@ def dump_stack(L, base=None, top=None): dump = [ '{padding} Red zone: {nredslots: >2} slots {padding}'.format( - padding = '-' * len(PADDING), - nredslots = red, + padding='-' * len(PADDING), + nredslots=red, ), ] dump.extend([ @@ -480,14 +480,14 @@ def dump_stack(L, base=None, top=None): ]) dump.extend([ '{padding} Stack: {nstackslots: >5} slots {padding}'.format( - padding = '-' * len(PADDING), - nstackslots = int((tou64(maxstack) - tou64(stack)) >> 3), + padding='-' * len(PADDING), + nstackslots=int((tou64(maxstack) - tou64(stack)) >> 3), ), dump_stack_slot(L, maxstack, base, top), '{start}:{end} [ ] {nfreeslots} slots: Free stack slots'.format( - start = strx64(top + 1), - end = strx64(maxstack - 1), - nfreeslots = int((tou64(maxstack) - tou64(top) - 8) >> 3), + start=strx64(top + 1), + end=strx64(maxstack - 1), + nfreeslots=int((tou64(maxstack) - tou64(top) - 8) >> 3), ), ]) @@ -504,19 +504,19 @@ def dump_stack(L, base=None, top=None): def dump_gc(g): gc = g['gc'] - stats = ['{key}: {value}'.format(key = f, value = gc[f]) for f in ( + stats = ['{key}: {value}'.format(key=f, value=gc[f]) for f in ( 'total', 'threshold', 'debt', 'estimate', 'stepmul', 'pause' )] stats += ['sweepstr: {sweepstr}/{strmask}'.format( - sweepstr = gc['sweepstr'], + sweepstr=gc['sweepstr'], # String hash mask (size of hash table - 1). - strmask = g['strmask'] + 1, + strmask=g['strmask'] + 1, )] stats += ['{key}: {number} objects'.format( - key = stat, - number = handler(gc[stat]) + key=stat, + number=handler(gc[stat]) ) for stat, handler in gclen.items()] return '\n'.join(map(lambda s: '\t' + s, stats)) @@ -543,9 +543,9 @@ pointers respectively. gdb.write( 'LJ_64: {LJ_64}, LJ_GC64: {LJ_GC64}, LJ_DUALNUM: {LJ_DUALNUM}\n' .format( - LJ_64 = LJ_64, - LJ_GC64 = LJ_GC64, - LJ_DUALNUM = LJ_DUALNUM + LJ_64=LJ_64, + LJ_GC64=LJ_GC64, + LJ_DUALNUM=LJ_DUALNUM ) ) @@ -596,9 +596,9 @@ is replaced with the corresponding error when decoding fails. def invoke(self, arg, from_tty): string = cast('GCstr *', parse_arg(arg)) gdb.write("String: {body} [{len} bytes] with hash {hash}\n".format( - body = strdata(string), - hash = strx64(string['hash']), - len = string['len'], + body=strdata(string), + hash=strx64(string['hash']), + len=string['len'], )) class LJDumpTable(LJBase): @@ -630,9 +630,9 @@ The command receives a GCtab adress and dumps the table contents: for i in range(capacity['apart']): slot = array + i gdb.write('{ptr}: [{index}]: {value}\n'.format( - ptr = slot, - index = i, - value = dump_tvalue(slot) + ptr=slot, + index=i, + value=dump_tvalue(slot) )) gdb.write('Hash part: {} nodes\n'.format(capacity['hpart'])) @@ -640,10 +640,10 @@ The command receives a GCtab adress and dumps the table contents: for i in range(capacity['hpart']): node = nodes + i gdb.write('{ptr}: {{ {key} }} => {{ {val} }}; next = {n}\n'.format( - ptr = node, - key = dump_tvalue(node['key']), - val= dump_tvalue(node['val']), - n = mref('struct Node *', node['next']) + ptr=node, + key=dump_tvalue(node['key']), + val=dump_tvalue(node['val']), + n=mref('struct Node *', node['next']) )) class LJDumpStack(LJBase): @@ -723,8 +723,8 @@ The command requires no args and dumps current GC stats: def invoke(self, arg, from_tty): g = G(L(None)) gdb.write('GC stats: {state}\n{stats}\n'.format( - state = gc_state(g), - stats = dump_gc(g) + state=gc_state(g), + stats=dump_gc(g) )) def init(commands): diff --git a/src/luajit_lldb.py b/src/luajit_lldb.py index a7a756e9..f502a0e6 100644 --- a/src/luajit_lldb.py +++ b/src/luajit_lldb.py @@ -390,19 +390,19 @@ gclen = { def dump_gc(g): gc = g.gc - stats = ['{key}: {value}'.format(key = f, value = getattr(gc, f)) for f in ( + stats = ['{key}: {value}'.format(key=f, value=getattr(gc, f)) for f in ( 'total', 'threshold', 'debt', 'estimate', 'stepmul', 'pause' )] stats += ['sweepstr: {sweepstr}/{strmask}'.format( - sweepstr = gc.sweepstr, + sweepstr=gc.sweepstr, # String hash mask (size of hash table - 1). - strmask = g.strmask + 1, + strmask=g.strmask + 1, )] stats += ['{key}: {number} objects'.format( - key = stat, - number = handler(getattr(gc, stat)) + key=stat, + number=handler(getattr(gc, stat)) ) for stat, handler in gclen.items()] return '\n'.join(map(lambda s: '\t' + s, stats)) @@ -521,8 +521,8 @@ def dump_lj_tlightud(tv): def dump_lj_tstr(tv): return 'string {body} @ {address}'.format( - body = strdata(cast(GCstrPtr, gcval(tv.gcr))), - address = strx64(gcval(tv.gcr)) + body=strdata(cast(GCstrPtr, gcval(tv.gcr))), + address=strx64(gcval(tv.gcr)) ) def dump_lj_tupval(tv): @@ -541,10 +541,10 @@ def dump_lj_tfunc(tv): if ffid == 0: pt = funcproto(func) return 'Lua function @ {addr}, {nupvals} upvalues, {chunk}:{line}'.format( - addr = strx64(func), - nupvals = func.nupvalues, - chunk = strdata(cast(GCstrPtr, gcval(pt.chunkname))), - line = pt.firstline + addr=strx64(func), + nupvals=func.nupvalues, + chunk=strdata(cast(GCstrPtr, gcval(pt.chunkname))), + line=pt.firstline ) elif ffid == 1: return 'C function @ {}'.format(strx64(func.f)) @@ -554,8 +554,8 @@ def dump_lj_tfunc(tv): def dump_lj_ttrace(tv): trace = cast(GCtracePtr, gcval(tv.gcr)) return 'trace {traceno} @ {addr}'.format( - traceno = strx64(trace.traceno), - addr = strx64(trace) + traceno=strx64(trace.traceno), + addr=strx64(trace) ) def dump_lj_tcdata(tv): @@ -564,9 +564,9 @@ def dump_lj_tcdata(tv): def dump_lj_ttab(tv): table = cast(GCtabPtr, gcval(tv.gcr)) return 'table @ {gcr} (asize: {asize}, hmask: {hmask})'.format( - gcr = strx64(table), - asize = table.asize, - hmask = strx64(table.hmask), + gcr=strx64(table), + asize=table.asize, + hmask=strx64(table.hmask), ) def dump_lj_tudata(tv): @@ -724,16 +724,16 @@ def dump_framelink_slot_address(fr): def dump_framelink(L, fr): if fr == frame_sentinel(L): return '{addr} [S ] FRAME: dummy L'.format( - addr = dump_framelink_slot_address(fr), + addr=dump_framelink_slot_address(fr), ) return '{addr} [ ] FRAME: [{pp}] delta={d}, {f}'.format( - addr = dump_framelink_slot_address(fr), - pp = 'PP' if frame_ispcall(fr) else '{frname}{p}'.format( - frname = frametypes(int(frame_type(fr))), - p = 'P' if frame_typep(fr) & FRAME_P else '' + addr=dump_framelink_slot_address(fr), + pp='PP' if frame_ispcall(fr) else '{frname}{p}'.format( + frname=frametypes(int(frame_type(fr))), + p='P' if frame_typep(fr) & FRAME_P else '' ), - d = fr - frame_prev(fr), - f = dump_lj_tfunc(fr - LJ_FR2), + d=fr - frame_prev(fr), + f=dump_lj_tfunc(fr - LJ_FR2), ) def dump_stack_slot(L, slot, base=None, top=None): @@ -741,12 +741,12 @@ def dump_stack_slot(L, slot, base=None, top=None): top = top or L.top return '{addr:{padding}} [ {B}{T}{M}] VALUE: {value}'.format( - addr = strx64(slot), - padding = 2 * len(PADDING) + 1, - B = 'B' if slot == base else ' ', - T = 'T' if slot == top else ' ', - M = 'M' if slot == mref(TValuePtr, L.maxstack) else ' ', - value = dump_tvalue(slot), + addr=strx64(slot), + padding=2 * len(PADDING) + 1, + B='B' if slot == base else ' ', + T='T' if slot == top else ' ', + M='M' if slot == mref(TValuePtr, L.maxstack) else ' ', + value=dump_tvalue(slot), ) def dump_stack(L, base=None, top=None): @@ -758,8 +758,8 @@ def dump_stack(L, base=None, top=None): dump = [ '{padding} Red zone: {nredslots: >2} slots {padding}'.format( - padding = '-' * len(PADDING), - nredslots = red, + padding='-' * len(PADDING), + nredslots=red, ), ] dump.extend([ @@ -768,15 +768,15 @@ def dump_stack(L, base=None, top=None): ]) dump.extend([ '{padding} Stack: {nstackslots: >5} slots {padding}'.format( - padding = '-' * len(PADDING), - nstackslots = int((maxstack - stack) >> 3), + padding='-' * len(PADDING), + nstackslots=int((maxstack - stack) >> 3), ), dump_stack_slot(L, maxstack, base, top), '{start:{padding}}:{end:{padding}} [ ] {nfreeslots} slots: Free stack slots'.format( - start = strx64(top + 1), - end = strx64(maxstack - 1), - padding = len(PADDING), - nfreeslots = int((maxstack - top - 8) >> 3), + start=strx64(top + 1), + end=strx64(maxstack - 1), + padding=len(PADDING), + nfreeslots=int((maxstack - top - 8) >> 3), ), ]) @@ -856,9 +856,9 @@ pointers respectively. print( 'LJ_64: {LJ_64}, LJ_GC64: {LJ_GC64}, LJ_DUALNUM: {LJ_DUALNUM}' .format( - LJ_64 = LJ_64, - LJ_GC64 = LJ_GC64, - LJ_DUALNUM = LJ_DUALNUM + LJ_64=LJ_64, + LJ_GC64=LJ_GC64, + LJ_DUALNUM=LJ_DUALNUM ) ) @@ -883,8 +883,8 @@ The command requires no args and dumps current GC stats: def execute(self, debugger, args, result): g = G(L(None)) print('GC stats: {state}\n{stats}'.format( - state = gc_state(g), - stats = dump_gc(g) + state=gc_state(g), + stats=dump_gc(g) )) class LJDumpString(Command): @@ -900,9 +900,9 @@ is replaced with the corresponding error when decoding fails. def execute(self, debugger, args, result): string_ptr = GCstrPtr(cast('GCstr *', self.parse(args))) print("String: {body} [{len} bytes] with hash {hash}".format( - body = strdata(string_ptr), - hash = strx64(string_ptr.hash), - len = string_ptr.len, + body=strdata(string_ptr), + hash=strx64(string_ptr.hash), + len=string_ptr.len, )) class LJDumpTable(Command): @@ -933,9 +933,9 @@ The command receives a GCtab adress and dumps the table contents: for i in range(capacity['apart']): slot = array + i print('{ptr}: [{index}]: {value}'.format( - ptr = strx64(slot), - index = i, - value = dump_tvalue(slot) + ptr=strx64(slot), + index=i, + value=dump_tvalue(slot) )) print('Hash part: {} nodes'.format(capacity['hpart'])) @@ -943,10 +943,10 @@ The command receives a GCtab adress and dumps the table contents: for i in range(capacity['hpart']): node = nodes + i print('{ptr}: {{ {key} }} => {{ {val} }}; next = {n}'.format( - ptr = strx64(node), - key = dump_tvalue(TValuePtr(node.key.addr)), - val= dump_tvalue(TValuePtr(node.val.addr)), - n = strx64(mref(NodePtr, node.next)) + ptr=strx64(node), + key=dump_tvalue(TValuePtr(node.key.addr)), + val=dump_tvalue(TValuePtr(node.val.addr)), + n=strx64(mref(NodePtr, node.next)) )) class LJDumpStack(Command): -- 2.30.2