[llvm] [lit] Export env vars in script to avoid pruning (PR #105759)

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 22 18:05:20 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r 09a275e8a4c2cea22bb67c7247fc892d5e73eb42...09671451af93ebe468971bc3e3b9882d09b7f354 llvm/utils/lit/lit/TestRunner.py
``````````

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- TestRunner.py	2024-08-23 00:57:43.000000 +0000
+++ TestRunner.py	2024-08-23 01:04:52.524386 +0000
@@ -1222,12 +1222,14 @@
                     commands[i] += f" && {{ {command}; }}"
         if test.config.pipefail:
             f.write(b"set -o pipefail;" if mode == "wb" else "set -o pipefail;")
         f.write(b"set -x;" if mode == "wb" else "set -x;")
 
-        env_str = "\n".join("export {}={};".format(k, shlex.quote(v))
-                            for k, v in test.config.environment.items())
+        env_str = "\n".join(
+            "export {}={};".format(k, shlex.quote(v))
+            for k, v in test.config.environment.items()
+        )
         f.write(bytes(env_str, "utf-8") if mode == "wb" else env_str)
 
         if sys.version_info > (3, 0) and mode == "wb":
             f.write(bytes("{ " + "; } &&\n{ ".join(commands) + "; }", "utf-8"))
         else:

``````````

</details>


https://github.com/llvm/llvm-project/pull/105759


More information about the llvm-commits mailing list