Page MenuHomeDevCentral

Style with clang-format 22
Needs ReviewPublic

Authored by dereckson on Sat, Mar 21, 15:19.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Maniphest Tasks
T620: Review and publish C code convention
Summary

The clang-format configuration file format changed a lot in 10 years,
with more nuance than booleans.

This change tries to update the style, kept close to LLVM style,
with 4 spaces indent.

[ Line length ]

The number of columns is pushed from 80 to 100, to be coherent with black style
for Python language. Black has a soft wrapping notion to avoid to cut lines near

  1. As this is not possible with clang-format as far as I know, 100 will do.

[ exceptions4c ]

Our try/catch construction is a C macro. Define the language as C++ is a trick
to let clang-format consider try and catch as language flow control tokens.

[ Don't try to pack arguments a smart way ]

The strategy to align arguments is more conservative, to avoid diff noise:

  • every argument can be kept in 100 columns -> keep as one line
  • any longer expression -> one per line

This remove the BinPack previous system.

Ref T620

Reference:

Diff Detail

Repository
rRABBITMQTCL RabbitMQ TCL extension
Lint
Lint Passed
Unit
No Test Coverage
Branch
main
Build Status
Buildable 6508
Build 6792: arc lint + arc unit

Event Timeline

dereckson created this revision.