Commit Graph

215 Commits

Author SHA1 Message Date
naomib@google.com
c2482ee7e9 fixing a link to the style doc 2014-02-13 18:27:17 +00:00
naomib@google.com
23495719eb small css fix 2014-02-13 01:07:04 +00:00
naomib@google.com
3fcaf64db1 First add of the Google AngularJS Style Guide 2014-02-13 00:50:10 +00:00
eh@google.com
4293832aaa java style guide and eclipse configuration update 2014-02-03 23:39:45 +00:00
eh@google.com
d1e499413b java style guide expand TOC 2013-12-30 20:03:36 +00:00
eh@google.com
b631371099 initial commit for java style guide 2013-12-17 22:56:22 +00:00
erg@google.com
1968027290 Add an --extensions flag to change valid file extensions.
The valid cpplint extensions are .h, .cpp, .cc, .cuh and .cu. It is
common for .hpp to be a valid extension to check, the --extensions flag
allows the user to specify which extensions they think are valid.

Patch by Matt Clarkson <mattyclarkson@gmail.com>
2013-12-16 22:48:54 +00:00
erg@google.com
0075d1469a A false positive occurs when a user specifies a using declaration for a stream operator:
10: using ns::operator<<;
    file.cpp:10: Missing spaces around << [whitespace/operators] [3]

The regular expression has been updated to find this valid use case of the <<
text string.

Review URL: https://codereview.appspot.com/22190043

Patch from Matt Clarkson <mattyclarkson@gmail.com>.
2013-11-05 22:28:07 +00:00
erg@google.com
ab53edf6ff Added a --linelength flag so that the default of 80 can be changed.
Review URL: https://codereview.appspot.com/22180043

Patch from Matt Clarkson <mattyclarkson@gmail.com>.
2013-11-05 22:23:37 +00:00
erg@google.com
6d8d983b11 In cpplint, permit Dodxygen C++ annotations, which come after members, e.g.
int var; //!< Brief description after the member
or
  int var; ///< Brief description after the member

Cf. http://www.stack.nl/~dimitri/doxygen/manual/docblocks.html#memberdoc

Currently, cpplint accepts comments after members, cf.
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Implementation_Comments#Implementation_Comments
and it accepts also the doxygen comments of the type "///" (followed by a new line) and
"/// " (followed by a comment). Only the Doxygen annotations, which come
after members are rejected, which is fixed by this patch.

Review URL: https://codereview.appspot.com/14607044

Patch from Tobias Burnus <burnus@net-b.de>.
2013-10-31 19:46:18 +00:00
erg@google.com
2aa5998d82 Update cpplint.py to #296:
- Check for NUL bytes in the file.
- Fixed many false positives related to brace initialization.
- Improved accuracy of parsing reference template parameters.
- Added support for C++11 raw strings.
- Added CUDA extensions to those allowed by cpplint.
- Added check for incomplete namespaces.
- Silence warnings for missing spaces after comma due to elided
  comments.
- Rephrased some messages so that they're actionable.
- Fix false positive on namespace qualified function pointer arguments.
- Fix false positive for operators which return strings.
- Revive the VLOG check.

R=mark@chromium.org

Review URL: https://codereview.appspot.com/17450043
2013-10-28 19:09:25 +00:00
erg@google.com
c667123215 Update cpplint.py to #267:
- Handle parentheses in CHECK() calls properly.
- Fixed multiple false positives where various things like
  std::fucntion<> or function pointers were being mistaken for casts.
- Fixed whitespace warning on placement new.
- Fixed multiple false positives related to const references.
- Added warning for empty conditional bodies.
- Stop advising the use of readdir_r instead of readdir.
- Fixed false positive for empty macro arguments.
- Fixed false positvie for braced initializer lists.
- Don't warn about unnamed parameters in function pointers.

R=mark@chromium.org

Review URL: https://codereview.appspot.com/17400043
2013-10-25 21:44:03 +00:00
erg@google.com
fd5da63478 Update cpplint.py to #242:
- Check indentation of public/protected/private keywords.
- Remove RTTI warning.
- Silence warning about multiple inheritance from global namespace.
- Copy ctors don't need "explicit".
- Understand "const char* const&" as a const reference.
- Remove runtime/sizeof.
- Recognize the "catch" keyword.
- List C++11 headers
- Allow sscanf()
- Allow for one extra level of nesting in template class decls.
- False positive for semicolons after single-line nameless unions.

R=mark@chromium.org

Review URL: https://codereview.appspot.com/15740044
2013-10-25 17:39:45 +00:00
mark@chromium.org
7b24563e08 Update C++ style guide to 3.274:
- Change formatting rules of braced initializers.
 - Permit use of constexpr and allow constexpr global variables.
 - Allow all C++11 features except for those that are specifically banned.
 - Fix/add C99 format specifiers for ptrdiff_t and ssize_t.
 - Add lambda expressions to the list of explicitly banned C++11 features.
 - Relax "return type is always on the same line as the function name" rule.
 - Allow unique_ptr, discourage ownership transfer. Allow noncopyable std::move.
 - Allow system-specific includes after other includes.
 - Add boost/math/distributions to the set of permitted Boost libraries.

Update Objective-C style guide to 2.59:
 - Use instancetype as return type for example init methods.
 - Remove invalid +stringWithInt: call.
 - Remove reference to pre-Objective-C 2.0 declaration requirements.
 - Remove reference to Objective-C exception macros.
 - Remove reference to informal protocols as an alternative to optional methods.
 - Class headers should include comments documenting non-trivial interfaces.
 - Don't specify that blocks are preferable to methods as callbacks.
 - Specify "strong" and "weak" as comments for non-Objective-C pointers.
 - Replace improper reference to ownership of a retained object.
 - Clarify some aspects of method ordering rules.
 - Prefixes are required for shared code and optional for applications.
 - Clarify that nil pointers are safe as receivers, not necessarily parameters.
 - Clarify that delegate pointers should typically be zeroing weak pointers.
 - Allow a 100-column limit, except for projects that choose to use 80.

Update Python style guide to 2.59:
 - Add more examples of bad code to the default arguments section.
 - Allow ''' when ' is used as the single quote within a file.
 - Remove references to pychecker. Recommend pylint.
 - Add more examples to the indentation section.

Update JavaScript style guide to 2.93:
 - Add @nocompile.
 - Fix a few typos.
 - When wrapping lines, indent more deeply for child expressions.
 - Document that @const can be used on a constructor.
 - Update eval section to discourage using eval for RPC.
 - Update an example to avoid encouraging using numbers as booleans.
 - Allow for no indentation of @desc jsdoc tags.
 - Add @public discussion.

Update shell style guide to 1.26:
 - Add a section on style for case statements.

Update Common Lisp style guide to 1.23:
 - fare-matcher was superseded by optima.
 - Clarify wording regarding DYNAMIC-EXTENT.
2013-09-25 21:16:00 +00:00
tunes@google.com
d6c053f670 Update Common Lisp Style Guide to 1.22:
* tweak some typos and bad formatting
* refer to ASDF3's UIOP rather than its predecessors.
2013-09-19 17:26:22 +00:00
mshields@google.com
02e6923718 Restore redirect to Rguide.xml from r105. 2013-07-18 23:57:39 +00:00
mshields@google.com
228a8ef7d0 Restore r105 of Rguide.xml, now with the svn:mime-type property set. 2013-07-18 23:41:50 +00:00
erg@google.com
5d00c5679e Adding streambuf as a valid CPP header.
Patch from chris.dale.dis.
2013-07-12 19:57:05 +00:00
mark@chromium.org
5684bbc8b5 Update C++ style guide to 3.260:
- Add boost::bimap to the list of allowed Boost libraries.
 - C++11: remove mention of constexpr.
 - Remove noun/verb naming rules, and consolidate "General Naming Rules".
 - C++11: allow variadic templates.
 - Revise guidance on function definition comments.
 - Clarify that one space is sufficient before trailing /* */ comments.
 - C++11: allow alias templates.
 - C++11: allow <array>, deprecate Boost array.
 - C++11: allow unique_ptr, deprecate Boost pointer container.
 - C++11: allow braced initializer lists.

Update Objective-C style guide to 2.56:
 - Add details on constant declarations to clarify naming and scope issues.
 - Update link to Apple's Objective-C guide.
 - Allow left-aligning multi-block method invocation segments.
 - Add section on container literals.

Update Python style guide to 2.54:
 - Allow str.format in addition to the % operator.
 - Allow #!/usr/bin/python2 and #!/usr/bin/python3.
 - Move the closing brace example from column 4 to 0.
 - Remove the requirement to use named parameters for arguments with defaults.

Update HTML/CSS style guide to 2.23:
 - No changes.

Update JavaScript style guide to 2.82:
 - Fix typos, whitespace, and character entities.
 - Include property descriptions in the clause about omitting obvious comments.
 - Make file overviews optional.
 - Fix example in "HTML in JSDoc" section.
 - Remove the semicolon-insertion language from the operators section.
 - State that complete sentences are recommended but not required.
 - Document usage of goog.scope to declare new classes.

Update Common Lisp style guide to 1.20:
 - Indicate both variable and function predicates require a "p".
 - Make the abbreviations rules consistent and in one location.
 - Don't allow for the use of &AUX.
 - Allow for "body" and "end" as exceptions to the suffix rule.
 - Use the TODO convention to mark code that needs to be addressed.
 - Remove file maintainership requirements, require a description.
 - Change top-level form requirements to the length of a page.
 - Remove "don't be clever".
2013-07-12 18:53:13 +00:00
mshields@google.com
884f95419f Roll back r105.
https://google-styleguide.googlecode.com/svn-history/r105/trunk/Rguide.xml
does not render as HTML.
2013-07-10 22:38:08 +00:00
mshields@google.com
599832f0a2 Update R style guide to current version. 2013-07-10 22:31:04 +00:00
erg@google.com
02c27fd836 Added cpplint.py output format for eclipse
Patch by mcasas@chromium.org
CR: https://codereview.chromium.org/16140002/
2013-05-28 21:34:34 +00:00
erg@google.com
4d70a88efd Add --root flag used for deriving header guard CPP variable.
By default, the header guard CPP variable is calculated as the relative 
path to the directory that contains .git, .hg, or .svn. When this flag 
is specified, the relative path is calculated from the specified 
directory.

Patch by mazda@chromium.org
CR: https://codereview.appspot.com/8630045/
2013-04-16 21:06:32 +00:00
erg@google.com
5de56f3124 Update google-c-style.el to #33.
Review URL: https://codereview.appspot.com/8717044
2013-04-12 21:15:03 +00:00
mark@chromium.org
8190c132fd Update C++ style guide to 3.245:
- Relax the rule for sizeof(varname) vs. sizeof(type).
 - Allow an exception for nonconst reference parameters where
   convention dictates their use, such as for swap.
 - C++11: allow static_assert.
 - Require non-trivial fall-through between cases in switch
   statements to be annotated. Trivial fall-through includes
   consecutive case labels with no intervening code, and no comment
   is required in these cases.
 - C++11: allow constexpr.
 - Revise the "Integer Types" section to note type-width problems.
 - Clarify that the "arguments on subsequent lines" function call
   style is acceptable even when the 80-column limit doesn't require
   it.
 - Boost: allow part of Polygon.
 - C++11: allow <tuple>.

Update Objective-C style guide to 2.52:
 - Fix ARC example to not imply the use of @private in .m files.
 - Add an example to the "Category Names" section.
 - Require that ARC-using files insert preprocessor directives that
   generate an error when compiling without ARC.
 - Fix spacing around the *s in the ARC example per the C++ style
   guide.

Update Python style guide to 2.48:
 - Allow comments with URLs to exceed 80 characters per line.
 - Update outdated implicit-line-joining URLs.

Update HTML/CSS style guide to 2.21:
 - Consistent use of title case.
 - Add new "Declaration Block Separation" section.
 - Add a CSS example to the "Capitalization" section.
 - Minor fixes to whitespace.

Update JavaScript style to guide to 2.72:
 - Make it clear that the injunction against aliasing namespaces only
   applies to local aliases, not goog.scope.
 - Clarify the style guide's recommendation on array/object literals.
 - Add documentation on @private {type}, @protected {type}, and
   @const {type}.
 - Make JSDoc descriptions required only if not obvious.
 - Clarify that only private properties and methods need a trailing
   underscore.
 - Fix spelling of arv's name.

Update Common Lisp style guide to 1.18:
 - Macro-defining macros are harder to understand for everyone, not
   just for the "uninitiated." There's no need to condescend.

In all of the above style guides:
 - The guide source is now encoded as UTF-8. The numeric character
   references have been replaced with raw UTF-8-encoded characters.
2013-03-21 16:03:26 +00:00
mark@chromium.org
7cf216c976 Initial public release of Shell Style Guide (1.25). 2013-02-15 20:56:05 +00:00
erg@google.com
d350fe561e Updated cpplint.py to #224:
- Better emacs-flymake integration
- Fix false  positives in macros and template parameters
- Improve the wording on the make_pair warning
- Remove virtual keyword checks (now a warning in clang)
- Add checks for namespaces
- Check that DISALLOW_* macros are always in the "private:" section
- Fix false positives for gMock
- Check for alternative boolean operator tokens
- Fix false positives for space on parens
- Fix false positives about placement of "{" near preprocessor macros
- Don't lint inside inlined assembler
- Don't warn on "auto"; it is now a type shortcut, not a storage class
- Don't warn on c++11 for loops
- Warn on empty loop bodies
- Don't warn on unnamed args for the postincrement operator
- Fixes for "<" placement now allowed in c++11
Review URL: https://codereview.appspot.com/7039047
2013-01-14 17:51:48 +00:00
tunes@google.com
ed8e4680ce Google Common Lisp Style Guide, revision 1.17 2012-11-29 00:14:33 +00:00
mark@chromium.org
c8c76a2389 Update C++ style guide to 3.231:
- Clarify that sentence-like non-sentence comments are permitted.
 - Note that older code with incorrect #include ordering should be fixed.
 - Revamp the section on default function arguments.
 - Avoid explicitly recommending Init() methods.
 - C++11: permit "auto".
 - C++11: permit ">>" in place of "> >".
 - C++11: permit range-based "for".
 - C++11: permit variadic macros (already permitted as a C++03 extension).
 - C++11: permit "LL" and "ULL" literal suffixes (already permitted as a C++03
   extension).
 - Reflect the revised copyright and author line policy: copyright notices are
   not required, but license boilerplate may still be used (and generally
   contains a copyright notice). Author lines are not required.
 - C++11: permit new features in <algorithm> and the portion of <numeric> that
   does not require initializer lists.
 - Revise rules on forward declarations: explicitly forbid forward-declared
   functions, do not mandate forward declarations, discourage forward-declared
   templates.
 - Remove the rule requiring "const" qualifiers for member functions to be
   on the same line as the closing parenthesis of the parameter list.
 - Fix typo: "unnamed namespaces."
 - C++11: permit local types as template parameters.
 - Fix typo: "unfamiliar."
 - Relax RTTI rules to permit its use, but warn about its abuse.
 - C++11: permit nullptr and nullptr_t. Revise text referring to NULL to refer
   more generically to null pointers.
 - Remove the "don't go crazy with const" rule.
 - Fix typo: "dir/foo2" should bee "dir2/foo2."
 - Remove reference to a specific GCC version.

Update Objective-C style guide to 2.48:
 - Revise method declaration and invocation formatting rules for long names.
 - Reflect the revised copyright and author line policy: copyright notices are
   not required, but license boilerplate may still be used (and generally
   contains a copyright notice). Author lines are not required. Top-of-file
   comments are not required.
 - Fix dead link in the "nil Checks" section.
 - Cover ARC.
 - Specify that @private is only required for instance variables in header
   files.
 - Permit NSNumber literals.
 - Change the naming convention for instance variables from trailing underscore
   to leading underscore, allowing a wide exception for existing code and
   projects.
 - Fix description of BOOL with respect to its signedness.

Update Python style guide to 2.45:
 - Recommend "pylint: disable" over "pylint: disable-msg."
 - Fix case-sensitive anchor.
 - Provide a better explanation of the problems with catch-all "except:."
 - Permit "map" and "filter" in absence of inlined lambdas.

Update JavaScript style guide to 2.64:
 - Clarify rules for requiring and providing inner dependencies on classes.
 - Clarify semicolons for functions.
 - Note proper namespace and filename casing.
 - Fix typos: "@extends."
 - Permit parentheses to be omitted on unions.
 - Don't require method descriptions when obvious.
 - "in" is a keyword, put it in <code>.
 - New "Aliasing with goog.scope" section.
 - Rewrite the "Constants" section.
 - Remove the recommendation to use join() to build strings.
 - Add the "@expose" annotation.
 - Fix the "@suppress" example.
 - Remove reference alternate cast syntax.
 - Reflect the revised copyright and author line policy: copyright notices are
   not required, but license boilerplate may still be used (and generally
   contains a copyright notice). Author lines are not required.
 - Say that "use strict" is not required.
 - Fix links to "optional" section.
 - Rewrite "JavaScript Types" section.
 - Fix typos: "parameterizes," "converted."
 - Prefer in-constructor field initialization.
 - Add a section on "delete" and null-assignment.
 - Add a note about optional JSDoc comments on enum values.
 - State explicitly that dot operators belong at the ends of lines.
 - Add "@dict" and "@struct" annotations.
 - Add links to the JavaScript Types section.
 - Require (rather than encourage) compiling.

Update HTML/CSS style guide to 2.19:
 - Rephrased quotation guidelines.
 - Updated W3C I18N article reference.
 - Fixed revision number.

Update styleguide.xsl to 1.34:
 - Fix error in RefreshVisibilityFromHashParam when a URL fragment points to a
   named anchor within a section, as used by the JavaScript style guide.
2012-11-28 20:26:27 +00:00
tunes@google.com
1407ba71db Google Common Lisp Style Guide, revision 1.16 2012-11-08 04:31:59 +00:00
tunes@google.com
c55433cd2e Google Common Lisp Style Guide, revision 1.15 2012-10-17 22:13:51 +00:00
tunes@google.com
13bb6e417a Google Common Lisp Style Guide updated to 1.13. 2012-10-15 20:57:01 +00:00
tunes@google.com
f981c5c266 Google Common Lisp Style Guide, revision 1.12 2012-10-14 13:47:38 +00:00
tunes@google.com
8c4c5ce85d Google Common Lisp Style Guide updated to 1.11. 2012-10-12 23:16:43 +00:00
tunes@google.com
0c584cb624 Google Common Lisp Style Guide updated to 1.10,
integrating more feedback from inside and outside Google.
2012-10-11 17:06:57 +00:00
tunes@google.com
8dba399b33 Manually add stylesheet information (for now) to lispguide.xml. 2012-10-10 19:10:55 +00:00
tunes@google.com
b1e92038c5 Publish the Google Common Lisp Style Guide, revision 1.8, for public review. 2012-10-10 18:50:04 +00:00
apicard@google.com
424ad34281 Updating python style guide 2012-09-18 23:16:02 +00:00
jensmeiert@google.com
864b0dc238 Adding back style sheet link (dropped after file re-generation). 2012-07-17 20:17:21 +00:00
jensmeiert@google.com
1e1b50bf73 Sync. 2012-07-17 20:12:10 +00:00
mark@chromium.org
ded2b0a246 Add Google C++ Eclipse style config.
Patch by Alexei Svitkine <asvitkine@chromium.org>

Review URL: https://codereview.appspot.com/6353053/
2012-06-29 19:26:15 +00:00
erg@google.com
720121a67f Changed the hashband on cpplint.py 2012-05-11 16:31:47 +00:00
jensmeiert@google.com
a1cc738256 Updated validator reference. 2012-04-26 16:30:28 +00:00
jensmeiert@google.com
dc19d7e225 Initial release 2012-04-24 22:21:00 +00:00
erg@google.com
90ecb62a9f Convert windows path seperators to unix like while doing IncludeWhatYouUse.
Review URL: https://codereview.appspot.com/5601049
2012-01-30 19:34:23 +00:00
erg@google.com
dc28970e18 Improve the error message for when #ifndef guards don't match the #define.
Patch from <csharp@google.com>
2012-01-26 20:30:03 +00:00
erg@google.com
3dc7426aed Support svn 1.7 directory structure.
Committing on behalf of Reid Kleckner <rnk@google.com>.
BUG=chromium:102890
2011-11-30 01:12:00 +00:00
mark@chromium.org
7f8919375d Update JavaScript style guide to 2.28:
- Fix typo.

Update Python style guide to 2.29:
 - Fix indirect setter.
2011-11-04 21:13:33 +00:00
mark@chromium.org
e33361fcd3 Update C++ style guide to 3.199:
- Update an example to omit the blank line between C and C++ #includes.
 - Rewrite the paragraph about #include ordering.
 - Clarify namespace closing comments.
 - Discourage const references for input arguments which are aliased beyond
   the scope of the function call.
 - Replace all '&' with '&amp;'.
 - Clarify that interfaces must have virtual destructors.
 - Add an explicit example for |else if|.
 - C++11 updates.

Update Objective-C style guide to 2.36:
 - Remove requirement to list @dynamic implementations.
 - Remove requirement to never synthesize CFType properties, since they may
   be retained on 10.6.
 - Use __weak and __strong type declaration modifiers rather than comments.
 - Make the copyright/license information consistent.
 - An example initializer comment revealed too much about the implementation.
 - Correct spelling mistakes.
 - Fix names that didn't follow Cocoa conventions.
 - Fix examples to conform to style.
 - Add a section about no braces for empty interfaces.
 - Add a section about automatically synthesized instance variables.
 - Codify avoidance of accessors in -init and -dealloc methods.
 - Changes for the 80-column rule.
 - Weaken the language around object ownership type qualifiers.
 - Document the rules for formatting blocks.

Update JavaScript style guide to 2.27:
 - Introduce EcmaScript 5 Strict verbiage.
 - Add a note about private constructors.
 - Simplify explanations about JSDoc comments.
 - Sort the JSDoc tags.
 - Remove the sections about type-checking now that the JSDoc tags and JS
   types are no longer one table.
 - Convert <tt> to <code>, because the XSL processor eats <tt>.
 - Add @suppress.
 - Mark @inheritDoc deprecated in favor of @override.
 - Add a section about inner classes and enums being defined in the same file
   as the top-level class they are defined on.

Update Python style guide to 2.28:
 - Change "Naming" summary to match body.
 - Make the prohibition against backslash line continuation explicit.
 - Update the TODO section to match the C++ style guide.
 - Declare Python code without a shebang line to be stylish.
 - Clarify rules on function docstrings.
 - Fix spelling errors.
 - Update with styleguide.xsl 1.33.

Update styleguide.xsl to 1.33:
 - Clean up style guide JS.
 - Links to anchor tags auto-expand.
2011-11-04 16:55:22 +00:00
erg@google.com
8a95ecca27 Update to #179:
- Suggest "const_cast" when encountering "(char*)".
- Warn on template arguments to make_pair().
- Require <utility> if pair<> is seen now that <map> doesn't include it.
- Warn on lack of "explicit" keyword on single argument inline constructors.
- Better check for hanging ')' when closing function calls.
- Don't warn on: 'int v[1][3] = {{1, 2, 3}};'
- Allow function calls as the first argument to printf().
Review URL: http://codereview.appspot.com/4974066
2011-09-08 00:45:54 +00:00