[ovs-git] [openvswitch/ovs] 517f04: checkpatch: introduce a flexible framework

GitHub noreply at github.com
Mon May 1 20:27:30 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 517f04ad26f68dbb6e35bbca37ab94013e4d8bce
      https://github.com/openvswitch/ovs/commit/517f04ad26f68dbb6e35bbca37ab94013e4d8bce
  Author: Aaron Conole <aconole at redhat.com>
  Date:   2017-05-01 (Mon, 01 May 2017)

  Changed paths:
    M utilities/checkpatch.py

  Log Message:
  -----------
  checkpatch: introduce a flexible framework

Developers wishing to add checks to checkpatch sift through an adhoc mess,
currently.  The process goes something like:
1. Figure out what to test in the patch
2. Write some code, quickly, that checks for that condition
3. Look through the statemachine to find where the check should go
4. ignore parts of the above and just throw something together

That worked fine for the initial development, but as interesting new tests
are developed, it is important to have a more flexible framework that lets
a developer just plug in a new test, easily.

This commit brings in a new framework that allows plugging in checks very
quickly.  Hook up the line-length test as an initial demonstration.

Signed-off-by: Aaron Conole <aconole at redhat.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: a84a1edb33b3230fc915c922b1af8c6621e7bea5
      https://github.com/openvswitch/ovs/commit/a84a1edb33b3230fc915c922b1af8c6621e7bea5
  Author: Aaron Conole <aconole at redhat.com>
  Date:   2017-05-01 (Mon, 01 May 2017)

  Changed paths:
    M utilities/checkpatch.py

  Log Message:
  -----------
  checkpatch: common print_line

With the new framework, print_line can be moved out to the checks
framework.

Signed-off-by: Aaron Conole <aconole at redhat.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: 907848bdd9a48a03e9f59294f3a704de0b078044
      https://github.com/openvswitch/ovs/commit/907848bdd9a48a03e9f59294f3a704de0b078044
  Author: Aaron Conole <aconole at redhat.com>
  Date:   2017-05-01 (Mon, 01 May 2017)

  Changed paths:
    M utilities/checkpatch.py

  Log Message:
  -----------
  checkpatch: move the checks to the framework

All of the checks are now part of the new 'check' framework.

Signed-off-by: Aaron Conole <aconole at redhat.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: 0b93d978cfd46839529a89f7ddc256b409c51460
      https://github.com/openvswitch/ovs/commit/0b93d978cfd46839529a89f7ddc256b409c51460
  Author: Aaron Conole <aconole at redhat.com>
  Date:   2017-05-01 (Mon, 01 May 2017)

  Changed paths:
    M utilities/checkpatch.py

  Log Message:
  -----------
  checkpatch: correct a parsing issue

Occasionally, characters will be sent which violate the
ascii decoder's sense of propriety.  In fact, in-tree there are
a few such files (ex: tests/atlocal.in), and they cause an
exception to be raised when they are encountered.

Set the policy to ignore these cases.  This means these bytes are
omitted from the text stream during processing.

Signed-off-by: Aaron Conole <aconole at redhat.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: ebba2af6188ba48fa3b58e3fc47a433f2228ac80
      https://github.com/openvswitch/ovs/commit/ebba2af6188ba48fa3b58e3fc47a433f2228ac80
  Author: Aaron Conole <aconole at redhat.com>
  Date:   2017-05-01 (Mon, 01 May 2017)

  Changed paths:
    M utilities/checkpatch.py

  Log Message:
  -----------
  checkpatch: print conformance

Other utilities (notoriously the linux kernel's checkpatch.pl) have a more
standardized form for printing file and lines.  With this change, the
template used to print gains two enhancements:
1. Color
2. Conformance with the kernel's version of checkpatch.pl

Signed-off-by: Aaron Conole <aconole at redhat.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: bbbe2fa2e665eeeeffb0b11f645a358f3ce36d13
      https://github.com/openvswitch/ovs/commit/bbbe2fa2e665eeeeffb0b11f645a358f3ce36d13
  Author: Aaron Conole <aconole at redhat.com>
  Date:   2017-05-01 (Mon, 01 May 2017)

  Changed paths:
    M utilities/checkpatch.py

  Log Message:
  -----------
  checkpatch: filename from hunks fix

Filenames that come from the hunks match include the git-ified 'b/'
prefix, which makes jumping to the error file that much harder.  This
patch corrects that by simply skipping those bytes.

Signed-off-by: Aaron Conole <aconole at redhat.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: d56ec3bc0811bf3421ceea76dd70eb8233438c9f
      https://github.com/openvswitch/ovs/commit/d56ec3bc0811bf3421ceea76dd70eb8233438c9f
  Author: Aaron Conole <aconole at redhat.com>
  Date:   2017-05-01 (Mon, 01 May 2017)

  Changed paths:
    M utilities/checkpatch.py

  Log Message:
  -----------
  checkpatch: fix pointer declaration

A common way of expressing 'raise to the power of' when authoring
comments uses **.  This is currently getting caught by the pointer
spacing warning.  So, catch it here.

Reported-by: Lance Richardson <lrichard at redhat.com>
Signed-off-by: Aaron Conole <aconole at redhat.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/d0c961a99f57...d56ec3bc0811


More information about the git mailing list