Closed kevinsung closed 1 year ago
How do I fix the formatting issues? I see the command ninja check-format
but I don't know what command actually applies the fixes.
How do I fix the formatting issues? I see the command ninja check-format but I don't know what command actually applies the fixes.
I usually edit the check-format.sh
script locally to make the changes for me.
I modify the end of check-format.sh
to be:
+#diff <(cat ${files}) <(${clang_format_bin} --style=file ${files})
+${clang_format_bin} -i --style=file ${files}
I think run ninja check-format
, this will make the changes in place which you may then view before committing.
clang-tidy review says "All clean, LGTM! :+1:"
How do I fix the formatting issues? I see the command
ninja check-format
but I don't know what command actually applies the fixes.
ninja fix-format
Ok, I've added a LIT-based test and removed the Python test (by the way, what is LIT?). There are a few issues that I would like help with if they need to be addressed:
MLIR-CIRCUITS
and MLIR-NO-CIRCUITS
prefixes. Are they needed? If so, how do I generate them?ast-pretty
fails, so I didn't include that test. Example:
./bin/qss-compiler -X=qasm --emit=ast-pretty test.qasm
Warning while parsing OpenQASM 3 input
File: "test.qasm", Line: 32, Col: 1 Switch statement does not have a default case label.
test.qasm:32:1: warning:
}
^
OK. DeclarationNode(type=ASTTypeInt, IntNode(signed=true, value=15, bits=32)) DeclarationNode(type=ASTTypeQubitContainer, QubitContainerNode(QubitNode(name=$0:0, bits=1))) SwitchStatementNode(SwitchQuantity(name=i, type=ASTTypeIdentifier), statements=[ CaseStatementNode(case=0, ), ], default statement=[ PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace. Stack dump:
zsh: segmentation fault (core dumped) ./bin/qss-compiler -X=qasm --emit=ast-pretty test.qasm
clang-tidy review says "All clean, LGTM! :+1:"
You likely need to add a similar change (and test) to the print visitor - https://github.com/Qiskit/qss-compiler/blob/main/include/Frontend/OpenQASM3/PrintQASM3Visitor.h
Thanks, done.
clang-tidy review says "All clean, LGTM! :+1:"
clang-tidy review says "All clean, LGTM! :+1:"