From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mx.groups.io with SMTP id smtpd.web08.4476.1623289666977827246 for ; Wed, 09 Jun 2021 18:47:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WIxNjt5D; spf=pass (domain: gmail.com, ip: 209.85.214.178, mailfrom: kuqin12@gmail.com) Received: by mail-pl1-f178.google.com with SMTP id 69so126260plc.5 for ; Wed, 09 Jun 2021 18:47:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2/3j1WDTqZpH46kjkEhwHRxE1HrZyiVOC3yepiHau4g=; b=WIxNjt5Dp0pK5+LIMQra6IzojSg6zA5rWlG8omj2sntyWUo58WyVa1X+3KvPQ1iJ60 Uxbv406pLe6mWawH7JxDGAayYj3GBOa35B2BTiaVaDNgMS+xkr+nGqC6wX6pJDRAWc1u EnZu9igLJVsSnlZib4WzGdDHfpzdjR7FXka8q7KhW7svNXuA9aBQPQIQmLcD95kZLjYc ym6RZkz9/5DfrgfkwnUxfd/BKNyFISn4/kiMyZtkn44BDUSUyZOsN2erC6kAbZ5WDQX7 tHOP+nlwffdGyFHdRpW/bQU3buP4fUGPqJkEU3EqfYGW0EQ+xgz6FnS/zK+d//4Iqie/ Mntw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2/3j1WDTqZpH46kjkEhwHRxE1HrZyiVOC3yepiHau4g=; b=rzd0pd3ukAPpi3CibyZkhLsqNj6LrZuVc2aqvZBrR+sJxJKcarWNlkiA8CcPfwNsvV jZSxu9HLFvs/ZuGazxTVoiPhT3w0LYoAv5dI4A69Z0bPhcUVKFcPW5BcbIWGfPRH9Uvc QQApnWdlym2IYszjv9JVWjRI4TDDJVdAZdQViP8nhMLFVcEnBLRN2LchYAFSdcnTOKTJ TMOU2AuIjfZnUFFM+EgPjADR/ZU6Y3ysyWuJnTBgd2ggu+YiidWTjgDlfgk2Jyr+e3rh 3vVHQMyxRml2tnDZ4ckKzlh67Q08Hhs+0chGFjeZT57M6ejIK41Zl+QYfkGZzhGr/Zi8 2rTA== X-Gm-Message-State: AOAM533CatR91hB1fyL4qTGoCOOv28B9Bf5R6QxTkl2HghDT77RNdURH Yda8qlWr/6SkH/NJekI8KnoiH612Cxf3lQ== X-Google-Smtp-Source: ABdhPJxukuzGQTO/ITusyJCaG14KjeVzfskpwx1gy/VkqXdqWLUdgiFay5gHgEpkUgIqhk64IivmDg== X-Received: by 2002:a17:902:c3d5:b029:100:742f:fce9 with SMTP id j21-20020a170902c3d5b0290100742ffce9mr2489592plj.46.1623289666324; Wed, 09 Jun 2021 18:47:46 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([50.35.88.161]) by smtp.gmail.com with ESMTPSA id o17sm6187492pjp.33.2021.06.09.18.47.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 18:47:45 -0700 (PDT) From: "Kun Qin" To: devel@edk2.groups.io Cc: Sean Brogan , Bret Barkelew , Michael D Kinney , Liming Gao Subject: [PATCH v1 1/1] Pytool: SpellCheck: Fix incorrect file mask across package matrices Date: Wed, 9 Jun 2021 18:47:33 -0700 Message-Id: <20210610014733.1267-2-kuqin12@gmail.com> X-Mailer: git-send-email 2.31.1.windows.1 In-Reply-To: <20210610014733.1267-1-kuqin12@gmail.com> References: <20210610014733.1267-1-kuqin12@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Sean Brogan 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 Cc: Bret Barkelew Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Sean Brogan --- .pytool/Plugin/SpellCheck/SpellCheck.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.pytool/Plugin/SpellCheck/SpellCheck.py b/.pytool/Plugin/SpellCheck/SpellCheck.py index 43365441b91c..9ad57632a6e8 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 -- 2.31.1.windows.1