From 0b79656568d3051747425331200030a02b5b997a Mon Sep 17 00:00:00 2001 From: Ikalus1988 <136884451+Ikalus1988@users.noreply.github.com> Date: Sat, 13 Jun 2026 15:56:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20satisfy=20flake8=20=E2=80=94=20drop=20un?= =?UTF-8?q?used=20import,=20shorten=20long=20lines?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pre_commit_hooks/check_dco.py | 3 +-- tests/check_dco_test.py | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pre_commit_hooks/check_dco.py b/pre_commit_hooks/check_dco.py index 1e3a5b2..e7e888a 100644 --- a/pre_commit_hooks/check_dco.py +++ b/pre_commit_hooks/check_dco.py @@ -12,7 +12,6 @@ from __future__ import annotations import argparse import re from collections.abc import Sequence -from typing import Optional DCO_PATTERN = re.compile( r'^Signed-off-by:\s+' @@ -54,7 +53,7 @@ def check_dco(commit_msg_path: str) -> tuple[int, list[str]]: # No sign-off found at all errors.append( f'{commit_msg_path}: missing Signed-off-by line. ' - f'Add "Signed-off-by: Your Name " to the commit message.', + f'Add "Signed-off-by: Name " to the commit message.', ) for err in errors: diff --git a/tests/check_dco_test.py b/tests/check_dco_test.py index 73d856f..8b07ddd 100644 --- a/tests/check_dco_test.py +++ b/tests/check_dco_test.py @@ -118,7 +118,8 @@ def test_multiline_commit_with_signoff(): def test_missing_signoff(): """A commit message without any Signed-off-by line should fail.""" - msg = _write_commit_msg('fix: resolve timeout issue\n\nJust a quick fix.\n') + body = 'fix: resolve timeout issue\n\nJust a quick fix.\n' + msg = _write_commit_msg(body) try: code, errors = check_dco(msg) assert code == 1