From 6d21cdc1e605585f8d4386476792f38b48e82299 Mon Sep 17 00:00:00 2001 From: "erg@google.com" Date: Tue, 13 Jan 2009 21:41:00 +0000 Subject: [PATCH] Update C++ style guide to 3.127: - Clarification on curly braces - Link to cpplint.py --- cppguide.xml | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/cppguide.xml b/cppguide.xml index 0a6497c..ab83f63 100644 --- a/cppguide.xml +++ b/cppguide.xml @@ -4,7 +4,7 @@

-Revision 3.124 +Revision 3.127

@@ -1445,6 +1445,25 @@ Tashana Landray + + + Use cpplint.py to detect style errors. + + +

+ cpplint.py is a tool that reads a source file and + identifies many style errors. It is not perfect, and has both false + positives and false negatives, but it is still a valuable tool. False + positives can be ignored by putting // NOLINT at the end + of the line. +

+

+ Some projects have instructions on how to run cpplint.py + from their project tools. If the project you are contributing to does + not, you can download cpplint.py separately. +

+ +
@@ -3666,9 +3685,11 @@ Tashana Landray

In general, curly braces are not required for single-line - statements, but they are allowed if you like them. Some - + statements, but they are allowed if you like them; + conditional or loop statements with complex conditions or + statements may be more readable with curly braces. Some + projects require that an if must always always have an accompanying brace.

@@ -4317,7 +4338,7 @@ Tashana Landray

-Revision 3.124 +Revision 3.127