[PATCH] D30111: [clang-format] Add a test to check at once all the Mozilla coding style

Sylvestre Ledru via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 20 02:29:12 PST 2017


sylvestre.ledru added inline comments.


================
Comment at: test/Format/check-coding-style-mozilla.cpp:48
+                ,
+                public Y
+{
----------------
krasimir wrote:
> sylvestre.ledru wrote:
> > krasimir wrote:
> > > This does not check precisely what the comment says, because the comment affects the indentation decisions. Better put the comment before the class declaration.
> > I know, this is one of the thing I would like to see fixed in clang format or us. 
> > I am adding it in the test suite to make sure that we address it
> I think this might be better addressed through a bug/feature request, plus an explicit comment here that this is not yet supported, because this is not obvious from just starring at the code.
Make sense. I reported https://bugs.llvm.org/show_bug.cgi?id=32017 for this



================
Comment at: test/Format/check-coding-style-mozilla.cpp:90
+template<typename T> // Templates on own line.
+static int           // Return type on own line for top-level functions.
+  MyFunction(int a)
----------------
sylvestre.ledru wrote:
> krasimir wrote:
> > Trailing comments affect line breaking, so this is not really testing what the comments say. Suggest to put them on a line before the template.
> Yeah, we are trying to fix this issue.
> but you are correct, I will move it
Reported here:
https://bugs.llvm.org/show_bug.cgi?id=32016



================
Comment at: test/Format/check-coding-style-mozilla.cpp:7-9
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
----------------
klimek wrote:
> Note that I'm not a license expert, but I'd be surprised if it was ok to put code in random licenses into the repo.
I don't think this is a problem as it is in the test and there is no actual code but I can remove it if you prefer.

This was to test the formatting of comment


https://reviews.llvm.org/D30111





More information about the cfe-commits mailing list