SFT-3834: formatted code, added autopep8 to nix devshell
What changed, and why it matters
This commit is purely cosmetic: it reformats Python code to follow style rules, fixes spacing around '@classmethod' decorators, and adds an auto-formatting tool (autopep8) to the developer environment. No program behavior or security properties change.
No security action needed. This is a routine code-style and developer-tooling commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff shows only whitespace/formatting changes. In health_check_common_flow.py a long function call is split across multiple lines. In utils.py, ‘@ classmethod’ is changed to ‘@classmethod’ in three places. In flake.nix, python3Packages.autopep8 is added to the nix devshell packages. None of these changes alter logic, parsing, or execution semantics.
Changed components
ports/stm32/boards/Passport/modules/flows/health_check_common_flow.pyports/stm32/boards/Passport/modules/utils.pyflake.nixInspect captured patch +11 / −5
diff --git a/flake.nix b/flake.nix
index f8edcf2..db60112 100644
--- a/flake.nix
+++ b/flake.nix
@@ -126,6 +126,7 @@
python3
python3Packages.pip
python3Packages.virtualenv
+ python3Packages.autopep8
reuse
rust-cbindgen
xterm
diff --git a/ports/stm32/boards/Passport/modules/flows/health_check_common_flow.py b/ports/stm32/boards/Passport/modules/flows/health_check_common_flow.py
index 4981dc9..3e2f4da 100644
--- a/ports/stm32/boards/Passport/modules/flows/health_check_common_flow.py
+++ b/ports/stm32/boards/Passport/modules/flows/health_check_common_flow.py
@@ -87,8 +87,13 @@ class HealthCheckCommonFlow(Flow):
from tasks import sign_text_file_task
from utils import spinner_task
text = 'Signing message' if self.normal_signing else 'Performing health check'
- (signature, address, error) = await spinner_task(text, sign_text_file_task,
- args=[self.text, self.subpath, self.addr_type, self.address if self.normal_signing else None])
+ (signature, address, error) = \
+ await spinner_task(text,
+ sign_text_file_task,
+ args=[self.text,
+ self.subpath,
+ self.addr_type,
+ self.address if self.normal_signing else None])
if error is None:
self.signature = signature
self.address = address
diff --git a/ports/stm32/boards/Passport/modules/utils.py b/ports/stm32/boards/Passport/modules/utils.py
index a2b7ef0..0e71da1 100644
--- a/ports/stm32/boards/Passport/modules/utils.py
+++ b/ports/stm32/boards/Passport/modules/utils.py
@@ -304,7 +304,7 @@ class InputMode():
NUMERIC = 2
PUNCTUATION = 3
- @ classmethod
+ @classmethod
def to_str(cls, mode):
if mode == InputMode.UPPER_ALPHA:
return 'A-Z'
@@ -317,7 +317,7 @@ class InputMode():
else:
return ''
- @ classmethod
+ @classmethod
def cycle_to_next(cls, mode):
if mode == InputMode.NUMERIC:
return InputMode.LOWER_ALPHA
@@ -326,7 +326,7 @@ class InputMode():
else:
return InputMode.NUMERIC
- @ classmethod
+ @classmethod
def get_icon(cls, mode):
if mode == InputMode.UPPER_ALPHA:
return lv.ICON_INPUT_MODE_UPPER_ALPHA
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.