[Mlir-commits] [mlir] [mlir][generate-test-checks] Emit attributes with rest of CHECK lines (PR #143759)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Jun 11 10:58:49 PDT 2025
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 HEAD~1...HEAD mlir/utils/generate-test-checks.py
``````````
</details>
<details>
<summary>
View the diff from darker here.
</summary>
``````````diff
--- generate-test-checks.py 2025-06-11 17:49:11.000000 +0000
+++ generate-test-checks.py 2025-06-11 17:58:22.918524 +0000
@@ -218,15 +218,22 @@
source_segments.append([])
source_segments[-1].append(line + "\n")
return source_segments
+
def process_attribute_definition(line, attribute_namer):
m = ATTR_DEF_RE.match(line)
if m:
attribute_name = attribute_namer.generate_name(m.group(1))
- return '// CHECK: #[[' + attribute_name + ':.+]] =' + line[len(m.group(0)):] + '\n'
+ return (
+ "// CHECK: #[["
+ + attribute_name
+ + ":.+]] ="
+ + line[len(m.group(0)) :]
+ + "\n"
+ )
return None
def process_attribute_references(line, attribute_namer):
output_line = ''
@@ -412,11 +419,11 @@
else:
# Emit any pending attribute definitions at the start of this scope
for attr in pending_attr_defs:
attr_line = process_attribute_definition(attr, attribute_namer)
- if (attr_line):
+ if attr_line:
output_segments[-1].append(attr_line)
pending_attr_defs.clear()
# Output the first line chunk that does not contain an SSA name for the
# label.
``````````
</details>
https://github.com/llvm/llvm-project/pull/143759
More information about the Mlir-commits
mailing list