What changed, and why it matters
This commit only fixes code style issues in Python test and helper scripts. It adds spaces inside f-strings and log messages so that an automated style checker (pycodestyle) passes. None of the changes affect program logic, security checks, or how the device handles sensitive data.
No security action needed. This is a cosmetic/style-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is a pure whitespace/formatting cleanup in three Python files: test_jade.py, tools/fwtools.py, and tools/mkindex.py. Changes include inserting spaces after colons and around braces inside f-strings and log messages (e.g., :- {e} becomes : {e}). No functional code, parsing, validation, or cryptographic paths are modified.
Changed components
test_jade.pytools/fwtools.pytools/mkindex.pyInspect captured patch +7 / −7
diff --git a/test_jade.py b/test_jade.py
index 1431ac3..5e817af 100644
--- a/test_jade.py
+++ b/test_jade.py
@@ -961,9 +961,9 @@ def _test_bad_params(jade, rpc_args, expected_error):
assert 'result' not in reply
assert 'error' in reply
error = reply['error']
- assert error['code'] == JadeError.BAD_PARAMETERS, f"{error['code']}:{rpc_args}"
+ assert error['code'] == JadeError.BAD_PARAMETERS, f"{error['code']}: {rpc_args}"
assert 'message' in error
- assert expected_error in error['message'], f"{error['message']} != {expected_error}:{rpc_args}"
+ assert expected_error in error['message'], f"{error['message']} != {expected_error}: {rpc_args}"
def test_bad_params(jade):
diff --git a/tools/fwtools.py b/tools/fwtools.py
index 5572c0d..6aa5f72 100644
--- a/tools/fwtools.py
+++ b/tools/fwtools.py
@@ -70,7 +70,7 @@ def parse_compressed_filename(filepath):
# File name is:
# <ver>_<config>_<uncompressed-size>_fw.bin[.hash]
filetype = 'firmware hash' if parts[-1] == FWFILE_TYPE_HASH else 'full firmware'
- logger.info(f'Filename suggests {filetype} : {filename}')
+ logger.info(f'Filename suggests {filetype}: {filename}')
fwinfo = FwInfo(parts[0], parts[1], int(parts[2]))
return (parts[-1], fwinfo, None)
diff --git a/tools/mkindex.py b/tools/mkindex.py
index 98c50fa..43d6918 100755
--- a/tools/mkindex.py
+++ b/tools/mkindex.py
@@ -26,7 +26,7 @@ def load_hash_file(filename, fwhashes):
assert len(fwhash) == 64
fwhashes[info] = fwhash
else:
- logger.error(f'Skipping non-hash file "{filename}":- {e}')
+ logger.error(f'Skipping non-hash file "{filename}": {e}')
def process_fw_filename(fwname, fwhashes):
@@ -97,7 +97,7 @@ def process_current_directory(vstable, vbeta):
try:
load_hash_file(filename, full_fw_hashes)
except Exception as e:
- logger.error(f'Skipping "{filename}":- {e}')
+ logger.error(f'Skipping "{filename}": {e}')
# Iterate through firmware files, collating the summary info about each one
# in dictionaries for each release label (beta, stable, previous)
@@ -109,7 +109,7 @@ def process_current_directory(vstable, vbeta):
else:
logging.error(f'Skipping unhandled file: {fwname}')
except Exception as e:
- logger.error(f'Skipping "{fwname}":- {e}')
+ logger.error(f'Skipping "{fwname}": {e}')
return {'beta': _sort_release_dict(beta),
'stable': _sort_release_dict(stable),
@@ -121,7 +121,7 @@ if __name__ == '__main__':
jadehandler = logging.StreamHandler()
logger.addHandler(jadehandler)
- assert len(sys.argv) in [3, 4], f'Usage: {sys.argv[0]} <directory> <ver_stable> [ <ver_beta> ]'
+ assert len(sys.argv) in [3, 4], f'Usage: {sys.argv[0]} <directory> <ver_stable> [<ver_beta>]'
dir, vstable, vbeta = sys.argv[1], sys.argv[2], sys.argv[3] if len(sys.argv) > 3 else None
assert os.path.exists(dir) and os.path.isdir(dir), f'Directory {dir} not found.'
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.