[ovs-dev] [PATCH v4 3/7] checkpatch: move the checks to the framework

Ben Pfaff blp at ovn.org
Mon May 1 20:27:30 UTC 2017


On Mon, May 01, 2017 at 04:14:05PM -0400, Aaron Conole wrote:
> All of the checks are now part of the new 'check' framework.
> 
> Signed-off-by: Aaron Conole <aconole at redhat.com>
> ---
>  utilities/checkpatch.py | 41 ++++++++++++++++++++++++++---------------
>  1 file changed, 26 insertions(+), 15 deletions(-)
> 
> diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
> index 30c0a3e..9d4e469 100755
> --- a/utilities/checkpatch.py
> +++ b/utilities/checkpatch.py
> @@ -177,7 +177,32 @@ checks = [
>       lambda x: not any([fmt in x for fmt in line_length_blacklist]),
>       'check': lambda x: line_length_check(x),
>       'print':
> -     lambda x: print_warning("Line is greater than 79-characters long", x)}
> +     lambda x: print_warning("Line is greater than 79-characters long", x)},
> +
> +    {'regex': '$(?<!\.mk)',
> +     'match_name': None,
> +     'check': lambda x: not leading_whitespace_is_spaces(x),
> +     'print':
> +     lambda(x): print_warning("Line has non-spaces leading whitespace", x)},

I changed this to "lambda x:" in my copy, to avoid a flake8 warning.


More information about the dev mailing list