Skip to content

WIP: New clang-format flags for parameter and (template) argument breaking

The new flags force all arguments, function parameters and template parameters which do not fit in one line to break for each single argument. They also put the return type in their own line. In the changes, only regard the .clang-format file, which has the following lines added:

 AllowAllParametersOfDeclarationOnNextLine: false
 BinPackArguments: false
 BinPackParameters: false
 AlignAfterOpenBracket: AlwaysBreak
 AlwaysBreakAfterDefinitionReturnType: All

An example for what the changes do is as follows

Before:

template <typename bfield_t, typename input_track_t, typename propagator_t,
          typename vfitter_t>
Acts::Result<Acts::Vertex<input_track_t>> Acts::IterativeVertexFinder<
    bfield_t, input_track_t, propagator_t,
    vfitter_t>::getVertexSeed(const std::vector<input_track_t>& seedTracks,
                              const VertexFinderOptions<input_track_t>&
                                  vFinderOptions) const {

After:

template <
    typename bfield_t,
    typename input_track_t,
    typename propagator_t,
    typename vfitter_t>
Acts::Result<Acts::Vertex<input_track_t>>
Acts::IterativeVertexFinder<bfield_t, input_track_t, propagator_t, vfitter_t>::
    getVertexSeed(
        const std::vector<input_track_t>& seedTracks,
        const VertexFinderOptions<input_track_t>& vFinderOptions) const {
Edited by Paul Gessinger

Merge request reports

Loading