This is an archive of the discontinued LLVM Phabricator instance.

[clang-format][docs] Fix incorrect 'clang-format 14' configuration options markers
ClosedPublic

Authored by kuzkry on Feb 4 2022, 6:20 AM.

Details

Summary

[clang-format][docs] Fix incorrect 'clang-format 14' configuration options markers

Introduced by 23a5090c6, some style option markers indicated 'clang-format 14',
though their respective options were available in earlier releases.

Note: Even though the value type of 'SpacesInAngles' option changed,
this option has been already present from version 3.4.

Diff Detail

Event Timeline

kuzkry requested review of this revision.Feb 4 2022, 6:20 AM
kuzkry created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2022, 6:20 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
MyDeveloperDay added a project: Restricted Project.

Thank you for looking into this, I'm more than happy for us to change the values to their more accurate first releases, but can I ask how you went about making those assumptions? For me initially I simply looks at the commit in the blame then tracked that to what branches it was in. I always knew it would be inaccurate.

What was your technique for doing this?

This revision is now accepted and ready to land.Feb 5 2022, 3:27 AM
kuzkry added a comment.Feb 5 2022, 4:10 AM

Hey @MyDeveloperDay,

Thank you for your positive feedback :)

You asked about my technique. Well, I did it empirically. There is a really splendid repository on GitHub by muttleyxd, i.e. https://github.com/muttleyxd/clang-tools-static-binaries. What muttleyxd did is he automated the task of compiling all major versions of clang tools (including clang-format) and he released it in form of static binaries to avoid problems with dependencies (they are really small though). Btw. I recommend you to at least save this as a bookmark in your web browser.

Having downloaded clang-format in versions 3.9 and from 4.0 to 13.0, I simply manually ran those binaries and looked for "unknown key" errors. I did that only for all options marked with "clang-format 14" tag, i.e.:
EmptyLineAfterAccessModifier
IfMacros
PPIndentWidth
PackConstructorInitializers
PenaltyBreakOpenParenthesis
QualifierAlignment
QualifierOrder
ReferenceAlignment
RemoveBracesLLVM
SeparateDefinitionBlocks
ShortNamespaceLines
SpaceBeforeParensOptions
SpacesInAngles
SpacesInLineCommentPrefix

The only problem I got was SpacesInAngles, which I actually checked using your technique, i.e. git-based rather than empirical one. I had to make it like that cause it was already available before 3.9, which is the earliest in muttleyxd's repository.

Do you need someone to land this for you? if so we need your "name <email_address>"

Do you need someone to land this for you? if so we need your "name <email_address>"

Yes, I need someone to do that. Could you do this for me, please? It's "Krystian Kuzniarek <krystian.kuzniarek@gmail.com>". Thanks in advance.

P.S. I plan to continue with similar work in decreasing order of clang-format versions so firstly for "clang-format 13", secondly for 12, then 11, etc. If I find some more inaccuracies, I will prepare new Phabricator reviews for you.

owenpan accepted this revision.Feb 5 2022, 8:32 PM
This revision was landed with ongoing or failed builds.Feb 5 2022, 8:33 PM
This revision was automatically updated to reflect the committed changes.