Actions
Task #2529
opencode-style: line continuation
Status:
New
Priority:
Low
Assignee:
-
Category:
Docs
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Description
Update rule 1.12 to specify how line continuation should be aligned in the following cases.
Case 1: beginning of expression on previous line is too close to right edge
// style 1
std::unordered_map<int, int> someLongUnorderedMapName = someLongFunctionName(1,
yetAnotherLongFunctionNameThatIsNotGoingToFitOnTheSameLine());
// style 2
std::unordered_map<int, int> someLongUnorderedMapName = someLongFunctionName(1,
yetAnotherLongFunctionNameThatIsNotGoingToFitOnTheSameLine());
// style 3
std::unordered_map<int, int> someLongUnorderedMapName = someLongFunctionName(
1, yetAnotherLongFunctionNameThatIsNotGoingToFitOnTheSameLine());
Case 2: alignment of lambda body
// style 1
this->someMethodName(firstArgument, [captured] (const std::pair<int, int>& pair) -> int {
if (pair.first < 0) {
return pair.second;
}
else {
return captured;
}
}, thirdArgument);
// style 2
this->someMethodName(firstArgument,
[captured] (const std::pair<int, int>& pair) -> int {
if (pair.first < 0) {
return pair.second;
}
else {
return captured;
}
}, thirdArgument);
// style 3
this->someMethodName(firstArgument, [captured] (const std::pair<int, int>& pair) -> int {
if (pair.first < 0) {
return pair.second;
}
else {
return captured;
}
}, thirdArgument);
// style 4
this->someMethodName(firstArgument, [captured] (const std::pair<int, int>& pair) -> int {
if (pair.first < 0) {
return pair.second;
}
else {
return captured;
}
}, thirdArgument);
// style 5
this->someMethodName(firstArgument, [captured] (const std::pair<int, int>& pair) -> int {
if (pair.first < 0) {
return pair.second;
}
else {
return captured;
}
},
thirdArgument);
// style 6
this->someMethodName(firstArgument,
[captured] (const std::pair<int, int>& pair) -> int {
if (pair.first < 0) {
return pair.second;
}
else {
return captured;
}
},
thirdArgument);
// style 7
this->someMethodName(firstArgument, [captured] (const std::pair<int, int>& pair) -> int {
if (pair.first < 0) {
return pair.second;
}
else {
return captured;
}
},
thirdArgument);
Actions