On Wed, Apr 6, 2016 at 3:46 PM, Joe Stringer <j...@ovn.org> wrote:

> Although tests ideally also stick to shorter line lengths, it is very
> common for fixed text blocks like flows or large packets to be specified
> within tests. Checkpatch shouldn't complain about cases like these.
>
> Signed-off-by: Joe Stringer <j...@ovn.org>
>

Acked-by: Russell Bryant <russ...@ovn.org>

 @@ -99,14 +105,23 @@ def ovs_checkpatch_parse(text):

>      co_authors = []
>      parse = 0
>      current_file = ''
> +    previous_file = ''
>      scissors = re.compile(r'^[\w]*---[\w]*')
>      hunks = re.compile('^(---|\+\+\+) (\S+)')
>      is_signature = re.compile(r'((\s*Signed-off-by: )(.*))$',
>                                re.I | re.M | re.S)
>      is_co_author = re.compile(r'(\s*(Co-authored-by: )(.*))$',
>                                re.I | re.M | re.S)
> +    skip_line_length_check = False
>
>      for line in text.split('\n'):
> +        if current_file is not previous_file:
> +            previous_file = current_file
> +            for filetype in line_length_blacklist:
> +                if filetype in current_file:
> +                    skip_line_length_check = True
> +                    break
> +
>

Since you made a comment about Python style, the above could also be:

    if current_file != previous_file:
        previous_file = current_file
        if any([ft in current_file for ft in line_length_blacklist]):
            skip_line_length_check = True
            break

-- 
Russell Bryant
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to