Clang-format version?

Hi all,

The clang-format checker recently got fixed, and now it is causing me trouble. It’s rejecting my patch with this diff:

+++ b/lib/Conversion/FIRRTLToHW/LowerToHW.cpp
@@ -1842,9 +1842,10 @@ LogicalResult FIRRTLLowering::visitDecl(MemOp op) {
     auto portName = op.getPortName(i).getValue();
     auto portKind = op.getPortKind(i);
 
-    auto &portKindNum = portKind == MemOp::PortKind::Read    ? readCount
-                        : portKind == MemOp::PortKind::Write ? writeCount
-                                                             : readwriteCount;
+    auto &portKindNum =
+        portKind == MemOp::PortKind::Read
+            ? readCount
+            : portKind == MemOp::PortKind::Write ? writeCount : readwriteCount;
 
     auto addInput = [&](SmallVectorImpl<Value> &operands, StringRef field,
                         size_t width) {

I reverified that my clang-format is producing the fancier version of this – is this a difference in clang format versions? My installed version is “clang-format version 12.0.0”, I’m not sure how to tell what the builder is using.

-Chris

Update the workflow and add clang-format --version?

clang-format version 10.0.0-4ubuntu1

The CI build agent is running Ubuntu 18.04.

The pre-merge test bot settled on always using the most recent clang release, that provides something less arbitrary for everyone. And the binary can be downloaded in your container from llvm.org if needed, which makes it fairly easy to setup for most.

If using the latest is what MLIR does, then we should do the same: [CI] Use the latest clang-format version · Issue #1417 · llvm/circt (github.com)