mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-06-28 21:50:46 +00:00
fix: satisfy flake8 — drop unused import, shorten long lines
This commit is contained in:
parent
4a84364019
commit
0b79656568
2 changed files with 3 additions and 3 deletions
|
|
@ -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 <your@email>" to the commit message.',
|
||||
f'Add "Signed-off-by: Name <email>" to the commit message.',
|
||||
)
|
||||
|
||||
for err in errors:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue