Skip to content

Commit 0b79656

Browse files
committed
fix: satisfy flake8 — drop unused import, shorten long lines
1 parent 4a84364 commit 0b79656

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pre_commit_hooks/check_dco.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import argparse
1313
import re
1414
from collections.abc import Sequence
15-
from typing import Optional
1615

1716
DCO_PATTERN = re.compile(
1817
r'^Signed-off-by:\s+'
@@ -54,7 +53,7 @@ def check_dco(commit_msg_path: str) -> tuple[int, list[str]]:
5453
# No sign-off found at all
5554
errors.append(
5655
f'{commit_msg_path}: missing Signed-off-by line. '
57-
f'Add "Signed-off-by: Your Name <your@email>" to the commit message.',
56+
f'Add "Signed-off-by: Name <email>" to the commit message.',
5857
)
5958

6059
for err in errors:

tests/check_dco_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ def test_multiline_commit_with_signoff():
118118

119119
def test_missing_signoff():
120120
"""A commit message without any Signed-off-by line should fail."""
121-
msg = _write_commit_msg('fix: resolve timeout issue\n\nJust a quick fix.\n')
121+
body = 'fix: resolve timeout issue\n\nJust a quick fix.\n'
122+
msg = _write_commit_msg(body)
122123
try:
123124
code, errors = check_dco(msg)
124125
assert code == 1

0 commit comments

Comments
 (0)