This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by kuzkry on Feb 13 2022, 3:23 PM.

Details

Summary

Note: Option 'IndentRequiresClause' was previously known as
'IndentRequires' but the version marker should still indicate
'clang-format 15' as this option most recent name wasn't accessible
earlier and it would produce:
error: unknown key 'IndentRequiresClause'

Diff Detail

Event Timeline

kuzkry requested review of this revision.Feb 13 2022, 3:23 PM
kuzkry created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 13 2022, 3:23 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
MyDeveloperDay accepted this revision.Feb 15 2022, 12:39 AM
MyDeveloperDay added a subscriber: HazardyKnusperkeks.

@HazardyKnusperkeks could you validate the IndentRequiresClause I know I added IndentRequires in 13 but is this the same option renamed or a new option?

This revision is now accepted and ready to land.Feb 15 2022, 12:39 AM
MyDeveloperDay added a project: Restricted Project.

I understand what you are saying re 'IndentRequiresClause' but this leaves us with people with "IndentRequires" in their .clang-format without any understanding of what it means? i.e. what about the 14.0 people? if we've renamed an option then the documentation should carry something like

'Previously known as IndentRequires'

I understand what you are saying re 'IndentRequiresClause' but this leaves us with people with "IndentRequires" in their .clang-format without any understanding of what it means? i.e. what about the 14.0 people? if we've renamed an option then the documentation should carry something like

'Previously known as IndentRequires'

That's not the first time we renamed something. And most likely not the last time.

clang/include/clang/Format/Format.h
2542–2543

First of all, thanks @MyDeveloperDay for the approval.

@HazardyKnusperkeks could you validate the IndentRequiresClause I know I added IndentRequires in 13 but is this the same option renamed or a new option?

This was renamed and it was done in 9aab0db13fb6d21d1b70247a9b5e4cf916ee1c3a.

I understand what you are saying re 'IndentRequiresClause' but this leaves us with people with "IndentRequires" in their .clang-format without any understanding of what it means? i.e. what about the 14.0 people? if we've renamed an option then the documentation should carry something like

'Previously known as IndentRequires'

I have no problems with adding it myself if you want. I think this is nice to have and I see nothing wrong in adding it.

I understand what you are saying re 'IndentRequiresClause' but this leaves us with people with "IndentRequires" in their .clang-format without any understanding of what it means? i.e. what about the 14.0 people? if we've renamed an option then the documentation should carry something like

'Previously known as IndentRequires'

That's not the first time we renamed something. And most likely not the last time.

But that doesn't mean we can't add "Previously known as IndentRequires", does it? :)

To all:
I'm willing to add "Previously known as IndentRequires" but please let me know if you're for or against it.

MyDeveloperDay added inline comments.Feb 18 2022, 4:20 AM
clang/include/clang/Format/Format.h
2542–2543

I like that suggestion..

I like /// In clang-format 13 and 14 it was named IndentRequires. The code in theory should still support it so it should be documented.

kuzkry updated this revision to Diff 409935.Feb 18 2022, 7:35 AM

Review fix: added note about IndentRequires. The generated HTML looks like this:

kuzkry marked 2 inline comments as done.Feb 18 2022, 7:37 AM
kuzkry added inline comments.
clang/include/clang/Format/Format.h
2542–2543

Sorry, I didn't notice this inline comment before.

@HazardyKnusperkeks, I put it in a slightly different place, i.e. above the example code as Sphinx complained about this particular placement.

kuzkry marked an inline comment as done.Feb 18 2022, 7:38 AM

That's not the first time we renamed something. And most likely not the last time.

But that doesn't mean we can't add "Previously known as IndentRequires", does it? :)

Of course! I just wanted to say that we can and should create precedence here.

clang/include/clang/Format/Format.h
2542–2543

Fine by me. I have absolutely no idea about this sphinx or .rst stuff.

Can I ask you to deliver this one for me? My name and email in git format is "Krystian Kuzniarek <krystian.kuzniarek@gmail.com>"