[PATCH] Clang-format support for removing space before assignment operators

Daniel Jasper djasper at google.com
Fri Sep 13 01:12:16 PDT 2013

You should be able to use "Tok.getPrecedence() == prec::Assignment" instead
of the new IsTokenAssignment function. Also, please put the tests into
"unittests/Format/FormatTest.cpp". We have plans to turn (some of) those
into file-based tests, but for now, I'd like to keep formatting-specific
tests together. Also, in addition to actually testing whether the
style-configuration works as expected, there are also tests there which
test whether the option can be successfully parsed from JSON (see how it is
done for the other flags close to the bottom).

On Fri, Sep 13, 2013 at 12:14 AM, Aaron Wishnick <aaron.s.wishnick at gmail.com
> wrote:

> My organization's coding standards include not putting a space before
> assignment operators, e.g. "int a= 42;". In order for us to be able to use
> clang-format, we need support for this.
> I've attached a patch that adds a new format style option,
> "SpaceBeforeAssignmentOperators." All the existing hard-coded styles now
> default to having it set to true. I've also included a test.
> Please let me know if this looks good, or if there's anything else I can
> do.
> Thank you!
> Aaron
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130913/f95c2c66/attachment.html>

More information about the cfe-commits mailing list