[llvm] [llvm-ir2vec] Refactoring the ir2vec python bindings testing (PR #180664)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 9 17:59:26 PST 2026
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 origin/main...HEAD llvm/test/tools/llvm-ir2vec/bindings/ir2vec-getBBEmbMap.py llvm/test/tools/llvm-ir2vec/bindings/ir2vec-getFuncEmb.py llvm/test/tools/llvm-ir2vec/bindings/ir2vec-getFuncEmbMap.py llvm/test/tools/llvm-ir2vec/bindings/ir2vec-getFuncNames.py llvm/test/tools/llvm-ir2vec/bindings/ir2vec-getInstEmbMap.py llvm/test/tools/llvm-ir2vec/bindings/ir2vec-initEmbedding.py
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from darker here.
</summary>
``````````diff
--- ir2vec-initEmbedding.py 2026-02-09 14:12:28.000000 +0000
+++ ir2vec-initEmbedding.py 2026-02-10 01:58:51.384256 +0000
@@ -40,11 +40,12 @@
# CHECK: ERROR: Invalid vocab
# Error: Malformed JSON vocab
import tempfile
import os
-with tempfile.NamedTemporaryFile(mode='w', suffix='.json', delete=False) as f:
+
+with tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False) as f:
f.write("{ this is not valid json }")
bad_vocab = f.name
try:
ir2vec.initEmbedding(filename=ll_file, mode="sym", vocabPath=bad_vocab)
except ValueError:
``````````
</details>
https://github.com/llvm/llvm-project/pull/180664
More information about the llvm-commits
mailing list