From 711a5af0c161cebe506f0b8c5d9424433d98eb5c Mon Sep 17 00:00:00 2001 From: Netanel Cohen Date: Thu, 16 May 2024 16:39:24 +0300 Subject: [PATCH] Fix linter issues --- hilda/hilda_client.py | 4 ++-- hilda/launch_lldb.py | 2 +- hilda/snippets/dyld.py | 2 +- hilda/snippets/mach/CFRunLoopServiceMachPort_hooks.py | 3 +-- hilda/snippets/macho/all_image_infos.py | 2 +- hilda/snippets/macho/image_info.py | 2 +- hilda/snippets/macho/macho_load_commands.py | 2 +- hilda/snippets/xpc.py | 2 +- hilda/symbol.py | 2 +- hilda/symbols_jar.py | 3 +-- 10 files changed, 11 insertions(+), 13 deletions(-) diff --git a/hilda/hilda_client.py b/hilda/hilda_client.py index 7cab1c1..e0fa076 100644 --- a/hilda/hilda_client.py +++ b/hilda/hilda_client.py @@ -19,11 +19,11 @@ from pathlib import Path from typing import Any, Callable, List, Optional, Union -import IPython import hexdump -from IPython.core.magic import register_line_magic # noqa: F401 +import IPython from humanfriendly import prompts from humanfriendly.terminal.html import html_to_ansi +from IPython.core.magic import register_line_magic # noqa: F401 from pygments import highlight from pygments.formatters import TerminalTrueColorFormatter from pygments.lexers import XmlLexer diff --git a/hilda/launch_lldb.py b/hilda/launch_lldb.py index b9a4872..efc8401 100644 --- a/hilda/launch_lldb.py +++ b/hilda/launch_lldb.py @@ -1,7 +1,7 @@ import logging import os from threading import Thread -from typing import Optional, List +from typing import List, Optional import coloredlogs diff --git a/hilda/snippets/dyld.py b/hilda/snippets/dyld.py index 60afaf4..609b3aa 100644 --- a/hilda/snippets/dyld.py +++ b/hilda/snippets/dyld.py @@ -1,6 +1,6 @@ -from hilda.lldb_importer import lldb from cached_property import cached_property +from hilda.lldb_importer import lldb from hilda.snippets.macho.all_image_infos import AllImageInfos from hilda.snippets.syslog import open_syslog_socket diff --git a/hilda/snippets/mach/CFRunLoopServiceMachPort_hooks.py b/hilda/snippets/mach/CFRunLoopServiceMachPort_hooks.py index 09e8b4d..621a8d5 100644 --- a/hilda/snippets/mach/CFRunLoopServiceMachPort_hooks.py +++ b/hilda/snippets/mach/CFRunLoopServiceMachPort_hooks.py @@ -1,6 +1,5 @@ -from hilda.lldb_importer import lldb - from hilda.exceptions import SymbolAbsentError +from hilda.lldb_importer import lldb def _CFRunLoopServiceMachPort_hook(hilda, *args): diff --git a/hilda/snippets/macho/all_image_infos.py b/hilda/snippets/macho/all_image_infos.py index a5a1025..7639e81 100644 --- a/hilda/snippets/macho/all_image_infos.py +++ b/hilda/snippets/macho/all_image_infos.py @@ -1,9 +1,9 @@ import logging -from hilda.lldb_importer import lldb from construct import Array, CString, Hex, If, Int32ub, Int32ul, Int64ul, Pointer, Struct, Tell, this from humanfriendly import prompts +from hilda.lldb_importer import lldb from hilda.snippets.macho.image_info import ImageInfo, dyld_image_info_t from hilda.snippets.macho.macho import mach_header_t from hilda.snippets.uuid import uuid_t diff --git a/hilda/snippets/macho/image_info.py b/hilda/snippets/macho/image_info.py index 539fb6e..6bda3d6 100644 --- a/hilda/snippets/macho/image_info.py +++ b/hilda/snippets/macho/image_info.py @@ -1,6 +1,6 @@ -from hilda.lldb_importer import lldb from construct import CString, If, Int64ul, Pointer, Struct, this +from hilda.lldb_importer import lldb from hilda.snippets.macho.macho import mach_header_t from hilda.snippets.macho.macho_load_commands import LoadCommands from hilda.snippets.uuid import uuid_t diff --git a/hilda/snippets/macho/macho_load_commands.py b/hilda/snippets/macho/macho_load_commands.py index 8cc6e02..dad0533 100644 --- a/hilda/snippets/macho/macho_load_commands.py +++ b/hilda/snippets/macho/macho_load_commands.py @@ -1,9 +1,9 @@ from typing import List -from hilda.lldb_importer import lldb from construct import Array, Bytes, Enum, Hex, Int8ul, Int32ul, Int64ul, PaddedString, Pointer, Seek, Struct, Switch, \ Tell, this +from hilda.lldb_importer import lldb from hilda.snippets.macho.apple_version import version_t from hilda.symbol import SymbolFormatField diff --git a/hilda/snippets/xpc.py b/hilda/snippets/xpc.py index b763fbf..9c4960b 100644 --- a/hilda/snippets/xpc.py +++ b/hilda/snippets/xpc.py @@ -1,11 +1,11 @@ from pprint import pformat -from hilda.lldb_importer import lldb from pygments import highlight from pygments.formatters import TerminalTrueColorFormatter from pygments.lexers import PythonLexer from hilda.exceptions import ConvertingFromNSObjectError +from hilda.lldb_importer import lldb # module global for storing all active xpc connections active_xpc_connections = {} diff --git a/hilda/symbol.py b/hilda/symbol.py index 3ff3e25..64e13a7 100644 --- a/hilda/symbol.py +++ b/hilda/symbol.py @@ -3,10 +3,10 @@ from contextlib import contextmanager from typing import Any, Optional -from hilda.lldb_importer import lldb from construct import FormatField from hilda.common import CfSerializable +from hilda.lldb_importer import lldb from hilda.objective_c_class import Class ADDRESS_SIZE_TO_STRUCT_FORMAT = {1: 'B', 2: 'H', 4: 'I', 8: 'Q'} diff --git a/hilda/symbols_jar.py b/hilda/symbols_jar.py index 7599d6d..32f2952 100644 --- a/hilda/symbols_jar.py +++ b/hilda/symbols_jar.py @@ -1,8 +1,7 @@ from contextlib import suppress -from hilda.lldb_importer import lldb - from hilda.exceptions import AddingLldbSymbolError, SymbolAbsentError +from hilda.lldb_importer import lldb class SymbolsJar(dict):