Skip to content

[clang-format] apply both Align and BlockIndent in AlignAfterOpenBracket #55076

@isudfv

Description

@isudfv

There're Align and BlockIndent in AlignAfterOpenBracket.
with BlockIndent I can do this

// what I want(only with BlockIndent)
socket.async_write_some(
    asio::buffer(_data, length),
    [this, self](std::error_code ec, std::size_t length) {
        if (!ec) {
            sent_byte += length;
            do_read();
        }
    }
); //Closing brackets will be placed on a new line

// what I get with Align
socket.async_write_some(
    asio::buffer(_data, length),
    [this, self](std::error_code ec, std::size_t length) {
        if (!ec) {
            sent_byte += length;
            do_read();
        }
    }); 

but parameters inside constructor parameters will have to be in the same line with BlockIndent

//what I want(only with Align)
file_trans(tcp::socket socket, std::string filename, std::size_t size)
    : socket(std::move(socket)),
      size(size),
      recv(_socket.get_executor(),
           filename,
           asio::stream_file::write_only | asio::stream_file::create | asio::stream_file::truncate)
{}
//what I get with BlockIndent
file_trans(tcp::socket socket, std::string filename, std::size_t size)
    : socket(std::move(socket)),
      size(size),
      recv(_socket.get_executor(), filename, asio::stream_file::write_only | asio::stream_file::create | asio::stream_file::truncate)
{}

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