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);
Updated by Spyros Mastorakis over 9 years ago
- Status changed from New to Code review
- Assignee set to Spyros Mastorakis
- % Done changed from 0 to 90
Updated by Junxiao Shi over 9 years ago
- Status changed from Code review to New
- % Done changed from 90 to 0
There hasn't been a consensus on which style to pick, so it's premature to create the rule and enter CodeReview stage.
Updated by Alex Afanasyev almost 9 years ago
- Target version changed from v0.4 to v0.5
Updated by Davide Pesavento over 2 years ago
- Assignee deleted (
Spyros Mastorakis) - Priority changed from Normal to Low
- Start date deleted (
02/16/2015)
Actions