<div dir="ltr">Hi folks,<div><br></div><div>A recent issue [1] on our Github project has highlighted a problem we've been having with clang-format.</div><div><br></div><div>Basically, when using different versions of clang-format, with the same configuration files [2], we get different results (between 9 and 10).</div><div><br></div><div>Previously, the main issue was new versions supported more stuff (ex. AfterCaseLabel [3]) and old ones would not work, so we had to define a minimal version, but newer versions of clang-format were supposed to yield the same results based on the same configuration file.</div><div><br></div><div>Or perhaps, the default has changed and we didn't have a specific config? If so, the fix is easy, just add the option to the config file. If not, we'll have to continue hard-coding clang-format-9 in the CMake, which is not practical as more people try to build it.</div><div><br></div><div>Examples:</div><div><br></div><div><a href="https://github.com/microsoft/verona/blob/master/src/mlir/dialect/Typechecker.cc#L79">https://github.com/microsoft/verona/blob/master/src/mlir/dialect/Typechecker.cc#L79</a><br></div><div><br></div><div>clang-format-9:<br></div><div>    Rule(F f)<br>      ->Rule<<br>        typename rule_traits<decltype(&F::operator())>::Left,<br>        typename rule_traits<decltype(&F::operator())>::Right,<br>        F>;</div><div><br></div><div>clang-format-10:<br></div><div>    Rule(F f) -> Rule<<br>      typename rule_traits<decltype(&F::operator())>::Left,<br>      typename rule_traits<decltype(&F::operator())>::Right,<br>      F>;<br></div><div><br></div><div><a href="https://github.com/microsoft/verona/blob/master/src/mlir/dialect/VeronaTypes.cc#L487">https://github.com/microsoft/verona/blob/master/src/mlir/dialect/VeronaTypes.cc#L487</a><br></div><div><br></div><div>clang-format-9:<br></div><div>      return {MeetType::get(ctx, readElements),<br>              JoinType::get(ctx, writeElements)};</div><div><br></div><div>clang-format-10:<br></div><div>      return {<br>        MeetType::get(ctx, readElements), JoinType::get(ctx, writeElements)};<br></div><div><br></div><div><a href="https://github.com/microsoft/verona/blob/master/src/mlir/dialect/VeronaTypes.cc#L513">https://github.com/microsoft/verona/blob/master/src/mlir/dialect/VeronaTypes.cc#L513</a></div><div><br></div><div>clang-format-9:</div><div>    return {JoinType::get(ctx, readElements),<br>            MeetType::get(ctx, writeElements)};<br><div><br></div><div>clang-format-10:</div><div></div>    return {<br>      JoinType::get(ctx, readElements), MeetType::get(ctx, writeElements)};<br></div><div><br></div><div>thanks!</div><div>--renato</div><div><br></div><div>[1] <a href="https://github.com/microsoft/verona/issues/324">https://github.com/microsoft/verona/issues/324</a><br></div><div>[2] <a href="https://github.com/microsoft/verona/blob/master/.clang-format">https://github.com/microsoft/verona/blob/master/.clang-format</a></div><div>[3] <a href="https://github.com/microsoft/verona/blob/master/CMakeLists.txt#L19">https://github.com/microsoft/verona/blob/master/CMakeLists.txt#L19</a></div></div>