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 4FBF1559A16; Thu, 3 Aug 2023 10:45:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4FBF1559A16 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1691048756; bh=gg/IqEM1Ug236rJCTcMwLp4DDXJ2Mi40qN0zAhNhEJs=; 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=ImWlXfC/aRRR462fmB9Fd6m0OArJkzAknvO/V6kvmBa5Uee+z82lOh6FayZMYoYbG /qEqznJGcpjBsS2FZTQ1GP7GWAeoB2MWXy27Dv+q1Cf2iIFR8zW2Rug4n7mFykh8kM nEJrfN5HwXKm4ZibB/MDlkwijSJs5xC/XjpmTOFE= 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 6C39856236D for ; Thu, 3 Aug 2023 10:43:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6C39856236D Received: by smtp58.i.mail.ru with esmtpa (envelope-from ) id 1qRSzz-000EDQ-1b; Thu, 03 Aug 2023 10:43:56 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Thu, 3 Aug 2023 07:30:29 +0000 Message-Id: <5a16585529e852321935087e631895722b3dc5b7.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: 4F1203BC0FB41BD93761F2630DFFAF416DDF8A3A1F98730F81C7E6AA5A500726182A05F5380850407CCEF2CB395DB5FA1D0F2C323AD5539B747FFCA781826D00A1943288EA34F9BA X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE706EA9E10470DC775EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637EFACF7FB96444C4B8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8783DEBA05A748B10D9D88C973F2C3949117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC3733B5EC72352B9FA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735209647ADFADE5905B1E5D25F19253116ADD2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE1E561CDFBCA1751FB01F8B705E65F4D2D8FC6C240DEA76429C9F4D5AE37F343AA9539A8B242431040A6AB1C7CE11FEE386A7C529F68B8E5CC0837EA9F3D19764C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947C1D471462564A2E192E808ACE2090B5E1725E5C173C3A84C3ED8438A78DFE0A9E089D37D7C0E48F6C8AA50765F7900637EC3198ECE464ADAEEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5CA4E8F60F537C61043F7D6B393291FE02617059427D3AE22F87CCE6106E1FC07E67D4AC08A07B9B04CB6874B0BCFF0B89C5DF10A05D560A950611B66E3DA6D700B0A020F03D25A0997E3FB2386030E77 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFE9ACC499CAFFD621945E231D2E54163B7ABA0E1105677BE40990041EC57717ABACCA692FBCDC96C28553022043D0BC9A679EADA50A62AD525074F35E27885786A74DFFEFA5DC0E7F02C26D483E81D6BEECAEF3E2CCC1ED8C383653B6C8D9AE0FD16FCAA6493B703A X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojcir52QaMQ82ixaekUxrrSw== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D531159A7E4203E1E03D2A9510277A738EF73B00933005611BEF2326FE6F2A341ACE0FB9F97486540B4CD9E8847AB8CFED4D9ABF8A61C016C2CFB0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 04/15] test: fix E203 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 36 occurrences of E203 ("whitespace before ':'") error reported by pycodestyle[1]. Furthermore, many other parts have been re-aligned the similar way to be in sync with the default code style. [1]: https://www.flake8rules.com/rules/E203.html Signed-off-by: Igor Munkin --- src/luajit-gdb.py | 98 +++++++++++++++++++++---------------------- src/luajit_lldb.py | 102 ++++++++++++++++++++++----------------------- 2 files changed, 100 insertions(+), 100 deletions(-) diff --git a/src/luajit-gdb.py b/src/luajit-gdb.py index 198578b1..09899f58 100644 --- a/src/luajit-gdb.py +++ b/src/luajit-gdb.py @@ -65,20 +65,20 @@ def strx64(val): # Types {{{ LJ_T = { - 'NIL' : i2notu32(0), - 'FALSE' : i2notu32(1), - 'TRUE' : i2notu32(2), - 'LIGHTUD' : i2notu32(3), - 'STR' : i2notu32(4), - 'UPVAL' : i2notu32(5), - 'THREAD' : i2notu32(6), - 'PROTO' : i2notu32(7), - 'FUNC' : i2notu32(8), - 'TRACE' : i2notu32(9), - 'CDATA' : i2notu32(10), - 'TAB' : i2notu32(11), - 'UDATA' : i2notu32(12), - 'NUMX' : i2notu32(13), + 'NIL': i2notu32(0), + 'FALSE': i2notu32(1), + 'TRUE': i2notu32(2), + 'LIGHTUD': i2notu32(3), + 'STR': i2notu32(4), + 'UPVAL': i2notu32(5), + 'THREAD': i2notu32(6), + 'PROTO': i2notu32(7), + 'FUNC': i2notu32(8), + 'TRACE': i2notu32(9), + 'CDATA': i2notu32(10), + 'TAB': i2notu32(11), + 'UDATA': i2notu32(12), + 'NUMX': i2notu32(13), } def typenames(value): @@ -95,22 +95,22 @@ FRAME_P = 0x4 FRAME_TYPEP = FRAME_TYPE | FRAME_P FRAME = { - 'LUA': 0x0, - 'C': 0x1, - 'CONT': 0x2, - 'VARG': 0x3, - 'LUAP': 0x4, - 'CP': 0x5, - 'PCALL': 0x6, + 'LUA': 0x0, + 'C': 0x1, + 'CONT': 0x2, + 'VARG': 0x3, + 'LUAP': 0x4, + 'CP': 0x5, + 'PCALL': 0x6, 'PCALLH': 0x7, } def frametypes(ft): return { - FRAME['LUA'] : 'L', - FRAME['C'] : 'C', - FRAME['CONT'] : 'M', - FRAME['VARG'] : 'V', + FRAME['LUA']: 'L', + FRAME['C']: 'C', + FRAME['CONT']: 'M', + FRAME['VARG']: 'V', }.get(ft, '?') def bc_a(ins): @@ -299,12 +299,12 @@ def gcringlen(root): return 1 + gclistlen(gcnext(root), gcref(root)) gclen = { - 'root': gclistlen, - 'gray': gclistlen, + 'root': gclistlen, + 'gray': gclistlen, 'grayagain': gclistlen, - 'weak': gclistlen, + 'weak': gclistlen, # XXX: gc.mmudata is a ring-list. - 'mmudata': gcringlen, + 'mmudata': gcringlen, } # The generator that implements frame iterator. @@ -410,20 +410,20 @@ def dump_lj_invalid(tv): # }}} dumpers = { - 'LJ_TNIL': dump_lj_tnil, - 'LJ_TFALSE': dump_lj_tfalse, - 'LJ_TTRUE': dump_lj_ttrue, + 'LJ_TNIL': dump_lj_tnil, + 'LJ_TFALSE': dump_lj_tfalse, + 'LJ_TTRUE': dump_lj_ttrue, 'LJ_TLIGHTUD': dump_lj_tlightud, - 'LJ_TSTR': dump_lj_tstr, - 'LJ_TUPVAL': dump_lj_tupval, - 'LJ_TTHREAD': dump_lj_tthread, - 'LJ_TPROTO': dump_lj_tproto, - 'LJ_TFUNC': dump_lj_tfunc, - 'LJ_TTRACE': dump_lj_ttrace, - 'LJ_TCDATA': dump_lj_tcdata, - 'LJ_TTAB': dump_lj_ttab, - 'LJ_TUDATA': dump_lj_tudata, - 'LJ_TNUMX': dump_lj_tnumx, + 'LJ_TSTR': dump_lj_tstr, + 'LJ_TUPVAL': dump_lj_tupval, + 'LJ_TTHREAD': dump_lj_tthread, + 'LJ_TPROTO': dump_lj_tproto, + 'LJ_TFUNC': dump_lj_tfunc, + 'LJ_TTRACE': dump_lj_ttrace, + 'LJ_TCDATA': dump_lj_tcdata, + 'LJ_TTAB': dump_lj_ttab, + 'LJ_TUDATA': dump_lj_tudata, + 'LJ_TNUMX': dump_lj_tnumx, } def dump_tvalue(tvalue): @@ -695,8 +695,8 @@ The command requires no args and dumps current VM and GC states g = G(L(None)) gdb.write('{}\n'.format('\n'.join( map(lambda t: '{} state: {}'.format(*t), { - 'VM': vm_state(g), - 'GC': gc_state(g), + 'VM': vm_state(g), + 'GC': gc_state(g), 'JIT': jit_state(g), }.items()) ))) @@ -785,13 +785,13 @@ def init(commands): def load(event=None): init({ - 'lj-arch': LJDumpArch, - 'lj-tv': LJDumpTValue, - 'lj-str': LJDumpString, - 'lj-tab': LJDumpTable, + 'lj-arch': LJDumpArch, + 'lj-tv': LJDumpTValue, + 'lj-str': LJDumpString, + 'lj-tab': LJDumpTable, 'lj-stack': LJDumpStack, 'lj-state': LJState, - 'lj-gc': LJGC, + 'lj-gc': LJGC, }) load(None) diff --git a/src/luajit_lldb.py b/src/luajit_lldb.py index 2887723b..b9c8a0b9 100644 --- a/src/luajit_lldb.py +++ b/src/luajit_lldb.py @@ -88,8 +88,8 @@ class MetaStruct(type): def make_general(field, tp): builtin = { - 'uint': 'unsigned', - 'int': 'signed', + 'uint': 'unsigned', + 'int': 'signed', 'string': 'value', } if tp in builtin.keys(): @@ -380,12 +380,12 @@ def gcringlen(root): return 1 + gclistlen(gcnext(root), gcref(root)) gclen = { - 'root': gclistlen, - 'gray': gclistlen, + 'root': gclistlen, + 'gray': gclistlen, 'grayagain': gclistlen, - 'weak': gclistlen, + 'weak': gclistlen, # XXX: gc.mmudata is a ring-list. - 'mmudata': gcringlen, + 'mmudata': gcringlen, } def dump_gc(g): @@ -582,37 +582,37 @@ def dump_lj_invalid(tv): return 'not valid type @ {}'.format(strx64(gcval(tv.gcr))) dumpers = { - 'LJ_TNIL': dump_lj_tnil, - 'LJ_TFALSE': dump_lj_tfalse, - 'LJ_TTRUE': dump_lj_ttrue, + 'LJ_TNIL': dump_lj_tnil, + 'LJ_TFALSE': dump_lj_tfalse, + 'LJ_TTRUE': dump_lj_ttrue, 'LJ_TLIGHTUD': dump_lj_tlightud, - 'LJ_TSTR': dump_lj_tstr, - 'LJ_TUPVAL': dump_lj_tupval, - 'LJ_TTHREAD': dump_lj_tthread, - 'LJ_TPROTO': dump_lj_tproto, - 'LJ_TFUNC': dump_lj_tfunc, - 'LJ_TTRACE': dump_lj_ttrace, - 'LJ_TCDATA': dump_lj_tcdata, - 'LJ_TTAB': dump_lj_ttab, - 'LJ_TUDATA': dump_lj_tudata, - 'LJ_TNUMX': dump_lj_tnumx, + 'LJ_TSTR': dump_lj_tstr, + 'LJ_TUPVAL': dump_lj_tupval, + 'LJ_TTHREAD': dump_lj_tthread, + 'LJ_TPROTO': dump_lj_tproto, + 'LJ_TFUNC': dump_lj_tfunc, + 'LJ_TTRACE': dump_lj_ttrace, + 'LJ_TCDATA': dump_lj_tcdata, + 'LJ_TTAB': dump_lj_ttab, + 'LJ_TUDATA': dump_lj_tudata, + 'LJ_TNUMX': dump_lj_tnumx, } LJ_T = { - 'NIL' : i2notu32(0), - 'FALSE' : i2notu32(1), - 'TRUE' : i2notu32(2), - 'LIGHTUD' : i2notu32(3), - 'STR' : i2notu32(4), - 'UPVAL' : i2notu32(5), - 'THREAD' : i2notu32(6), - 'PROTO' : i2notu32(7), - 'FUNC' : i2notu32(8), - 'TRACE' : i2notu32(9), - 'CDATA' : i2notu32(10), - 'TAB' : i2notu32(11), - 'UDATA' : i2notu32(12), - 'NUMX' : i2notu32(13), + 'NIL': i2notu32(0), + 'FALSE': i2notu32(1), + 'TRUE': i2notu32(2), + 'LIGHTUD': i2notu32(3), + 'STR': i2notu32(4), + 'UPVAL': i2notu32(5), + 'THREAD': i2notu32(6), + 'PROTO': i2notu32(7), + 'FUNC': i2notu32(8), + 'TRACE': i2notu32(9), + 'CDATA': i2notu32(10), + 'TAB': i2notu32(11), + 'UDATA': i2notu32(12), + 'NUMX': i2notu32(13), } def itypemap(o): @@ -635,22 +635,22 @@ FRAME_P = 0x4 FRAME_TYPEP = FRAME_TYPE | FRAME_P FRAME = { - 'LUA': 0x0, - 'C': 0x1, - 'CONT': 0x2, - 'VARG': 0x3, - 'LUAP': 0x4, - 'CP': 0x5, - 'PCALL': 0x6, + 'LUA': 0x0, + 'C': 0x1, + 'CONT': 0x2, + 'VARG': 0x3, + 'LUAP': 0x4, + 'CP': 0x5, + 'PCALL': 0x6, 'PCALLH': 0x7, } def frametypes(ft): return { - FRAME['LUA'] : 'L', - FRAME['C'] : 'C', - FRAME['CONT'] : 'M', - FRAME['VARG'] : 'V', + FRAME['LUA']: 'L', + FRAME['C']: 'C', + FRAME['CONT']: 'M', + FRAME['VARG']: 'V', }.get(ft, '?') def bc_a(ins): @@ -838,8 +838,8 @@ The command requires no args and dumps current VM and GC states g = G(L(None)) print('{}'.format('\n'.join( map(lambda t: '{} state: {}'.format(*t), { - 'VM': vm_state(g), - 'GC': gc_state(g), + 'VM': vm_state(g), + 'GC': gc_state(g), 'JIT': jit_state(g), }.items()) ))) @@ -1024,12 +1024,12 @@ def configure(debugger): def __lldb_init_module(debugger, internal_dict): configure(debugger) register_commands(debugger, { - 'lj-tv': LJDumpTValue, + 'lj-tv': LJDumpTValue, 'lj-state': LJState, - 'lj-arch': LJDumpArch, - 'lj-gc': LJGC, - 'lj-str': LJDumpString, - 'lj-tab': LJDumpTable, + 'lj-arch': LJDumpArch, + 'lj-gc': LJGC, + 'lj-str': LJDumpString, + 'lj-tab': LJDumpTable, 'lj-stack': LJDumpStack, }) print('luajit_lldb.py is successfully loaded') -- 2.30.2