[PATCH] utils: checkstyle.py: Warn when no valid Signed-off-by line is found

Kieran Bingham kieran.bingham at ideasonboard.com
Mon Aug 5 18:35:25 CEST 2024


Quoting Laurent Pinchart (2024-08-04 13:06:56)
> All commits to libcamera must include a Signed-off-by line, and that
> rule is enforced through git hooks and CI. This however doesn't prevent
> patches from being submitted without an SoB tag, as noticed multiple
> times in the past. Extend the checkstyle.py trailer checker to issue a
> warning when the SoB line is missing to try and improve the situation.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
>  utils/checkstyle.py | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/utils/checkstyle.py b/utils/checkstyle.py
> index 4185c39ac811..7d480bdf4a2f 100755
> --- a/utils/checkstyle.py
> +++ b/utils/checkstyle.py
> @@ -493,6 +493,8 @@ class TrailersChecker(CommitChecker):
>      def check(cls, commit, top_level):
>          issues = []
>  
> +        sob_found = False
> +
>          for trailer in commit.trailers:
>              match = TrailersChecker.trailer_regex.fullmatch(trailer)
>              if not match:
> @@ -515,6 +517,12 @@ class TrailersChecker(CommitChecker):
>                  issues.append(CommitIssue(f"Malformed value '{value}' for commit trailer '{key}'"))
>                  continue
>  
> +            if key == 'Signed-off-by':
> +                sob_found = True
> +
> +        if not sob_found:
> +            issues.append(CommitIssue(f"No valid 'Signed-off-by' trailer found, see Documentation/contributing.rst"))
> +

I guess it doesn't make sense to verify that the commiter also has the
signoff in this case as it's the development phase rather than the merge
phase?

But I guess it does catch / help patch submitters know they have to sign
off.

I fear that anyone who /would/ be caught by this warning - wouldn't have
run checkstyle though.

Still, fine with me if you want to add it:

Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

>          return issues
>  
>  
> 
> base-commit: 19bbca3c0b376ba0183f5db53472c8c46cd402b5
> -- 
> Regards,
> 
> Laurent Pinchart
>


More information about the libcamera-devel mailing list