This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] NFC Correct clang-format headers file so documentation can be once again autogenerated
ClosedPublic

Authored by MyDeveloperDay on Apr 29 2020, 8:27 AM.

Details

Summary

ClangFormatStyleOptions.rst should ALWAYS be autogenerated from Format.h using clang/docs/tools/dump_format_style.py if not its liable to get removed leaving options undocumented.

This revision reworks the documentation for D73354: clang-format: insert trailing commas into containers. D73768: clang-format: [JS] document InsertTrailingCommas. to ensure we can continue to regenerated

Fix other minor changes that ensure the documentation remains consistent (Format.h obviously got re clang-formatted after the rst had been regenerated previously)

Generated documentation will look like

Diff Detail

Event Timeline

MyDeveloperDay marked an inline comment as done.Apr 29 2020, 8:30 AM
MyDeveloperDay added inline comments.
clang/docs/ClangFormatStyleOptions.rst
1752
NOTE: options are alphabetic in Format.h and so the position within the rst file will change.
MyDeveloperDay retitled this revision from [clang-format] NFC Correct clang-format headers file so documentation can be one again autogenerated to [clang-format] NFC Correct clang-format headers file so documentation can be once again autogenerated.Apr 29 2020, 8:31 AM

Awesome! Thank you!
Now that we've got "clang/phabricator/lint/git" robots that leave comments on patches, we may want to think about a way to have this automatically enforced in the future.

krasimir accepted this revision.Apr 29 2020, 8:36 AM
This revision is now accepted and ready to land.Apr 29 2020, 8:36 AM

Awesome! Thank you!
Now that we've got "clang/phabricator/lint/git" robots that leave comments on patches, we may want to think about a way to have this automatically enforced in the future.

Thats a great idea.. do you know who looks after those scripts?

Awesome! Thank you!
Now that we've got "clang/phabricator/lint/git" robots that leave comments on patches, we may want to think about a way to have this automatically enforced in the future.

Thats a great idea.. do you know who looks after those scripts?

I asked around and a simple thing we can do that would have the effect of complaining on the Phabricator patch if the format options doc has to be regenerated is a lit test that does a diff.
Will prepare a patch, after this lands, so that the newly added test doesn't fail at first.

This revision was automatically updated to reflect the committed changes.