The option BeforeHash added to IndentPPDirectives.
Fixes Bug 36019. https://bugs.llvm.org/show_bug.cgi?id=36019
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
PPBranchLevel can be negative, while Line->Level is unsigned. Added check to ensure that PPBranchLevel is positive before adding to Line->Level.
As per https://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options, could you please provide more info about the need for this option first?
@krasimir BeforeHash style is widely used for Unreal Engine 4 based projects development. I was looking for this option too.
I understand that adding new options adds costs to the development of clang-format, but there was a feature request and there is interest for this option.
As for the cost to the development, there already exists PPDIS_AfterHash. All I did was make the changes introduced in that patch a bit more general and removed the hard coded assumption that there are no indents before a hash at a couple of places.
I would argue the cost of development of this new option is roughly the same as it is with the existence of PPDIS_AfterHash itself. PPDIS_BeforeHash seems like a natural extension of the changes introduced by PPDIS_AfterHash.
Could you add some text into the docs/ReleaseNotes.rst to say you are adding a new option
take a look at https://clang.llvm.org/extra/ReleaseNotes.html#improvements-to-clang-tidy for an example
lib/Format/UnwrappedLineFormatter.cpp | ||
---|---|---|
15 ↗ | (On Diff #165700) | Nice! its the irony of clang-format code is that its not clang formatted!! |
While we wait for code review I've landed this currently unaccepted clang-format revision into https://github.com/mydeveloperday/clang-experimental/releases for those wishing to try/test or provide feedback
Added an entry to ReleaseNotes.rst about the new option.
This diff doesn't contain unrelated formatting changes due to running clang-format on some source files that apparently weren't formatted before.
Thank you for helping to address one of the many clang-format issues from bugzilla, I'm not the code owner here but this LGTM.
Given this doesn't add an extra option (but only an extra enum) and is fairly straight forward, LG.
Could you do a rebase? I've tried to land it but there are too many merge conflicts currently.
Is it because the diff was made with the svn repository? It is for the newest revision.
Should I make a new diff with the git repo instead?
Or is it not because of the diff, but something in phabricator instead?
Sorry this is my first patch.
No worries. It is just because you've made your last update at 2nd of march(assuming you've rebased before that, otherwise it might be as old as last september) and its 20th today, there are other people making changes, which simply conflicts with yours.
I checked out the git repository and applied the patch to head and reran all tests.
The diff produced by git is basically the same, should I upload the new diff?
I think you might need a new diff, I tried to merge this and it rejected some of the patch
Made a new diff on the git repository, since the docs now recommend using git.
Rebased and created a new diff with git show HEAD -U999999.
The patch applies cleanly on windows after git reset --hard so I hope there shouldn't be any merge conflicts now.