diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 166ee4a..43c054a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,13 +3,13 @@ exclude: '^libs/(atom|thirdparty|cpptrace|spdlog)/' repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - - repo: https://github.com/psf/black - rev: 24.10.0 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.3.1 hooks: - id: black - repo: https://github.com/pocc/pre-commit-hooks diff --git a/python/executor/isolated_executor.py b/python/executor/isolated_executor.py index e270d6b..64aabb5 100644 --- a/python/executor/isolated_executor.py +++ b/python/executor/isolated_executor.py @@ -20,7 +20,6 @@ from typing import Any, Dict, List, Optional, Callable import contextlib - # IPC Constants MAGIC = 0x4C495448 # "LITH" VERSION = 1 diff --git a/python/lithium_bridge/registry_api.py b/python/lithium_bridge/registry_api.py index 790df88..cc0ef24 100644 --- a/python/lithium_bridge/registry_api.py +++ b/python/lithium_bridge/registry_api.py @@ -11,7 +11,6 @@ from .exporter import expose_controller, expose_command from .module_info import ModuleRegistry, ModuleCategory, PlatformSupport - # Global registry instance _registry: Optional[ModuleRegistry] = None diff --git a/python/tools/compiler_helper/api.py b/python/tools/compiler_helper/api.py index e6d097d..9afb0f0 100644 --- a/python/tools/compiler_helper/api.py +++ b/python/tools/compiler_helper/api.py @@ -3,6 +3,7 @@ """ High-level API for the compiler helper module. """ + from pathlib import Path from typing import List, Optional, Union @@ -17,7 +18,6 @@ from .compiler import Compiler from .build_manager import BuildManager - # Create a singleton compiler manager for global use compiler_manager = CompilerManager() diff --git a/python/tools/compiler_helper/build_manager.py b/python/tools/compiler_helper/build_manager.py index c1e56dd..e92ac88 100644 --- a/python/tools/compiler_helper/build_manager.py +++ b/python/tools/compiler_helper/build_manager.py @@ -3,6 +3,7 @@ """ Build Manager for handling compilation and linking of C++ projects. """ + import os import time import re diff --git a/python/tools/compiler_helper/cli.py b/python/tools/compiler_helper/cli.py index a6e8fc5..62d702f 100644 --- a/python/tools/compiler_helper/cli.py +++ b/python/tools/compiler_helper/cli.py @@ -3,6 +3,7 @@ """ Command-line interface for the compiler helper module. """ + import sys import argparse from pathlib import Path diff --git a/python/tools/compiler_helper/compiler.py b/python/tools/compiler_helper/compiler.py index 9ee669f..603f155 100644 --- a/python/tools/compiler_helper/compiler.py +++ b/python/tools/compiler_helper/compiler.py @@ -3,6 +3,7 @@ """ Compiler class implementation for the compiler helper module. """ + from dataclasses import dataclass, field import os import platform diff --git a/python/tools/compiler_helper/compiler_manager.py b/python/tools/compiler_helper/compiler_manager.py index 77c1524..0dd56ff 100644 --- a/python/tools/compiler_helper/compiler_manager.py +++ b/python/tools/compiler_helper/compiler_manager.py @@ -3,6 +3,7 @@ """ Compiler Manager for detecting and managing compilers. """ + import os import platform import re diff --git a/python/tools/compiler_helper/core_types.py b/python/tools/compiler_helper/core_types.py index 288ad08..3a2de28 100644 --- a/python/tools/compiler_helper/core_types.py +++ b/python/tools/compiler_helper/core_types.py @@ -3,6 +3,7 @@ """ Core types and exceptions for the compiler helper module. """ + from enum import Enum, auto from typing import List, Dict, Optional, Union, Set, Any, TypedDict, Literal from dataclasses import dataclass, field diff --git a/python/tools/compiler_helper/utils.py b/python/tools/compiler_helper/utils.py index a80bf1a..40d260d 100644 --- a/python/tools/compiler_helper/utils.py +++ b/python/tools/compiler_helper/utils.py @@ -3,6 +3,7 @@ """ Utility functions for the compiler helper module. """ + import json from pathlib import Path from typing import Dict, Any diff --git a/python/tools/compiler_parser.py b/python/tools/compiler_parser.py index a15f737..d9a01fb 100644 --- a/python/tools/compiler_parser.py +++ b/python/tools/compiler_parser.py @@ -29,7 +29,6 @@ import sys from functools import partial - # Configure logging logging.basicConfig( level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s" diff --git a/python/tools/package.py b/python/tools/package.py index e922c61..b651d9b 100644 --- a/python/tools/package.py +++ b/python/tools/package.py @@ -1280,10 +1280,8 @@ def main(): try: if args.check: if pm.is_package_installed(args.check): - print( - f"Package '{args.check}' is installed, version: { - pm.get_installed_version(args.check)}" - ) + print(f"Package '{args.check}' is installed, version: { + pm.get_installed_version(args.check)}") else: print(f"Package '{args.check}' is not installed.") diff --git a/src/target/repository/celestial_repository.cpp b/src/target/repository/celestial_repository.cpp index 512afa9..369234b 100644 --- a/src/target/repository/celestial_repository.cpp +++ b/src/target/repository/celestial_repository.cpp @@ -383,7 +383,7 @@ class CelestialRepository::Impl { } auto stmt = db_->prepare(R"( - SELECT * FROM celestial_objects + SELECT * FROM celestial_objects WHERE identifier LIKE ? OR chinese_name LIKE ? OR aliases LIKE ? ORDER BY click_count DESC LIMIT ? @@ -512,8 +512,8 @@ class CelestialRepository::Impl { std::vector results; try { auto stmt = db_->prepare(R"( - SELECT DISTINCT identifier FROM celestial_objects - WHERE identifier LIKE ? + SELECT DISTINCT identifier FROM celestial_objects + WHERE identifier LIKE ? ORDER BY click_count DESC, identifier ASC LIMIT ? )"); @@ -542,7 +542,7 @@ class CelestialRepository::Impl { double decMax = dec + radius; auto stmt = db_->prepare(R"( - SELECT * FROM celestial_objects + SELECT * FROM celestial_objects WHERE rad_j2000 BETWEEN ? AND ? AND dec_d_j2000 BETWEEN ? AND ? LIMIT ? @@ -578,7 +578,7 @@ class CelestialRepository::Impl { std::vector results; try { auto stmt = db_->prepare(R"( - SELECT * FROM celestial_objects + SELECT * FROM celestial_objects WHERE type = ? ORDER BY click_count DESC LIMIT ? @@ -602,7 +602,7 @@ class CelestialRepository::Impl { std::vector results; try { auto stmt = db_->prepare(R"( - SELECT * FROM celestial_objects + SELECT * FROM celestial_objects WHERE visual_magnitude_v BETWEEN ? AND ? ORDER BY visual_magnitude_v ASC LIMIT ? @@ -1100,7 +1100,7 @@ class CelestialRepository::Impl { std::vector results; try { auto stmt = db_->prepare(R"( - SELECT id, user_id, object_id, rating, timestamp + SELECT id, user_id, object_id, rating, timestamp FROM user_ratings WHERE user_id = ? ORDER BY timestamp DESC LIMIT ? )"); @@ -1242,7 +1242,7 @@ class CelestialRepository::Impl { bool incrementClickCount(const std::string& identifier) { try { auto stmt = db_->prepare(R"( - UPDATE celestial_objects + UPDATE celestial_objects SET click_count = click_count + 1, updated_at = strftime('%s', 'now') WHERE identifier = ? )"); @@ -1259,7 +1259,7 @@ class CelestialRepository::Impl { std::vector results; try { auto stmt = db_->prepare(R"( - SELECT * FROM celestial_objects + SELECT * FROM celestial_objects ORDER BY click_count DESC LIMIT ? )"); stmt->bind(1, limit); diff --git a/tests/server/CMakeLists.txt b/tests/server/CMakeLists.txt index 00a7008..2bdd9fc 100644 --- a/tests/server/CMakeLists.txt +++ b/tests/server/CMakeLists.txt @@ -306,4 +306,3 @@ add_custom_target(server_tests test_controller_sequencer test_websocket_log_stream ) -