Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
ci: add ruff lint check for unused imports and variables
Jiajun Xie5ee96721f7c4
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex e00362d02..fac9be66c 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -30,5 +30,8 @@ jobs:- name: Install all dependenciesrun: uv sync --all-extras+ - name: Lint with ruff+ run: uv run ruff check nanobot --select F401,F841+- name: Run testsrun: uv run pytest tests/diff --git a/nanobot/agent/__init__.py b/nanobot/agent/__init__.pyindex a8805a3ad..9eef5a0c6 100644--- a/nanobot/agent/__init__.py+++ b/nanobot/agent/__init__.py@@ -3,7 +3,7 @@from nanobot.agent.context import ContextBuilderfrom nanobot.agent.hook import AgentHook, AgentHookContext, CompositeHookfrom nanobot.agent.loop import AgentLoop-from nanobot.agent.memory import Consolidator, Dream, MemoryStore+from nanobot.agent.memory import Dream, MemoryStorefrom nanobot.agent.skills import SkillsLoaderfrom nanobot.agent.subagent import SubagentManagerdiff --git a/nanobot/agent/loop.py b/nanobot/agent/loop.pyindex 93dcaabec..9e5ca0bc9 100644--- a/nanobot/agent/loop.py+++ b/nanobot/agent/loop.py@@ -4,7 +4,6 @@ from __future__ import annotationsimport asyncioimport json-import reimport osimport timefrom contextlib import AsyncExitStack, nullcontextdiff --git a/nanobot/channels/feishu.py b/nanobot/channels/feishu.pyindex 4798b818b..c6124d0c9 100644--- a/nanobot/channels/feishu.py+++ b/nanobot/channels/feishu.py@@ -9,7 +9,6 @@ import timeimport uuidfrom collections import OrderedDictfrom dataclasses import dataclass-from pathlib import Pathfrom typing import Any, Literalfrom loguru import loggerdiff --git a/nanobot/channels/matrix.py b/nanobot/channels/matrix.pyindex a1435fcf3..85a167a3a 100644--- a/nanobot/channels/matrix.py+++ b/nanobot/channels/matrix.py@@ -18,7 +18,6 @@ try:from nio import (AsyncClient,AsyncClientConfig,- ContentRepositoryConfigError,DownloadError,InviteEvent,JoinError,diff --git a/nanobot/channels/telegram.py b/nanobot/channels/telegram.pyindex 07ea7cb05..aeb36d8e4 100644--- a/nanobot/channels/telegram.py+++ b/nanobot/channels/telegram.py@@ -6,14 +6,14 @@ import asyncioimport reimport timeimport unicodedata-from dataclasses import dataclass, field+from dataclasses import dataclassfrom typing import Any, Literalfrom loguru import loggerfrom pydantic import Fieldfrom telegram import BotCommand, ReactionTypeEmoji, ReplyParameters, Updatefrom telegram.error import BadRequest, NetworkError, TimedOut-from telegram.ext import Application, CommandHandler, ContextTypes, MessageHandler, filters+from telegram.ext import Application, ContextTypes, MessageHandler, filtersfrom telegram.request import HTTPXRequestfrom nanobot.bus.events import OutboundMessagediff --git a/nanobot/channels/weixin.py b/nanobot/channels/weixin.pyindex 2266bc9f0..3f87e2203 100644--- a/nanobot/channels/weixin.py+++ b/nanobot/channels/weixin.py@@ -484,7 +484,7 @@ class WeixinChannel(BaseChannel):except httpx.TimeoutException:# Normal for long-poll, just retrycontinue- except Exception as e:+ except Exception:if not self._running:breakconsecutive_failures += 1