]> git.proxmox.com Git - mirror_edk2.git/commitdiff
.pytool/Plugin/UncrustifyCheck: Update func to return absolute paths
authorMichael Kubacki <michael.kubacki@microsoft.com>
Wed, 16 Mar 2022 17:52:20 +0000 (13:52 -0400)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 4 Apr 2022 15:18:31 +0000 (15:18 +0000)
Currently, UncrustifyCheck._get_git_ignored_paths() is documented to
return a list of absolute file paths but it currently returns a list
of relative file paths.

This change updates the function to return a list of absolute file
paths. The result is later compared to the list of absolute file
paths for files to run against Uncrustify.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py

index 82db7a5a438b6a8e589041fca24c4c651cbd45d1..6920580646de8b0f0633f8dc11214804a8dbe701 100644 (file)
@@ -292,7 +292,12 @@ class UncrustifyCheck(ICiBuildPlugin):
                 f"An error occurred reading git ignore settings. This will prevent Uncrustify from running against the expected set of files.")\r
 \r
         # Note: This will potentially be a large list, but at least sorted\r
-        return outstream_buffer.getvalue().strip().splitlines()\r
+        rel_paths = outstream_buffer.getvalue().strip().splitlines()\r
+        abs_paths = []\r
+        for path in rel_paths:\r
+            abs_paths.append(\r
+                os.path.normpath(os.path.join(self._abs_workspace_path, path)))\r
+        return abs_paths\r
 \r
     def _get_git_submodule_paths(self) -> List[str]:\r
         """\r