From b58825c6b65b8b02b82dd8a91aabbc236fff7aac Mon Sep 17 00:00:00 2001 From: AIOSAI Date: Fri, 15 May 2026 14:21:21 -0700 Subject: [PATCH] =?UTF-8?q?feat(drone):=20block=20commits=20on=20ruff=20li?= =?UTF-8?q?nt=20errors=20=E2=80=94=20catch=20unfixable=20issues=20before?= =?UTF-8?q?=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/aipass/drone/apps/handlers/git/commit_handler.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/aipass/drone/apps/handlers/git/commit_handler.py b/src/aipass/drone/apps/handlers/git/commit_handler.py index df5d00dc..19d579c2 100644 --- a/src/aipass/drone/apps/handlers/git/commit_handler.py +++ b/src/aipass/drone/apps/handlers/git/commit_handler.py @@ -99,6 +99,18 @@ def commit_changes( text=True, cwd=str(repo_root), ) + lint_check = subprocess.run( + [ruff_bin, "check", "src/", "tests/"], + capture_output=True, + text=True, + cwd=str(repo_root), + ) + if lint_check.returncode != 0: + return { + "stdout": "", + "stderr": f"Lint errors — fix before committing:\n{lint_check.stdout.strip()}", + "exit_code": 1, + } add_result = subprocess.run( ["git", "add", "-A"], capture_output=True,