From 7b8e33df470ac2e646e972189c98fe108d61b329 Mon Sep 17 00:00:00 2001 From: Joey Vagedes Date: Thu, 17 Aug 2023 16:33:09 -0700 Subject: [PATCH] SpellCheck: force no color codes (#529) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description The SpellCheck plugin runs cspell, which uses ANSI color codes when displaying results. When ANSI color codes are used in a terminal that does not support ANSI, the color codes are displayed as text, which causes the rest of SpellCheck plugin to fail as the expected path is not a real path as it starts and ends with color codes: i.e. `\.\Path\To\File.txt` instead of `.\Path\To\File.txt` This change forces cspell to not colorize the output. - [ ] Impacts functionality? - **Functionality** - Does the change ultimately impact how firmware functions? - Examples: Add a new library, publish a new PPI, update an algorithm, ... - [ ] Impacts security? - **Security** - Does the change have a direct security impact on an application, flow, or firmware? - Examples: Crypto algorithm change, buffer overflow fix, parameter validation improvement, ... - [ ] Breaking change? - **Breaking change** - Will anyone consuming this change experience a break in build or boot behavior? - Examples: Add a new library class, move a module to a different repo, call a function in a new library class in a pre-existing module, ... - [ ] Includes tests? - **Tests** - Does the change include any explicit test code? - Examples: Unit tests, integration tests, robot tests, ... - [ ] Includes documentation? - **Documentation** - Does the change contain explicit documentation additions outside direct code modifications (and comments)? - Examples: Update readme file, add feature readme file, link to documentation on an a separate Web page, ... ## How This Was Tested CI ## Integration Instructions N/A --- .pytool/Plugin/SpellCheck/SpellCheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pytool/Plugin/SpellCheck/SpellCheck.py b/.pytool/Plugin/SpellCheck/SpellCheck.py index c12ce6d4f5..7a4178c5d5 100644 --- a/.pytool/Plugin/SpellCheck/SpellCheck.py +++ b/.pytool/Plugin/SpellCheck/SpellCheck.py @@ -212,7 +212,7 @@ def RunBuildPlugin(self, packagename, Edk2pathObj, pkgconfig, environment, PLM, def _check_spelling(self, abs_file_to_check: str, abs_config_file_to_use: str) -> []: output = StringIO() ret = RunCmd( - "cspell", f"--config {abs_config_file_to_use} {abs_file_to_check}", outstream=output) + "cspell", f"--config {abs_config_file_to_use} --no-color {abs_file_to_check}", outstream=output) if ret == 0: return [] else: