[Tarantool-patches] [PATCH luajit 10/15] test: fix E305 errors by pycodestyle
Igor Munkin
imun at tarantool.org
Thu Aug 3 10:30:35 MSK 2023
Fixed 10 occurrences of E305 ("expected 2 blank lines after class or
function definition, found 1") error reported by pycodestyle[1].
Furthermore, some other spots have been re-aligned the similar way to be
in sync with the default code style.
[1]: https://www.flake8rules.com/rules/E305.html
Signed-off-by: Igor Munkin <imun at tarantool.org>
---
src/luajit-gdb.py | 15 +++++++++++++++
src/luajit_lldb.py | 10 ++++++++++
2 files changed, 25 insertions(+)
diff --git a/src/luajit-gdb.py b/src/luajit-gdb.py
index 9c51be0b..3babb1d5 100644
--- a/src/luajit-gdb.py
+++ b/src/luajit-gdb.py
@@ -7,6 +7,7 @@ import sys
# make script compatible with the ancient Python {{{
+
LEGACY = re.match(r'^2\.', sys.version)
if LEGACY:
@@ -14,8 +15,10 @@ if LEGACY:
int = long
range = xrange
+
# }}}
+
gtype_cache = {}
@@ -70,8 +73,10 @@ def strx64(val):
return re.sub('L?$', '',
hex(int(cast('uint64_t', val) & 0xFFFFFFFFFFFFFFFF)))
+
# Types {{{
+
LJ_T = {
'NIL': i2notu32(0),
'FALSE': i2notu32(1),
@@ -95,10 +100,12 @@ def typenames(value):
LJ_T[k]: 'LJ_T' + k for k in LJ_T.keys()
}.get(int(value), 'LJ_TINVALID')
+
# }}}
# Frames {{{
+
FRAME_TYPE = 0x3
FRAME_P = 0x4
FRAME_TYPEP = FRAME_TYPE | FRAME_P
@@ -175,10 +182,12 @@ def frame_prev(framelink):
def frame_sentinel(L):
return mref('TValue *', L['stack']) + LJ_FR2
+
# }}}
# Const {{{
+
LJ_64 = None
LJ_GC64 = None
LJ_FR2 = None
@@ -194,6 +203,7 @@ LJ_LIGHTUD_BITS_LO = 47 - LJ_LIGHTUD_BITS_SEG
LIGHTUD_SEG_MASK = (1 << LJ_LIGHTUD_BITS_SEG) - 1
LIGHTUD_LO_MASK = (1 << LJ_LIGHTUD_BITS_LO) - 1
+
# }}}
@@ -339,6 +349,7 @@ def gcringlen(root):
else:
return 1 + gclistlen(gcnext(root), gcref(root))
+
gclen = {
'root': gclistlen,
'gray': gclistlen,
@@ -374,6 +385,7 @@ def lightudV(tv):
else:
return gcval(tv['gcr'])
+
# Dumpers {{{
@@ -465,8 +477,10 @@ def dump_lj_tnumx(tv):
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,
@@ -867,4 +881,5 @@ def load(event=None):
'lj-gc': LJGC,
})
+
load(None)
diff --git a/src/luajit_lldb.py b/src/luajit_lldb.py
index bdd9e716..325b40ec 100644
--- a/src/luajit_lldb.py
+++ b/src/luajit_lldb.py
@@ -18,6 +18,8 @@ LJ_GCVMASK = ((1 << 47) - 1)
LJ_TISNUM = None
# Debugger specific {{{
+
+
# Global
target = None
@@ -121,6 +123,7 @@ class Struct(metaclass=MetaStruct):
def addr(self):
return self.value.address_of
+
c_structs = {
'MRef': [
(property(lambda self: self['ptr64'].unsigned if LJ_GC64 else self['ptr32'].unsigned), 'ptr')
@@ -212,9 +215,11 @@ c_structs = {
'BCIns': []
}
+
for cls in c_structs.keys():
globals()[cls] = type(cls, (Struct, ), {'metainfo': c_structs[cls]})
+
for cls in Struct.__subclasses__():
ptr_name = cls.__name__ + 'Ptr'
@@ -363,6 +368,7 @@ def dbg_eval(expr):
frame = thread.GetSelectedFrame()
return frame.EvaluateExpression(expr)
+
# }}} Debugger specific
@@ -396,6 +402,7 @@ def gcringlen(root):
else:
return 1 + gclistlen(gcnext(root), gcref(root))
+
gclen = {
'root': gclistlen,
'gray': gclistlen,
@@ -630,6 +637,7 @@ def dump_lj_tnumx(tv):
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,
@@ -647,6 +655,7 @@ dumpers = {
'LJ_TNUMX': dump_lj_tnumx,
}
+
LJ_T = {
'NIL': i2notu32(0),
'FALSE': i2notu32(1),
@@ -682,6 +691,7 @@ def typenames(value):
def dump_tvalue(tvptr):
return dumpers.get(typenames(itypemap(tvptr)), dump_lj_invalid)(tvptr)
+
FRAME_TYPE = 0x3
FRAME_P = 0x4
FRAME_TYPEP = FRAME_TYPE | FRAME_P
--
2.30.2
More information about the Tarantool-patches
mailing list