]> git.proxmox.com Git - mirror_edk2.git/commit
BaseTools/Scripts: Add PatchCheck.py script
authorJordan Justen <jordan.l.justen@intel.com>
Thu, 22 Oct 2015 06:01:02 +0000 (06:01 +0000)
committerjljusten <jljusten@Edk2>
Thu, 22 Oct 2015 06:01:02 +0000 (06:01 +0000)
commita7e173b07a1ef336fc8d753cf85ae8473e92365a
tree28310fe7b3fc0e92a82254bd3ebd92d50b0238c7
parent0f34a051104e2b1b9123d56d48673de4b21bc533
BaseTools/Scripts: Add PatchCheck.py script

This script can be used to check some expected rules for EDK II
patches. It only works on git formatted patches.

It checks both the commit message and the lines that are added in the
patch diff.

In the commit message it verifies line lengths, signature formats, and
the Contributed-under tag.

In the patch, it checks that line endings are CRLF for all files that
don't have a .sh extension. It verifies that no trailing whitespace is
present and that tab characters are not used.

Patch contributors should use this script prior to submitting their
patches. Package maintainers can also use it to verify incoming
patches.

It can also be run by specifying a git revision list, so actual patch
files are not always required.

For example, to checkout this last 5 patches in your git branch you
can run:

  python PatchCheck.py HEAD~5..

Or, a shortcut (like git log):

  python PatchCheck.py -5

The --oneline option works similar to git log --oneline.

The --silent option enables silent operation.

The script supports python 2.7 and python 3.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18652 6f19259b-4bc3-4df7-8a09-765794883524
BaseTools/Scripts/PatchCheck.py [new file with mode: 0755]