[SERVER-19670] Clang-format makes a mess of src/mongo/db/auth/role_graph_builtin_roles.cpp Created: 30/Jul/15  Updated: 16/May/16  Resolved: 05/May/16

Status: Closed
Project: Core Server
Component/s: Build, Internal Code
Affects Version/s: None
Fix Version/s: 3.3.6

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Mark Benvenuto
Resolution: Done Votes: 0
Labels: clang-format
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 14 (05/13/16)
Participants:

 Description   

Compare New: https://github.com/mongodb/mongo/blob/master/src/mongo/db/auth/role_graph_builtin_roles.cpp#L151-L158

Old: https://github.com/mongodb/mongo/blob/463d3343d559590d60cfd5c48ac98ad675d5390e/src/mongo/db/auth/role_graph_builtin_roles.cpp#L225-L237

Based on all of the problems it has with << maybe it should just completely avoid breaking or joining lines containing <<.



 Comments   
Comment by Githook User [ 05/May/16 ]

Author:

{u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}

Message: SERVER-19670 clang-format makes a mess of src/mongo/db/auth/role_graph_builtin_roles.cpp
Branch: master
https://github.com/mongodb/mongo/commit/ebd21ec84d6d8c30f0634a5cadad7af1bba1783a

Comment by Mathias Stearn [ 03/May/16 ]

At some point we should consider making those use c++11 initializer lists rather than using << to fake it.

Comment by Spencer Jackson [ 03/May/16 ]

mark.benvenuto Yeah, I think that's reasonable. Without teaching clang-format about our types, I can't think of how it would know that some, but not all, left shift operators need special formatting.

Comment by Mark Benvenuto [ 03/May/16 ]

Even with clang-format 3.8.0, the formatting for these << lines does not improve. The best option for this file is to disable clang-format for these lines.

spencer.jackson Do you think we should disable clang-format for these authorization roles?

Generated at Thu Feb 08 03:51:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.