This is an archive of the discontinued LLVM Phabricator instance.

clang-format: use `pb` as a canonical raw string delimiter for google style
ClosedPublic

Authored by krasimir on Mar 1 2021, 7:32 AM.

Details

Summary

This updates the canonical text proto raw string delimiter to pb for Google style, moving codebases towards a simpler and more consistent style.

Also updates a behavior where the canonical delimiter was not applied for raw strings with empty delimiters detected via well-known enclosing functions that expect a text proto, effectively making the canonical delimiter more viral. This feature is not widely used so this should be safe and more in line with promoting the canonicity of the canonical delimiter.

Diff Detail

Event Timeline

krasimir requested review of this revision.Mar 1 2021, 7:32 AM
krasimir created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMar 1 2021, 7:32 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
krasimir updated this revision to Diff 327120.Mar 1 2021, 7:52 AM

clang-format: use pb as a canonical raw string delimiter for google style

krasimir retitled this revision from clang-format: use `ph` as a canonical raw string delimiter for google style to clang-format: use `pb` as a canonical raw string delimiter for google style.Mar 1 2021, 7:55 AM
krasimir edited the summary of this revision. (Show Details)
krasimir updated this revision to Diff 328079.Mar 4 2021, 2:03 AM

Update tests

krasimir updated this revision to Diff 328081.Mar 4 2021, 2:03 AM

Collect commits

krasimir edited the summary of this revision. (Show Details)Mar 4 2021, 2:08 AM
krasimir added a reviewer: sammccall.
sammccall accepted this revision.Mar 8 2021, 1:51 AM

Also fixes a bug where the canonical delimiter was not applied for raw strings with empty delimiters detected via well-known enclosing functions that expect a text proto.

Are you sure this was a bug rather than intended behavior? Seems... not unreasonable.

CanonicalDelemiter seems very rarely used so far though, so should be safe.

This revision is now accepted and ready to land.Mar 8 2021, 1:51 AM

Also fixes a bug where the canonical delimiter was not applied for raw strings with empty delimiters detected via well-known enclosing functions that expect a text proto.

Are you sure this was a bug rather than intended behavior? Seems... not unreasonable.

CanonicalDelemiter seems very rarely used so far though, so should be safe.

Good point! I agree that is a reasonable behavior as well, so it's not a bug but a change of behavior. Agree that this should be safe.

krasimir edited the summary of this revision. (Show Details)Mar 8 2021, 2:02 AM