diff options
author | Sean Brogan <spbrogan@live.com> | 2021-06-10 09:47:33 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-06-15 07:12:13 +0000 |
commit | 288bd74a22b1a3c7130d8a303e332161f923b8d4 (patch) | |
tree | 1483195f0b79b458abf1d15a6095943774d76e5f /.pytool | |
parent | b8649cf2a3e673a4a8cb6c255e394b354b771550 (diff) | |
download | edk2-288bd74a22b1a3c7130d8a303e332161f923b8d4.zip edk2-288bd74a22b1a3c7130d8a303e332161f923b8d4.tar.gz edk2-288bd74a22b1a3c7130d8a303e332161f923b8d4.tar.bz2 |
Pytool: SpellCheck: Fix incorrect file mask across package matrices
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3443
Existing implementation could modify class global data that causes
potential incorrect file mask to be used for execution of plugin.
This change switches class variable to be tuple so that it cannot be
accidently modified. Local usage of STANDARD_PLUGIN_DEFINED_PATHS is also
changed to copy to new list before modification.
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Sean Brogan <sean.brogan@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to '.pytool')
-rw-r--r-- | .pytool/Plugin/SpellCheck/SpellCheck.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/.pytool/Plugin/SpellCheck/SpellCheck.py b/.pytool/Plugin/SpellCheck/SpellCheck.py index 4336544..9ad5763 100644 --- a/.pytool/Plugin/SpellCheck/SpellCheck.py +++ b/.pytool/Plugin/SpellCheck/SpellCheck.py @@ -37,12 +37,12 @@ class SpellCheck(ICiBuildPlugin): #
# A package can remove any of these using IgnoreStandardPaths
#
- STANDARD_PLUGIN_DEFINED_PATHS = ["*.c", "*.h",
+ STANDARD_PLUGIN_DEFINED_PATHS = ("*.c", "*.h",
"*.nasm", "*.asm", "*.masm", "*.s",
"*.asl",
"*.dsc", "*.dec", "*.fdf", "*.inf",
"*.md", "*.txt"
- ]
+ )
def GetTestName(self, packagename: str, environment: VarDict) -> tuple:
""" Provide the testcase name and classname for use in reporting
@@ -107,7 +107,8 @@ class SpellCheck(ICiBuildPlugin): version_aggregator.GetVersionAggregator().ReportVersion(
"CSpell", cspell_version, version_aggregator.VersionTypes.INFO)
- package_relative_paths_to_spell_check = SpellCheck.STANDARD_PLUGIN_DEFINED_PATHS
+ # copy the default as a list
+ package_relative_paths_to_spell_check = list(SpellCheck.STANDARD_PLUGIN_DEFINED_PATHS)
#
# Allow the ci.yaml to remove any of the above standard paths
|