|
There is no way to hint that the << should be treated as key value pairs in the BSON macro. Formatting for << is a little different in 3.8.0, but it never format as we want without customization.
Since this cannot be done with clang-format 3.8.0, moving it to planned but not scheduled.
|
|
I have anecdotal evidence that a newer version of clang-format behaves better W.R.T. this.
|
|
Actually is the same error - it was reverting my patch above.
|
|
It also doesn't allow me to put key value pairs on the same line.
+++
|
@@ -921,10 +921,14 @@
|
/** A complex _id expression. */
|
class ComplexId : public CheckResultsBase {
|
std::deque<Document> inputData() {
|
- return {DOC("a" << "de"
|
- << "b" << "ad"
|
- << "c" << "beef"
|
- << "d" << ""),
|
+ return {DOC("a"
|
+ << "de"
|
+ << "b"
|
+ << "ad"
|
+ << "c"
|
+ << "beef"
|
+ << "d"
|
+ << ""),
|
DOC("a"
|
<< "d"
|
<< "b"
|
|
|
I'm getting the opposite of this error. When I try to put two values on the same line, it insists on moving the second value to a new line.
+++
|
@@ -1793,7 +1793,8 @@
|
std::deque<Document> inputData() {
|
return {DOC("_id" << 0 << "a" << BSONNULL),
|
DOC("_id" << 1),
|
- DOC("_id" << 2 << "a" << DOC_ARRAY("a" << "b")),
|
+ DOC("_id" << 2 << "a" << DOC_ARRAY("a"
|
+ << "b")),
|
DOC("_id" << 3),
|
DOC("_id" << 4 << "a" << DOC_ARRAY(1 << 2 << 3)),
|
DOC("_id" << 5 << "a" << DOC_ARRAY(4 << 5 << 6)),
|
ERROR: Code Style does not match coding style
|
|
|
|
Doesn't seem like a sane thing to do outside of a BSON doc either.
|
|
it looks like it applies the formatting rules for printing to an ostream to the BSON macro.
|
Generated at Thu Feb 08 03:50:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.