This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Copy help options to the doc directory.
ClosedPublic

Authored by sstwcw on Mar 17 2022, 1:49 AM.

Details

Summary

The options listed in ClangFormat.rst lag behind those output by the
-help command line option. Specifically, these are missing.

--files
--qualifier-alignment

Fixes #54418

Diff Detail

Event Timeline

sstwcw created this revision.Mar 17 2022, 1:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2022, 1:49 AM
sstwcw requested review of this revision.Mar 17 2022, 1:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2022, 1:49 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
sstwcw updated this revision to Diff 416097.Mar 17 2022, 1:51 AM

If anyone's wondering why all the lines changed. The --qualifier-alignment is too long so all the descriptions are moved to the right.

curdeius added inline comments.
clang/docs/ClangFormat.rst
73

Shouldn't long descriptions like this one be split into multiple lines and aligned with -?
Did you do it by hand or with some script?

sstwcw added inline comments.Mar 17 2022, 5:15 AM
clang/docs/ClangFormat.rst
73

It was not split in the -help output. I copied the output from a terminal by hand. If you run clang-format -help from the latest git build in an 80-column terminal you will see that output is all over the place. The options that were broken into lines have hard line breaks lin clang/tools/clang-format/ClangFormat.cpp. But now with the --qualifier-alignment option being too wide even those got pushed over 80 columns.

MyDeveloperDay edited reviewers, added: curdeius, MyDeveloperDay, HazardyKnusperkeks, owenpan; removed: Restricted Project.Mar 17 2022, 5:45 AM
MyDeveloperDay requested changes to this revision.Mar 17 2022, 5:47 AM
  1. Please log a github issue showing us what you are fixing.
  2. Please add the main clang-formatter developers as reviewers and not the clang-format project (I think we see it but I like to see the individual reviewers so I know there opinion)
  3. How about you change this so it autogenerates the rst so its never out of date.
This revision now requires changes to proceed.Mar 17 2022, 5:47 AM
sstwcw edited the summary of this revision. (Show Details)Mar 17 2022, 6:15 AM
sstwcw marked an inline comment as done.EditedMar 17 2022, 6:24 AM

The issue is #54418.

Actually I don't know who I should add as reviewers. The patches for clang-format don't always seem to have the same reviewers. Who are the main developers and how do you decide who you add each time?

I give up making the doc generated. It would require either integrating into the build process or writing a parser script like for the style options. Besides, that file is not entirely generated.

The issue is #54418.

Actually I don't know who I should add as reviewers. The patches for clang-format don't always seem to have the same reviewers. Who are the main developers and how do you decide who you add each time?

We have been adding @MyDeveloperDay @curdeius @HazardyKnusperkeks as reviewers to your patches. For JavaScript, you should add @krasimir too.

The issue is #54418.

Actually I don't know who I should add as reviewers. The patches for clang-format don't always seem to have the same reviewers. Who are the main developers and how do you decide who you add each time?

I give up making the doc generated. It would require either integrating into the build process or writing a parser script like for the style options. Besides, that file is not entirely generated.

ok neither is ClangFormatStyleOptions.rts, but also the doc/tools/dump_format_style.py is also something thats not part of the build, but just a tool we can run to ensure the Format.h and ClangFormatStryleOptions.rst stay in lock step.

So actually I think that's a good task for someone to do, but its not necessary to do it here, but actually I think I'd prefer to see that than having to keep this the same by hand. I clearly missed that step. (so I appreciate you adding it)

MyDeveloperDay accepted this revision.Mar 17 2022, 12:36 PM
This revision is now accepted and ready to land.Mar 17 2022, 12:36 PM
This revision was automatically updated to reflect the committed changes.