poky/meta/lib/patchtest/tests/test_mbox_signed_off_by.py
Trevor Gamblin 2fdabc368a patchtest: improve test issue messages
The patchtest tests provide vague feedback to the user, and many of them
also provide redundant 'fix' strings that could easily be incorporated
into the issue messages themselves. Simplify them so that it is more
clear what the errors are and how they can be addressed. No
recommendation is given when the issue string adequately conveys the
issue, e.g. with a missing "LICENSE" entry in a newly-created recipe.

(From OE-Core rev: 0bfb3614244ec7aa79b6424bc63f9f2bccdabe98)

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-13 11:53:06 +01:00

28 lines
913 B
Python

# Checks related to the patch's signed-off-by lines
#
# Copyright (C) 2016 Intel Corporation
#
# SPDX-License-Identifier: GPL-2.0
import base
import parse_signed_off_by
import re
class SignedOffBy(base.Base):
revert_shortlog_regex = re.compile('Revert\s+".*"')
@classmethod
def setUpClassLocal(cls):
# match self.mark with no '+' preceding it
cls.prog = parse_signed_off_by.signed_off_by
def test_signed_off_by_presence(self):
for commit in SignedOffBy.commits:
# skip those patches that revert older commits, these do not required the tag presence
if self.revert_shortlog_regex.match(commit.shortlog):
continue
if not SignedOffBy.prog.search_string(commit.payload):
self.fail('Mbox is missing Signed-off-by. Add it manually or with "git commit --amend -s"',
commit=commit)