Page MenuHomePhabricator

[clang-format] Set of unit test to begin to validate that we don't change defaults
ClosedPublic

Authored by MyDeveloperDay on May 19 2020, 7:16 AM.

Details

Summary

This revision is to complement D75791: [clang-format] Added new option IndentExternBlock so we can be sure that we don't change any default behavior.

For now just add rules to cover AfterExternBlock, but in the future we should add cases to cover the other BraceWrapping rules for each style. This will help guard us when we change code inside of the various getXXXStyle() functions to ensure we are not breaking everyone.

Diff Detail

Event Timeline

+1 for this idea. It'd eventually be neat to also take all samples from the style guide of each project and test them, if there aren't licensing concerns.

LGTM with an appropriate merge fix/CI passing.

This revision is now accepted and ready to land.May 20 2020, 5:29 AM

Just belatedly caught something: Webkit style is supported too but not listed here. Can you add that?

Adding WebKitStyle()

I think we should take these tests now once they are landed, and we can begin to flesh them out with for() , do(), while() if() conditions so we always know we are not breaking the default style.