ruff RUF010 (use explicit conversion flag)

This commit is contained in:
The MMGen Project 2026-08-07 09:37:47 +00:00
commit 91586dbbe5
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
6 changed files with 5 additions and 6 deletions

View file

@ -32,7 +32,6 @@ ignore = [
"PLW0602", # Using global for `stdout_save` but no assignment is done
"PLW1510", # `subprocess.run` without explicit `check` argument
"RET501", # Do not explicitly `return None` in function if it is the only possible return value
"RUF010", # Use explicit conversion flag
"RUF012", # Mutable default value for class attribute
"RUF013", # PEP 484 prohibits implicit `Optional`
"RUF015", # Prefer `next(s for s in res if 'ersion' in s)` over single element slice

View file

@ -35,7 +35,7 @@ def build_libsecp256k1():
run(['git', 'clone', 'https://github.com/bitcoin-core/secp256k1.git'], check=True, cwd=cache_path)
if not lib_file.exists():
print(f'\nBuilding libsecp256k1 (cwd={str(src_path)})')
print(f'\nBuilding libsecp256k1 (cwd={src_path!s})')
cmds = (
['sh', './autogen.sh'],
['sh', './configure', 'CFLAGS=-g -O2 -fPIC', '--disable-dependency-tracking',

View file

@ -269,7 +269,7 @@ class CmdTestInput(CmdTestBase):
else:
t.send(text, delay=delay)
ret = t.expect_getend(' ==> ')
assert ret == repr(expect), f'Text mismatch! {ret} != {repr(expect)}'
assert ret == repr(expect), f'Text mismatch! {ret} != {expect!r}'
return t
def _get_char(self, func_args, text, expect, term):

View file

@ -639,7 +639,7 @@ class CmdTestMain(CmdTestBase, CmdTestShared):
ad.add(al)
aix = AddrIdxList(fmt_str=self.cfgs[s]['addr_idx_list'])
if len(aix) != addrs_per_wallet:
die('TestSuiteFatalException', f'Address index list length != {addrs_per_wallet}: {repr(aix)}')
die('TestSuiteFatalException', f'Address index list length != {addrs_per_wallet}: {aix!r}')
tx_data[s] = {
'addrfile': addrfile,
'chk': al.chksum,

View file

@ -494,7 +494,7 @@ class CmdTestSwap(CmdTestSwapMethods, CmdTestRegtest, CmdTestAutosignThreaded):
'--usr-randchars=0',
'--hash-preset=1',
'--label=SwapWalletLabel',
f'--outdir={str(dest)}',
f'--outdir={dest!s}',
dfl_bip39_file])
t.expect('wallet: ', rt_pw + '\n')
t.expect('phrase: ', rt_pw + '\n')

View file

@ -48,7 +48,7 @@ def test_fmt(data):
res = amt.fmt(*args, **kwargs)
vmsg(fs.format(
proto.upper(),
f'[{str(amt)}]',
f'[{amt!s}]',
'None' if iwidth is None else iwidth,
'None' if prec is None else prec,
f'[{res}]'))