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

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 17 14:32:01 PST 2017


krasimir added inline comments.


================
Comment at: test/Format/check-coding-style-mozilla.cpp:10
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+if (true) {
----------------
What is tested here? Brace styles?


================
Comment at: test/Format/check-coding-style-mozilla.cpp:48
+                ,
+                public Y
+{
----------------
This does not check precisely what the comment says, because the comment affects the indentation decisions. Better put the comment before the class declaration.


================
Comment at: test/Format/check-coding-style-mozilla.cpp:75
+    return mVar;
+  } // Tiny functions can be written in a single line.
+
----------------
I don't get it - shouldn't then TinyFunction be on a single line? Also the long trailing comment might affect formatting, so I suggest putting it before the function definition.


================
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)
----------------
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.


================
Comment at: test/Format/check-coding-style-mozilla.cpp:102
+
+T* p; // GOOD
+
----------------
I suggest either the comment to be more specific what exactly is "GOOD" or remove the comment altogether.


================
Comment at: test/Format/check-coding-style-mozilla.cpp:106
+             !GetCachedStyleData(aSID),
+           "bar");
+
----------------
What does this fragment and the following ones test?


https://reviews.llvm.org/D30111





More information about the cfe-commits mailing list