[PATCH] clang-format: Add ability to align assignment operators

Matt Oakes oakesm9 at gmail.com
Mon Apr 13 03:36:54 PDT 2015


Completed:

- Align other assignments such as `+=`
- Switch to using `verifyFormat` when possible
- Test multiple assignments on a single line

Still to do:

- Don't align for default parameters
- Ignore assignments within for and if statements

I'm unsure what the best way to detect those two cases are. I thought about checking that either the token before (or two before when a type is given) the first assignment on a line is at the start of the line. Would that be an acceptable solution?


http://reviews.llvm.org/D8821

Files:
  docs/ClangFormatStyleOptions.rst
  include/clang/Format/Format.h
  lib/Format/Format.cpp
  lib/Format/WhitespaceManager.cpp
  lib/Format/WhitespaceManager.h
  unittests/Format/FormatTest.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8821.23667.patch
Type: text/x-patch
Size: 14027 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150413/9118fcea/attachment.bin>


More information about the cfe-commits mailing list