clang-format: [JS] Don't indent JavaScript IIFEs.
authorMartin Probst <martin@probst.io>
Tue, 9 May 2017 20:04:09 +0000 (20:04 +0000)
committerMartin Probst <martin@probst.io>
Tue, 9 May 2017 20:04:09 +0000 (20:04 +0000)
commit101ec894c3f294cefb7d72a908dbc4d1baea7b43
tree8362f81656c721c76edede7c12396badde6e2aed
parentb7a6698ae95a98774147b7a3a68d474f45423d11
clang-format: [JS] Don't indent JavaScript IIFEs.

Because IIFEs[1] are often used like an anonymous namespace around large
sections of JavaScript code, it's useful not to indent to them (which
effectively reduces the column limit by the indent amount needlessly).

It's also common for developers to wrap these around entire files or
libraries. When adopting clang-format, changing the indent entire file
can reduce the usefulness of the blame annotations.

Patch by danbeam, thanks!

Differential Revision: https://reviews.llvm.org/D32989

llvm-svn: 302580
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/FormatTestJS.cpp