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 AAFE9574A45; Sun, 13 Aug 2023 16:55:36 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AAFE9574A45 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1691934936; bh=Lz2kTaOe1tJGGNsMIMyTbQ6ZdrMQEBxLlfszRpD0o0E=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ykhU/TRw8YY1zLESIjwSswo4I6Uri/+H/D5bwIB3G4KFVgTtOEaAGCdf/7vHSmlQQ N9mv6ZrLHdawymF4Yn3RQEyLcG+BVLcF0AB36JCwe6rmNLwHujErbbc181FS3zzn+1 0Xy/fA5UefKkA/RTJCBTv7CtAtLQGJBIiPFVytJA= Received: from smtp52.i.mail.ru (smtp52.i.mail.ru [95.163.41.88]) (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 0B1DA574A45 for ; Sun, 13 Aug 2023 16:55:36 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0B1DA574A45 Received: by smtp52.i.mail.ru with esmtpa (envelope-from ) id 1qVBZ8-00HLdS-2S; Sun, 13 Aug 2023 16:55:35 +0300 Date: Sun, 13 Aug 2023 16:55:34 +0300 To: Igor Munkin Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD969E04B5EED670DC86EE92E42F0C271DDDF6A6B73F41FC074182A05F53808504042428931CB150B61A859AB0BC49D33A6F8CC98EE6F23EF51D9DB1CC90507A31F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE742D9BD90C58D50E0EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AB1265E79AFCDEF58638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D884AE3CCB8F131C469A046660ACCBD487117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCDCBA8CBAA3833548A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18E5D25F19253116ADD2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EEB28585415E75ADA9040F9FF01DFDA4A84AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C30942DC5495D0595E76E601842F6C81A1F004C906525384303E02D724532EE2C3F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB1E561CDFBCA1751F262FEC7FBD7D1F5BD5E8D9A59859A8B6B1CFA6D474D4A6A4089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A55DD7CCD957D9BC56AFBECAFAF3516D5EB53BF95D14A621FAF87CCE6106E1FC07E67D4AC08A07B9B06A1CB4668A9CA5FACB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF33E394E00864631F89F74BE2D2C68FFE481C3CB46063AF95B85D30E780D18C46FB9773CE30426B0E90ABE3E74E35EA6F94913F49A70F19F16B9D5BD962AD5DDDE48CAC7CA610320002C26D483E81D6BE64ACE4A408B72B61B0CA6F94E606A667A52EF62A646584F811BD90D3D42C882D43082AE146A756F3 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojngxRbPBK1nGfDsQkFp91EQ== X-Mailru-Sender: 0E9E14D9EC491FBA87EB92DCA6727BD22BA3CA3F896D2B8EA859AB0BC49D33A6E5E949923882BAAD04C9FB44FCBCE9EE92D99EB8CC7091A7ECEABDC5717908DEF544888E8238EB4872D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 19/15] test: fix E501 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: Maxim Kokryashkin via Tarantool-patches Reply-To: Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Igor! Thanks for the patch! LGTM On Tue, Aug 08, 2023 at 07:42:40PM +0000, Igor Munkin wrote: > Fixed 11 occurrences of E501 ("line too long") error reported by > pycodestyle[1]. > > [1]: https://www.flake8rules.com/rules/E501.html > > Signed-off-by: Igor Munkin > --- > > **NB**: This patch will be placed between "[PATCH luajit 10/15] test: > fix E305 errors by pycodestyle" and "[PATCH luajit 11/15] test: fix E502 > errors by pycodestyle" on the branch. > > CI: https://github.com/tarantool/luajit/actions/runs/5800936024/job/15724104222 > > src/luajit-gdb.py | 4 ++-- > src/luajit_lldb.py | 55 +++++++++++++++++++++++++--------------------- > 2 files changed, 32 insertions(+), 27 deletions(-) > > diff --git a/src/luajit-gdb.py b/src/luajit-gdb.py > index 9dcddb17..5eaf250f 100644 > --- a/src/luajit-gdb.py > +++ b/src/luajit-gdb.py > @@ -430,9 +430,9 @@ def dump_lj_tfunc(tv): > > if ffid == 0: > pt = funcproto(func) > - return 'Lua function @ {addr}, {nupvals} upvalues, {chunk}:{line}'.format( > + return 'Lua function @ {addr}, {nups} upvalues, {chunk}:{line}'.format( > addr=strx64(func), > - nupvals=int(func['nupvalues']), > + nups=int(func['nupvalues']), > chunk=strdata(cast('GCstr *', gcval(pt['chunkname']))), > line=pt['firstline'] > ) > diff --git a/src/luajit_lldb.py b/src/luajit_lldb.py > index 13d9f2e3..ef0986cc 100644 > --- a/src/luajit_lldb.py > +++ b/src/luajit_lldb.py > @@ -50,10 +50,11 @@ class Ptr: > if isinstance(other, int): > return self.__add__(-other) > else: > - return int((self.value.unsigned - other.value.unsigned) / sizeof(self.normal_type.__name__)) > + return int((self.value.unsigned - other.value.unsigned) > + / sizeof(self.normal_type.__name__)) > > def __eq__(self, other): > - assert isinstance(other, Ptr) or (isinstance(other, int) and other >= 0) > + assert isinstance(other, Ptr) or isinstance(other, int) and other >= 0 > if isinstance(other, Ptr): > return self.value.unsigned == other.value.unsigned > else: > @@ -126,10 +127,12 @@ class Struct(metaclass=MetaStruct): > > c_structs = { > 'MRef': [ > - (property(lambda self: self['ptr64'].unsigned if LJ_GC64 else self['ptr32'].unsigned), 'ptr') > + (property(lambda self: self['ptr64'].unsigned if LJ_GC64 > + else self['ptr32'].unsigned), 'ptr') > ], > 'GCRef': [ > - (property(lambda self: self['gcptr64'].unsigned if LJ_GC64 else self['gcptr32'].unsigned), 'gcptr') > + (property(lambda self: self['gcptr64'].unsigned if LJ_GC64 > + else self['gcptr32'].unsigned), 'gcptr') > ], > 'TValue': [ > ('GCRef', 'gcr'), > @@ -137,8 +140,9 @@ c_structs = { > ('uint', 'i'), > ('int', 'it64'), > ('string', 'n'), > - (property(lambda self: self['ftsz'].signed if LJ_GC64 else None), 'ftsz'), > - (property(lambda self: FR(self['fr']) if not LJ_GC64 else None), 'fr') > + (property(lambda self: FR(self['fr']) if not LJ_GC64 else None), 'fr'), > + (property(lambda self: self['ftsz'].signed if LJ_GC64 else None), > + 'ftsz') > ], > 'GCState': [ > ('GCRef', 'root'), > @@ -223,16 +227,10 @@ for cls in c_structs.keys(): > for cls in Struct.__subclasses__(): > ptr_name = cls.__name__ + 'Ptr' > > - def make_ptr_init(nm, cls): > - return type( > - nm, > - (Ptr,), > - { > - '__init__': lambda self, value: super(type(self), self).__init__(value, cls) > - } > - ) > - > - globals()[ptr_name] = make_ptr_init(ptr_name, cls) > + globals()[ptr_name] = type(ptr_name, (Ptr,), { > + '__init__': > + lambda self, value: super(type(self), self).__init__(value, cls) > + }) > > > class Command(object): > @@ -590,9 +588,9 @@ def dump_lj_tfunc(tv): > > if ffid == 0: > pt = funcproto(func) > - return 'Lua function @ {addr}, {nupvals} upvalues, {chunk}:{line}'.format( > + return 'Lua function @ {addr}, {nups} upvalues, {chunk}:{line}'.format( > addr=strx64(func), > - nupvals=func.nupvalues, > + nups=func.nupvalues, > chunk=strdata(cast(GCstrPtr, gcval(pt.chunkname))), > line=pt.firstline > ) > @@ -737,7 +735,8 @@ def frame_prevl(framelink): > # a struct member of 32-bit type to 64-bit type without getting onto > # the next property bits, despite the fact that it's an actual value, not > # a pointer to it. > - return framelink - (1 + LJ_FR2 + bc_a(vtou64(dbg_eval('((BCIns *)' + str(frame_pc(framelink)) + ')[-1]')))) > + bcins = vtou64(dbg_eval('((BCIns *)' + str(frame_pc(framelink)) + ')[-1]')) > + return framelink - (1 + LJ_FR2 + bc_a(bcins)) > > > def frame_ispcall(framelink): > @@ -852,10 +851,15 @@ def dump_stack(L, base=None, top=None): > 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), > + '{start}:{end} [ ] {nfreeslots} slots: Free stack slots'.format( > + start='{address:{padding}}'.format( > + address=strx64(top + 1), > + padding=len(PADDING), > + ), > + end='{address:{padding}}'.format( > + address=strx64(maxstack - 1), > + padding=len(PADDING), > + ), > nfreeslots=int((maxstack - top - 8) >> 3), > ), > ]) > @@ -1075,9 +1079,10 @@ def register_commands(debugger, commands): > for command, cls in commands.items(): > cls.command = command > debugger.HandleCommand( > - 'command script add --overwrite --class luajit_lldb.{cls} {command}'.format( > + 'command script add --overwrite --class luajit_lldb.{cls} {cmd}' > + .format( > cls=cls.__name__, > - command=cls.command, > + cmd=cls.command, > ) > ) > print('{cmd} command intialized'.format(cmd=cls.command)) > -- > 2.30.2 > Best regards, Maxim Kokryashkin