WIP: New clang-format flags for parameter and (template) argument breaking
- Jul 08, 2019
-
-
Robert Johannes Langenberg authored
-
Please be advised that registry.cern.ch registry (Registry Service) will be unavailable next Monday, March 10th starting at 08:00h (Geneva time) for a short period of time. This may cause temporary disruptions to your workflows. Further information: OTG0154905
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 {