This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Update documentation
ClosedPublic

Authored by thakis on Jul 3 2022, 1:16 PM.

Details

Summary
  • Update clang-format --help output after b1f0efc06acc.
  • Update clang-format-diff.py help text, which apparently hasn't been updated in a while. Since git and svn examples are now part of the help text, remove them in the text following the help text.

Diff Detail

Event Timeline

thakis created this revision.Jul 3 2022, 1:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 3 2022, 1:16 PM
thakis requested review of this revision.Jul 3 2022, 1:16 PM
thakis added inline comments.Jul 3 2022, 1:21 PM
clang/docs/ClangFormat.rst
233

(As far as I can tell, we don't have git clang-format docs anywhere? But that's for a different patch.)

curdeius accepted this revision.Jul 3 2022, 1:22 PM
This revision is now accepted and ready to land.Jul 3 2022, 1:22 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 4 2022, 12:42 PM
owenpan added a project: Restricted Project.Jul 4 2022, 12:45 PM
owenpan added a subscriber: owenpan.Sep 5 2023, 4:51 PM
owenpan added inline comments.
clang/docs/ClangFormat.rst
20

This should be edited in dump_format_help.py instead.

Herald added a subscriber: wangpc. · View Herald Transcript
NOTE: Clang-Format Team Automated Review Comment

It looks like your clang-format review does not contain any unit tests, please try to ensure all code changes have a unit test (unless this is an NFC or refactoring, adding documentation etc..)

Add your unit tests in clang/unittests/Format and you can build with ninja FormatTests. We recommend using the verifyFormat(xxx) format of unit tests rather than EXPECT_EQ as this will ensure you change is tolerant to random whitespace changes (see FormatTest.cpp as an example)

For situations where your change is altering the TokenAnnotator.cpp which can happen if you are trying to improve the annotation phase to ensure we are correctly identifying the type of a token, please add a token annotator test in TokenAnnotatorTest.cpp

owenpan added inline comments.Sep 7 2023, 12:50 AM
clang/docs/ClangFormat.rst
20

Fixed in c47c480b1845.