This is an archive of the discontinued LLVM Phabricator instance.

Add new clang-format alignment option
Needs RevisionPublic

Authored by philbert on Feb 2 2023, 6:39 AM.

Details

Summary

I work on a code base that aligns all declarations execpt parameters to
functions. This patch adds a new option to AlignConsecutiveDeclarations.

TODO I need to add unit-tests for this option but this would be really useful for me
but given its a new option I have not done this yet just to get feedback whether this
option would get accepted or not.

Diff Detail

Event Timeline

philbert created this revision.Feb 2 2023, 6:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2023, 6:39 AM
philbert requested review of this revision.Feb 2 2023, 6:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2023, 6:39 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
MyDeveloperDay requested changes to this revision.Feb 6 2023, 3:55 AM
MyDeveloperDay added a project: Restricted Project.

Please add the unit tests

This revision now requires changes to proceed.Feb 6 2023, 3:56 AM

Can you please do a full context diff see (https://llvm.org/docs/Contributing.html)

clang/include/clang/Format/Format.h
225

Ok you have to give us the example at least

please point to a github issue which outlines what you are fixing and why

clang/lib/Format/Format.cpp
35

why moving?

" just to get feedback whether this
option would get accepted or not."

Honestly I can't tell from the code what problem you are trying to fix. The github issue and unit tests are vital for us to understand what you are trying to achieve (and to ensure you are not breaking anything)