Commit a4070dd
src/danmu/sync.py
@@ -35,7 +35,6 @@ TURSO_KWARGS: dict = {
}
-# ruff: noqa: S608
@cache.memoize(ttl=3600)
async def sync_livechats() -> None:
if not DANMU.SYNC_ENABLE:
src/database/turso.py
@@ -7,7 +7,6 @@ from config import DB, PROXY, cache
from networking import hx_req
-# ruff: noqa: S608
@cache.memoize(ttl=0)
async def turso_db_url(
db_name: str = "bennybot",
src/history/d1.py
@@ -18,8 +18,6 @@ from history.utils import check_save_history
from messages.parser import parse_msg
from utils import i_am_bot, nowdt
-# ruff: noqa: S608
-
DB_COLUMNS = "mid INTEGER PRIMARY KEY, mtype TEXT, time TEXT NOT NULL, user TEXT, content TEXT, filename TEXT, urls TEXT, reply INTEGER, mime TEXT, uid INTEGER, segmented TEXT"
INDEX_NAMES = ["time", "uid"]
src/history/query.py
@@ -180,8 +180,6 @@ def parse_queries(texts: str, qtype: str) -> tuple[str, str, str, str, str]:
async def query_turso(client: Client, cinfo: dict[str, str], match_time: str, user: str, keyword: str) -> dict:
"""Query chat history from Turso."""
- # ruff: noqa: S608
-
segmented = " ".join(cutter.cutword(keyword))
texts_to_match = keyword if segmented == keyword else f'"{keyword}" OR "{segmented}"' # must use double quotes for inner part
sql = f"SELECT T.mid, T.mtype, T.time, T.fullname, T.content FROM '{cinfo['tablename']}' AS T JOIN fts_{cinfo['cid']} AS FTS ON T.mid = FTS.rowid WHERE FTS.segmented MATCH '{texts_to_match}'"
src/history/turso.py
@@ -17,8 +17,6 @@ from history.utils import TURSO_KWARGS, check_save_history, fine_grained_check,
from messages.parser import parse_chat, parse_msg
from utils import i_am_bot, nowdt, slim_cid, to_int, true
-# ruff: noqa: S608
-
CHAT_COLUMNS = "cid INTEGER PRIMARY KEY, ctype TEXT, ctitle TEXT, chandle TEXT, tablename TEXT, tags TEXT"
USER_COLUMNS = "ctitle TEXT, full_name TEXT, handle TEXT, tags TEXT, name TEXT, uid INTEGER, cid INTEGER, id INTEGER PRIMARY KEY"
USER_INDEXES = ["uid", "cid"]
pyproject.toml
@@ -87,6 +87,7 @@ ignore = [
"S311",
"TD",
"FIX002",
+ "S608",
]
select = ["ALL"]