.pytool/Plugin: Add CI plugins
https://bugzilla.tianocore.org/show_bug.cgi?id=2315 Add .pytool directory to the edk2 repository with the following plugins. These plugins are in a top level directory because that can be used with all packages and platforms. * CharEncodingCheck * CompilerPlugin * DependencyCheck * DscCompleteCheck * GuidCheck * LibraryClassCheck * SpellCheck Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
committed by
Michael D Kinney
parent
de4ce46d6e
commit
9da7846c88
80
.pytool/Plugin/GuidCheck/Readme.md
Normal file
80
.pytool/Plugin/GuidCheck/Readme.md
Normal file
@@ -0,0 +1,80 @@
|
||||
# Guid Check Plugin
|
||||
|
||||
This CiBuildPlugin scans all the files in a code tree to find all the GUID
|
||||
definitions. After collection it will then look for duplication in the package
|
||||
under test. Uniqueness of all GUIDs are critical within the UEFI environment.
|
||||
Duplication can cause numerous issues including locating the wrong data
|
||||
structure, calling the wrong function, or decoding the wrong data members.
|
||||
|
||||
Currently Scanned:
|
||||
|
||||
* INF files are scanned for there Module guid
|
||||
* DEC files are scanned for all of their Protocols, PPIs, and Guids as well as
|
||||
the one package GUID.
|
||||
|
||||
Any GUID value being equal to two names or even just defined in two files is
|
||||
considered an error unless in the ignore list.
|
||||
|
||||
Any GUID name that is found more than once is an error unless all occurrences
|
||||
are Module GUIDs. Since the Module GUID is assigned to the Module name it is
|
||||
common to have numerous versions of the same module named the same.
|
||||
|
||||
## Configuration
|
||||
|
||||
The plugin has numerous configuration options to support the UEFI codebase.
|
||||
|
||||
``` yaml
|
||||
"GuidCheck": {
|
||||
"IgnoreGuidName": [],
|
||||
"IgnoreGuidValue": [],
|
||||
"IgnoreFoldersAndFiles": [],
|
||||
"IgnoreDuplicates": []
|
||||
}
|
||||
```
|
||||
|
||||
### IgnoreGuidName
|
||||
|
||||
This list allows strings in two formats.
|
||||
|
||||
* _GuidName_
|
||||
* This will remove any entry with this GuidName from the list of GUIDs
|
||||
therefore ignoring any error associated with this name.
|
||||
* _GuidName=GuidValue_
|
||||
* This will also ignore the GUID by name but only if the value equals the
|
||||
GuidValue.
|
||||
* GuidValue should be in registry format.
|
||||
* This is the suggested format to use as it will limit the ignore to only the
|
||||
defined case.
|
||||
|
||||
### IgnoreGuidValue
|
||||
|
||||
This list allows strings in guid registry format _GuidValue_.
|
||||
|
||||
* This will remove any entry with this GuidValue from the list of GUIDs
|
||||
therefore ignoring any error associated with this value.
|
||||
* GuidValue must be in registry format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
|
||||
### IgnoreFoldersAndFiles
|
||||
|
||||
This supports .gitignore file and folder matching strings including wildcards
|
||||
|
||||
* Any folder or file ignored will not be parsed and therefore any GUID defined
|
||||
will be ignored.
|
||||
* The plugin will always ignores the following ["/Build", "/Conf"]
|
||||
|
||||
### IgnoreDuplicates
|
||||
|
||||
This supports strings in the format of _GuidName_=_GuidName_=_GuidName_
|
||||
|
||||
* For the error with the GuidNames to be ignored the list must match completely
|
||||
with what is found during the code scan.
|
||||
* For example if there are two GUIDs that are by design equal within the code
|
||||
tree then it should be _GuidName_=_GuidName_
|
||||
* If instead there are three GUIDs then it must be
|
||||
_GuidName_=_GuidName_=_GuidName_
|
||||
* This is the best ignore list to use because it is the most strict and will
|
||||
catch new problems when new conflicts are introduced.
|
||||
* There are numerous places in the UEFI specification in which two GUID names
|
||||
are assigned the same value. These names should be set in this ignore list so
|
||||
that they don't cause an error but any additional duplication would still be
|
||||
caught.
|
Reference in New Issue
Block a user