This reverts commit a4cfb842fc.
This commit suggests inclusion of non-edk2+license content without
a contribution agreement is something the community has made a
decision on, which is incorrect.
Cc: Shenglei Zhang <[email protected]>
Cc: Yuwei Chen <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Leif Lindholm <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
On Debian 10 (Buster), when running PatchCheck.py with python2, a
backtrace is printed, starting from:
File "../edk2/BaseTools/Scripts/PatchCheck.py", line 595,
in find_patch_pieces
parts = email.header.decode_header(pmail.get('subject'))
AttributeError: 'module' object has no attribute 'header'
When using python3, this backtrace does not appear.
Explicitly importing email.header resolves this for python2 and does not
appear to cause any issues with python3.
Cc: Bob Feng <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Leif Lindholm <[email protected]>
Reviewed-by: Bob Feng <[email protected]>
SetupGit.py adds BaseTools/Conf/diff.order as a diff orderfile, but that
file currently has CRLF line endings, which causes all pattern matches
to fail and the ordering remaining unaffected.
Add an exception to PatchCheck.py (to the existing .gitmodules clause),
so that we can merge the fix to the config file.
Cc: Bob Feng <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Leif Lindholm <[email protected]>
Reviewed-by: Bob Feng <[email protected]>
Bash scripts require LF line endings to work.
PatchCheck.py checks that the files added in a patch have CRLF
line endings. It excludes files ending with the ".sh" extension
from this check.
Some bash script don't have a ".sh" extension. Most of them are
located in:
- BaseTools/BinWrappers/PosixLike/
- BaseTools/Bin/CYGWIN_NT-5.1-i686/
This patch excludes these folder plus BaseTools/BuildEnv from
this CRLF check.
Signed-off-by: Pierre Gondois <[email protected]>
Reviewed-by: Bob Feng <[email protected]>
We check the author/committer name/email are properly displayed
since commits 8ffa47fb3ab..c0328cf3803. However if PatchCheck.py
uses the mailmap, it will check sanitized names/emails.
Use the --no-use-mailmap option so PatchCheck.py will check
unsanitized input.
Signed-off-by: Philippe Mathieu-Daude <[email protected]>
Cc: Bob Feng <[email protected]>
Cc: Liming Gao <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Reviewed-by: Bob Feng <[email protected]>
Due to strict DMARC / DKIM / SPF rules, Groups.Io sometimes rewrite
the author email. See for example commit df851da3ce.
Add a check to detect these rewrites with PatchCheck.py.
Signed-off-by: Philippe Mathieu-Daude <[email protected]>
Cc: Bob Feng <[email protected]>
Cc: Liming Gao <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Reviewed-by: Bob Feng <[email protected]>
https://bugzilla.tianocore.org/show_bug.cgi?id=2484https://bugzilla.tianocore.org/show_bug.cgi?id=2485
Update PatchCheck to not enforce no tabs and not enforce CR/LF
line endings for .gitmodules files. These files are updated by
git when a git submodule command is used and the updates by git
use tab characters and LF line endings.
Also update patch check to not enforce CR/LF line endings for
patch lines that create a submodule directory. These patch
lines use LF line endings. The git submodule directory is
added as a new file with attributes 160000 that can be detected
by looking for the pattern "new file mode 160000".
Cc: Bob Feng <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
https://bugzilla.tianocore.org/show_bug.cgi?id=2406
* Always print subject line after the git commit id to make
it easier to know the context of warnings or errors.
* Allow UTF-8 characters in subject line
* Error if subject line length > 75 without CVE-xxx-xxxxx present
* Error if subject line length > 92 with CVE-xxxx-xxxxx present
* If body line length is > 75, then print warning instead of error.
Cc: Bob Feng <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Cc: Jordan Justen <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Bob Feng <[email protected]>
Tested-by: Laszlo Ersek <[email protected]>
To avoid patches committed with incorrect email address,
use the EmailAddressCheck class on the author email too.
Example:
$ python BaseTools/Scripts/PatchCheck.py 1a04951309
Checking git commit: 1a04951309
The 'Author' email address is not valid:
* The email address cannot contain a space: /o=Intel/ou=External \
(FYDIBOHF25SPDLT)/cn=Recipients/cn=fe425ca7e5f4401abed22b904fe5d964
Cc: Bob Feng <[email protected]>
Cc: Liming Gao <[email protected]>
Reviewed-by: Bob Feng <[email protected]>
Signed-off-by: Philippe Mathieu-Daude <[email protected]>
We are checking different emails from the signature list. We are
going to check more. To be able to differency, add a description
field, so the error reported is clearer.
Cc: Bob Feng <[email protected]>
Cc: Liming Gao <[email protected]>
Reviewed-by: Bob Feng <[email protected]>
Signed-off-by: Philippe Mathieu-Daude <[email protected]>
To avoid patches committed with incorrect email address,
use the EmailAddressCheck class on the committer email too.
Cc: Bob Feng <[email protected]>
Cc: Liming Gao <[email protected]>
Reviewed-by: Bob Feng <[email protected]>
Signed-off-by: Philippe Mathieu-Daude <[email protected]>
As we are going to reuse this code out of the CommitMessageCheck
class, extract it in a new class: EmailAddressCheck.
Cc: Bob Feng <[email protected]>
Cc: Liming Gao <[email protected]>
Reviewed-by: Bob Feng <[email protected]>
Signed-off-by: Philippe Mathieu-Daude <[email protected]>
https://bugzilla.tianocore.org/show_bug.cgi?id=1655
With the change to BSD+Patent License, the TianoCore Contributor's
Agreement has been removed and as a result, a Contributed-under
tag is no longer appropriate in patches. Remove the check for
the TianoCore Contributor's Agreement and instead, generate an
error if a patch contains a Contributed-under tag in the commit
message.
Cc: Jordan Justen <[email protected]>
Cc: Bob Feng <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1145
Currently run PatchCheck.py with Python3 will meet
following error:
.....
File "PatchCheck.py", line 554, in run_git
return Result[0].decode('utf-8', 'ignore') if Result[0] and
Result[0].find("fatal")!=0 else None
TypeError: a bytes-like object is required, not 'str'
This issue was introduce by commit:5ac4548cdf654.
This patch is to convert the str object of "fatal" to
byte object to fix this failure.
Cc: Liming Gao <[email protected]>
Cc: Jaben Carsey <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <[email protected]>
Reviewed-by: Jaben Carsey <[email protected]>
Currently if an invalid parameter is passed, it gives a stack trace.
This changes it to an error message.
Cc: Liming Gao <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <[email protected]>
Reviewed-by: Yonghong Zhu <[email protected]>
Tested-by: Liming Gao <[email protected]>
The commit adds the detection of adding new binary files in a patch file
or in a commit.
The following warning messages will be appended at the end of the script
output:
WARNING - The following binary files will be added into the repository:
<BinaryFile1>
<BinaryFile2>
...
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
For a patch file that:
1. Contains a binary change
2. Contains any other changes after the binary change
PatchCheck.py will complains with the following error:
* Patch format error: diff found after end of patch
Line: literal XXXX
This commit resolves this misreport.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
This allows a patch with binary data that is generated with --binary
to be parsed by the PatchCheck.py script.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19104 6f19259b-4bc3-4df7-8a09-765794883524
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 <[email protected]>
Cc: Erik Bjorge <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Cc: Liming Gao <[email protected]>
Reviewed-by: Leif Lindholm <[email protected]>
Reviewed-by: Erik Bjorge <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18652 6f19259b-4bc3-4df7-8a09-765794883524