This is an archive of the discontinued LLVM Phabricator instance.

[clang-format][NFC] Reformat clang/lib/Format using 6257832bf94f
ClosedPublic

Authored by owenpan on Sep 20 2022, 5:17 PM.

Details

Summary

Fix braces and add .clang-format to keep the directory formatted.

Diff Detail

Event Timeline

owenpan created this revision.Sep 20 2022, 5:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 20 2022, 5:17 PM
owenpan requested review of this revision.Sep 20 2022, 5:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 20 2022, 5:17 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
MyDeveloperDay accepted this revision.Sep 21 2022, 12:30 AM

LGTM, we of all people have to dogfood this stuff..

This revision is now accepted and ready to land.Sep 21 2022, 12:30 AM
sstwcw added a subscriber: sstwcw.Sep 21 2022, 6:37 AM

Did you leave out clang/include/clang/Format and clang/unittests/Format?

Did you leave out clang/include/clang/Format and clang/unittests/Format?

I was going to take care of them after this patch. Thanks for asking though.

This revision was landed with ongoing or failed builds.Sep 21 2022, 12:03 PM
This revision was automatically updated to reflect the committed changes.

Did you leave out clang/include/clang/Format and clang/unittests/Format?

I was going to take care of them after this patch. Thanks for asking though.

See e347c0fc9bf8.

MyDeveloperDay added a comment.EditedSep 27 2022, 3:24 AM

Unfortunately this is causing the failing the "premerge checks" on reviews likely because this machine is using an earlier version of clang-format

To be honest, I'd love to fix this by making this "unknown key" just a warning. For some keys we don't need them to be recognized (this is one, RemoveBracesLLVM is another)

Unfortunately this is causing the failing the "premerge checks" on reviews likely because this machine is using an earlier version of clang-format

Isn't this the case for any new option? IMO anyone who updated the source to include a new option should build a new clang-format and use that for pre-merge checks.

I'm not sure what version of clang-format they use in the premerge checks, I don't know who we contact to get it updated. I guess the clang-format check might come before any building of the code.

You know if we relex the "Unknown" YAML option, this would go a long way not only to help us here but also to that situation where new options break people using older clang-format version.

I guess the clang-format check might come before any building of the code.

+1.

You know if we relex the "Unknown" YAML option, this would go a long way not only to help us here but also to that situation where new options break people using older clang-format version.

Changing an unknown/misspelled-option error to a warning will also change the return code of clang-format. That would be unacceptable to a lot people, I believe.

In general, new options won't cause problems for people unless they add them to config files without updating clang-format. The situation with clang-format sources is very unique and rarely occurs, so it's probably better to just leave it as is.

yeah I'm ok with that too.