[ovs-git] [openvswitch/ovs] 9307fc: checkpatch: Escape range operators inside regex.

Ben Pfaff noreply at github.com
Fri Feb 22 20:51:01 UTC 2019


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 9307fc4600ea586ecf898754acb1b37762ce7748
      https://github.com/openvswitch/ovs/commit/9307fc4600ea586ecf898754acb1b37762ce7748
  Author: Ilya Maximets <i.maximets at samsung.com>
  Date:   2019-02-22 (Fri, 22 Feb 2019)

  Changed paths:
    M tests/checkpatch.at
    M utilities/checkpatch.py

  Log Message:
  -----------
  checkpatch: Escape range operators inside regex.

' -(' matches a single character in the range between ' ' (index 32)
and '(' (index 40). This leads to the false positive:

  WARNING: Line lacks whitespace around operator
  #445 FILE: ovsdb/monitor.c:573:
      if (--mcs->n_refs == 0) {

Need to escape '-' to have a right behaviour.
This patch additionally escapes all other '-' chars in the similar
regexes and makes them be one per line to ease the review in case of
future changes.

Basic unit tests added.

CC: Joe Stringer <joe at ovn.org>
Fixes: 0d7b16daea50 ("checkpatch: Check for infix operator whitespace.")
Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>




More information about the git mailing list