Skip to content

Commit

Permalink
sd
Browse files Browse the repository at this point in the history
Change-Id: Ib00d518bcc20400b5817e6b7d298b527a6db0267
Signed-off-by: Shenglei Zhang <[email protected]>
  • Loading branch information
shenglei10 committed Jul 29, 2020
1 parent ebd7baf commit 2c24a9f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions .pytool/Plugin/LicenseCheck/LicenseCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class LicenseCheck(ICiBuildPlugin):

bsd2_patent = 'BSD-2-Clause-Patent'

bsd3_patent = 'BSD-3-Clause-Patent'

Readdedfileformat = re.compile(r'\+\+\+ b\/(.*)')

file_extension_list = [".c", ".h", ".inf", ".dsc", ".dec", ".py", ".bat", ".sh", ".uni", ".yaml",
Expand Down Expand Up @@ -92,13 +90,12 @@ def RunBuildPlugin(self, packagename, Edk2pathObj, pkgconfig, environment, PLM,
self.startcheck = True
self.license = False
if self.startcheck and self.license_format_preflix in line:
if self.bsd2_patent in line or self.bsd3_patent in line:
if self.bsd2_patent in line:
self.license = True
if line_index + 1 == count or patch[line_index + 1].startswith('diff --') and self.startcheck:
if not self.license:
self.all_file_pass = False
error_message = "Invalid license in: " + added_file + " Hint: Only BSD-2-Clause-Patent and" + \
" BSD-3-Clause-Patent are accepted."
error_message = "Invalid license in: " + added_file + " Hint: Only BSD-2-Clause-Patent is accepted."
logging.error(error_message)
self.startcheck = False
self.license = True
Expand Down
2 changes: 1 addition & 1 deletion .pytool/Plugin/LicenseCheck/LicenseCheck_plug_in.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @file
# CiBuildPlugin used to check license issues for new added files
#
# Copyright (c) Microsoft Corporation.
# Copyright (c) 2020, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
{
Expand Down
2 changes: 1 addition & 1 deletion .pytool/Plugin/LicenseCheck/Readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# License Check Plugin

This CiBuildPlugin scans all new added files in a package to make sure code
is contributed under BSD-2-Clause-Patent or BSD-3-Clause-Patent.
is contributed under BSD-2-Clause-Patent.

## Configuration

Expand Down

0 comments on commit 2c24a9f

Please sign in to comment.