[CXX-1007] Add additional directives to clang-format style file Created: 29/Aug/16  Updated: 23/Dec/16  Resolved: 23/Dec/16

Status: Closed
Project: C++ Driver
Component/s: Build
Affects Version/s: None
Fix Version/s: 3.2.0-rc0

Type: Task Priority: Major - P3
Reporter: J Rassi Assignee: David Golden
Resolution: Done Votes: 0
Labels: clang-format
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CXX-1008 Update clang_format.py to use clang-f... Closed

 Description   

The repository's clang-format style file currently contains a minimal set of rules. Simply copy-pasting the style file from current master of mongodb/mongo (after removing the directives specific to clang format 3.8) and applying a bulk format will increase the repository's code consistency, with minimal effort.



 Comments   
Comment by Githook User [ 23/Dec/16 ]

Author:

{u'username': u'xdg', u'name': u'David Golden', u'email': u'xdg@xdg.me'}

Message: CXX-1007 Add additional directives to .clang-format

This makes some additions/changes based on the MongoDB server's
.clang-formatting rules.

To have tighter code for empty subs:

  • AllowShortFunctionsOnASingleLine: Empty

To keep control code structure visually distinct:

  • AllowShortIfStatementsOnASingleLine: false
  • AllowShortLoopsOnASingleLine: false

To make long parameter/argument list easier to read:

  • BinPackArguments: false
  • BinPackParameters: false

To have pointer and reference symbols consistent everywhere:

Comment by Githook User [ 23/Dec/16 ]

Author:

{u'username': u'xdg', u'name': u'David Golden', u'email': u'xdg@xdg.me'}

Message: CXX-1007 Sort .clang-format directives
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/10c9f4f1bc66b5b1a50e42de284722122a57966b

Comment by J Rassi [ 31/Aug/16 ]

I filed this ticket when I realized that no value of PointerAlignment is being set in the current style file. Lines in the repo vary in how they align * and & (e.g. "char *target" from b64_ntop.h, versus "char* str" from itoa.hpp), including lines in recent patches that I've been reviewing.

Generated at Wed Feb 07 22:01:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.