Check if the commit message has a Signed-off-by line. Args: message (str): The commit message. Returns: bool: True if the message is valid, False otherwise.
(message)
| 5 | |
| 6 | |
| 7 | def commit_message_has_signoff(message): |
| 8 | """ |
| 9 | Check if the commit message has a Signed-off-by line. |
| 10 | |
| 11 | Args: |
| 12 | message (str): The commit message. |
| 13 | |
| 14 | Returns: |
| 15 | bool: True if the message is valid, False otherwise. |
| 16 | """ |
| 17 | for line in message.splitlines(): |
| 18 | if re.match(r'^Signed-off-by: .+ <.+>$', line): |
| 19 | return True |
| 20 | return False |
| 21 | |
| 22 | |
| 23 | def main(): |