This is an archive of the discontinued LLVM Phabricator instance.

clang-format: [JS] wrap and indent `goog.setTestOnly` calls.
ClosedPublic

Authored by mprobst on Sep 11 2017, 6:19 AM.

Details

Summary

While goog.setTestOnly usually appears in the imports section of a file, it is
not actually an import, and also usually doesn't take long parameters (nor
namespaces as a parameter, it's a description/message that should be wrapped).

This fixes a regression where a goog.setTestOnly call nested in a function was
not wrapped.

Diff Detail

Repository
rL LLVM

Event Timeline

mprobst created this revision.Sep 11 2017, 6:19 AM
djasper accepted this revision.Sep 11 2017, 7:30 AM
djasper added inline comments.
unittests/Format/FormatTestJS.cpp
570 ↗(On Diff #114583)

How is this a regression?

I would just put this under the "// These should be wrapped normally." comment that's already there.

This revision is now accepted and ready to land.Sep 11 2017, 7:30 AM
mprobst updated this revision to Diff 114615.Sep 11 2017, 8:22 AM
  • move test to different method
mprobst marked an inline comment as done.Sep 11 2017, 8:24 AM
mprobst added inline comments.
unittests/Format/FormatTestJS.cpp
570 ↗(On Diff #114583)

It's testing that goog.setTestOnly does not regress. That is, we don't have any code under test that special cases setTestOnly, so it's surprising to have a test case for it, but we should have one as we're confirming a previously incorrect behaviour. Your terminology might vary.

Done though, it does make sense to keep it together with the other case above.

This revision was automatically updated to reflect the committed changes.
mprobst marked an inline comment as done.