From ba1af461de47eaaea80504f9b445cd5523e523d1 Mon Sep 17 00:00:00 2001 From: user Date: Sun, 22 Feb 2026 05:58:10 +0100 Subject: [PATCH] fix: use gitleaks CLI instead of licensed action, fix lint errors - Replace gitleaks-action (requires paid license) with direct CLI invocation -- same engine, no license needed - Fix ruff I001 import sorting in voice.py and test_llm.py - Remove unused imports: _chat_request (test_llm), Path (test_music) - Remove unused assignment: original_spawn (test_voice) Co-Authored-By: Claude Opus 4.6 --- .gitea/workflows/ci.yml | 9 ++++++--- plugins/voice.py | 2 +- tests/test_llm.py | 2 -- tests/test_music.py | 1 - tests/test_voice.py | 1 - 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index cd27db3..0ecc709 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -12,9 +12,12 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: gitleaks/gitleaks-action@v2 - env: - GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }} + - name: Install gitleaks + run: | + curl -sSL https://github.com/gitleaks/gitleaks/releases/latest/download/gitleaks_8.24.3_linux_x64.tar.gz \ + | tar xz -C /usr/local/bin gitleaks + - name: Scan for secrets + run: gitleaks detect --source . --verbose lint: runs-on: ubuntu-latest diff --git a/plugins/voice.py b/plugins/voice.py index 53539ef..0ec6e30 100644 --- a/plugins/voice.py +++ b/plugins/voice.py @@ -13,8 +13,8 @@ import json import logging import threading import time -import wave import urllib.request +import wave from derp.http import urlopen as _urlopen from derp.plugin import command diff --git a/tests/test_llm.py b/tests/test_llm.py index 4431e71..9a30cb0 100644 --- a/tests/test_llm.py +++ b/tests/test_llm.py @@ -23,7 +23,6 @@ from plugins.llm import ( # noqa: E402 _COOLDOWN, _MAX_HISTORY, _MAX_REPLY_LEN, - _chat_request, _check_cooldown, _extract_reply, _get_api_key, @@ -35,7 +34,6 @@ from plugins.llm import ( # noqa: E402 cmd_chat, ) - # -- Helpers ----------------------------------------------------------------- class _FakeState: diff --git a/tests/test_music.py b/tests/test_music.py index 6b91f02..afe9c74 100644 --- a/tests/test_music.py +++ b/tests/test_music.py @@ -4,7 +4,6 @@ import asyncio import importlib.util import sys import time -from pathlib import Path from unittest.mock import AsyncMock, MagicMock, patch # -- Load plugin module directly --------------------------------------------- diff --git a/tests/test_voice.py b/tests/test_voice.py index 23046c0..8fe4d98 100644 --- a/tests/test_voice.py +++ b/tests/test_voice.py @@ -182,7 +182,6 @@ class TestSayCommand: msg = _Msg(text="!say hello world") spawned = [] - original_spawn = bot._spawn def track_spawn(coro, *, name=None): spawned.append(name)