This is an archive of the discontinued LLVM Phabricator instance.

Added note about Whatstyle and Unformat
AbandonedPublic

Authored by owenpan on Sep 22 2021, 7:14 AM.

Details

Summary

I added a note about Whatstyle and Unformat in the docs.

Diff Detail

Event Timeline

Volker-Weissmann requested review of this revision.Sep 22 2021, 7:14 AM
Volker-Weissmann created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptSep 22 2021, 7:14 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
xgupta added a subscriber: xgupta.Sep 23 2021, 5:35 AM
MyDeveloperDay added a project: Restricted Project.

Whatstyle has not been updated since Dec 2020, is it going to cover the latest style configuration options?

Whatstyle has not been updated since Dec 2020, is it going to cover the latest style configuration options?

No it doesn't.
As I wrote, both work on a best-effort basis. I tried them myself, they are far from guaranteed to give you the correct .clang-format file. But it's better than nothing.

IMHO is that I don't personally feel we need to endorse the work of someone else that could be potentially incomplete, These tools are interesting (per say) but I have no idea how accurate they are in terms of using all the options or how much they keep pace, for everything else there is "google search" to find these, (other search engines are available)

My feeling is that if you are using this tool then perhaps you are rushing to get to your format and you should be either :

a) picking a default style
b) taking a bit more time to read the manual and choose what you want.

Those tools suggest a quick fix, but come with extra effort to get them installed (extra python modules) and I personally wouldn't want clang-format to be somehow responsible if they generate an incorrect .clang-format file or messed up someones files.

I'll let others decide if they think it's of value but for me it's a no (sorry just my 2c worth).

HazardyKnusperkeks resigned from this revision.Oct 6 2021, 12:12 PM

I too think this should not directly mentioned in clang-format documentation.

I understand your concerns, it isn't meant as an endorsement. I took me quite a while too find them with google, so I thought I make it faster for the next one after me.

xgupta removed a subscriber: xgupta.Dec 17 2021, 7:25 AM
owenpan commandeered this revision.Oct 25 2023, 4:40 AM
owenpan edited reviewers, added: Volker-Weissmann; removed: owenpan.
Herald added a project: Restricted Project. · View Herald TranscriptOct 25 2023, 4:40 AM
NOTE: Clang-Format Team Automated Review Comment

Your review contains a change to ClangFormatStyleOptions.rst but not a change to clang/include/clang/Format/Format.h

ClangFormatStyleOptions.rst is auto generated from Format.h via clang/docs/tools/dump_format_style.py, please run this to regenerate the .rst

You can validate that the rst is valid by running.

./docs/tools/dump_format_style.py
mkdir -p html
/usr/bin/sphinx-build -n ./docs ./html
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 abandoned this revision.Oct 25 2023, 4:41 AM