Skip to content

[clang-format] Disallowing single line lambda causing unnecessary line breaks #142208

Open
@SouravKB

Description

@SouravKB

Code:

auto transs = transitions | stdv::filter([alph](const auto trns) { return trns.first == alph; })
              | stdv::values | stdv::transform([](auto x) { return x; }) | stdv::as_rvalue;

Config:

BasedOnStyle: Google
AllowShortLambdasOnASingleLine: None
BreakBeforeBinaryOperators: NonAssignment

Expected formatting:

auto transs = transitions | stdv::filter([alph](const auto trns) {
	              return trns.first == alph;
              }) | stdv::values | stdv::transform([](auto x) {
	              return x;
              }) | stdv::as_rvalue;

Actual formatting:

auto transs = transitions | stdv::filter([alph](const auto trns) {
	              return trns.first == alph;
              })
              | stdv::values | stdv::transform([](auto x) {
	                return x;
                })
              | stdv::as_rvalue;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions