From 06a873fca43ec44de55415219aedc2b14ae8a1f8 Mon Sep 17 00:00:00 2001 From: taichunmin Date: Tue, 12 Aug 2025 04:25:18 +0800 Subject: [PATCH] fix linter --- software/pyproject.toml | 3 ++- software/script/chameleon_cli_unit.py | 2 +- software/script/tests/test_crypto1.py | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/software/pyproject.toml b/software/pyproject.toml index 4f299e7..b58a7e8 100644 --- a/software/pyproject.toml +++ b/software/pyproject.toml @@ -12,7 +12,8 @@ dependencies = [ [tool.pyrefly] project-includes = ["**/*"] -project-excludes = ['**/*venv/**\*'] +project-excludes = ["**/.venv"] +search-path = ["script"] [dependency-groups] dev = [ diff --git a/software/script/chameleon_cli_unit.py b/software/script/chameleon_cli_unit.py index 0ebd2b7..51b89f1 100644 --- a/software/script/chameleon_cli_unit.py +++ b/software/script/chameleon_cli_unit.py @@ -354,7 +354,7 @@ class MFUAuthArgsUnit(ReaderRequiredUnit): def key_parser(key: str) -> bytes: try: key = bytes.fromhex(key) - except: + except ValueError: raise ValueError("Key should be a hex string") if len(key) not in [4, 16]: diff --git a/software/script/tests/test_crypto1.py b/software/script/tests/test_crypto1.py index db24cbe..bae62ac 100644 --- a/software/script/tests/test_crypto1.py +++ b/software/script/tests/test_crypto1.py @@ -1,11 +1,13 @@ #!/usr/bin/env python3 -import os, sys, unittest +import os +import sys +import unittest +from crypto1 import Crypto1 CURRENT_DIR = os.path.split(os.path.abspath(__file__))[0] config_path = CURRENT_DIR.rsplit(os.sep, 1)[0] sys.path.append(config_path) print(config_path) -from crypto1 import Crypto1 class TestCrypto1(unittest.TestCase):