[SERVER-76702] Upgrade clang-format to v15+ Created: 29/Apr/23  Updated: 02/Feb/24

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Yoon Soo Kim Assignee: Unassigned
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-76921 toolchain v4 clang-format unaware of ... Closed
Assigned Teams:
Build
Participants:

 Description   

It does not seem that the current version of clang-format recognizes requires clause very well.

An example:
If I write this…

template <typename T>
requires isRequestableOnTimeseries<T>
std::pair<bool, NamespaceString> isTimeseries(...)

the clang-format does its thing and changes the formatting like…

template <typename T>
requires isRequestableOnTimeseries<T> std::pair<bool, NamespaceString> isTimeseries(...)

Found that RequiresClausePosition option is supported since clang-format 15.0
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#requiresclauseposition

One of its possible values is OwnLine which seems to be appropriate for us.

The concept is one of recommended features of C++20, it would be great to have the proper formatting support.



 Comments   
Comment by Alex Neben [ 08/May/23 ]

billy.donahue@mongodb.com did a really goo write up on SERVER-76921 if more context is needed.

Generated at Thu Feb 08 06:33:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.