Commit Graph

65 Commits

Author SHA1 Message Date
erg@google.com
efeacdf0fa Add extension mechanisms for custom checks to cpplint.py.
This allows users of cpplint.py to specify additional check functions.

Will be used by: http://codereview.chromium.org/7834045/

Review URL: http://codereview.appspot.com/4950069
Patch from Alexei Svitkine <asvitkine@chromium.org>.
2011-09-07 21:12:16 +00:00
erg@google.com
d7d2747c6c Update cpplint.py to #161:
- ostream should be treated as a system header
- Expand the MockCallback whitelist entry for gMock.
- Virtual destructor check shouldn't get confused with
  "class EXPORT ClassName {" constructs.
- Don't warn about the length of "$ Id: ... $" lines.
- Better semicolon checks in for() loops.
- Better whitespace comment checks.
Review URL: http://codereview.appspot.com/4964064
2011-09-07 17:36:35 +00:00
erg@google.com
8f91ab2835 Reverted r70, at asvitkine's request 2011-09-06 21:04:45 +00:00
erg@google.com
5210aec6df Upstream useful lint check from WebKit's fork of cpplint.py.
Checks against "Foo *bar" and "Foo &bar" declarations.

WebKit patch was: http://trac.webkit.org/changeset/46856

Credit Torch Mobile, Inc. who have contributed the WebKit patch in question.

Patch committed for asvitkine@chromium.org.
2011-09-06 20:19:05 +00:00
simonstewart@google.com
0249a38579 Adding config files for formatting for IntelliJ and Eclipse 2011-08-30 11:23:49 +00:00
mmentovai
cd4ce0fff0 Update C++ style guide to 3.188:
- Revise "Smart Pointers" section.
 - Clarify that it's OK to have spaces after '#' in a preprocessor directive,
   even though '#' itself must not be indented.
 - Revise "TODO Comments" section.
 - Fix wording.
 - Explicitly recommend foo.h be the first file #included by foo_test.cc.

Update Objective-C style guide to 2.24:
 - Clarify the spacing of @property declarations.
 - Add "Overridden NSObject Method Placement" section.
 - Explicitly permit blank lines around @interface, @implementation, and @end.

Update JavaScript style guide to 2.20:
 - Provide additional guidance with respect to the compiler.
 - Add {function(new:Type)} as a type syntax for constructors of Type.
 - Revise "Method and Function Comments" section.
 - Harmonize text and example in the "Passing Anonymous Functions" section.
 - Explicitly state that @param and @return types must be enclosed in braces.
 - Add documentation on the UNKNOWN type.
 - Replace a CODE_SNIPPET with BAD_CODE_SNIPPET in the "Internet Explorer's
   Conditional Comments" section.
 - Remove a redundant "Expand for more information" in the "Naming" section
   and fully spell out "information" in the "Code Formatting" section.
 - Provide a positive example in the "Multiline string literals" section.
 - Provide guidance for indentation within nested functions.

Update Python style guide to 2.20:
 - Clarify shebang rule.
2011-03-29 20:30:47 +00:00
mshields@google.com
222e6da82a New file google_python_style.vim. 2010-11-29 20:32:06 +00:00
mmentovai
7f003d3547 Update JavaScript style guide to 2.11:
- Fix r62, which was applied incorrectly.
2010-11-23 21:09:55 +00:00
mmentovai
db989ec08f Update C++ style guide to 3.180:
- Remove comment about naming macros like enums.
 - Move a bad code snippet from a CODE_SNIPPET to a BAD_CODE_SNIPPET element.

Update Python style guide to 2.18:
 - Clarify the syntax for import statements.

Update styleguide.xsl to 1.31:
 - Substitute underscore for apostrophe in anchor names.
2010-11-23 18:02:36 +00:00
erg@google.com
a51c16b542 Allow blank Doxygen-style comments. Patch by mball@google.com. 2010-11-17 18:09:31 +00:00
erg@google.com
f550116b81 Fix wrong number of braces.
Thanks to wdscxsj@gmail.com for pointing this out.
2010-10-21 17:20:05 +00:00
mmentovai
ce4da30bb9 Update C++ style guide to 3.178:
- Fix grammatical and spelling errors, and revise awkward phrasing.
2010-10-14 15:54:08 +00:00
mmentovai
7d78fd4e6a Update C++ style guide to 3.175:
- Fix typo.
2010-10-08 18:35:59 +00:00
erg@google.com
42e59b0ce7 Project prefix directory should work with Hg.
Patch based on one by tomic80.
2010-10-04 22:18:07 +00:00
mmentovai
7ead64485b Update C++ style guide to 3.174:
- Add leading blank line exception.
 - Improve guidance for function definition comments.
 - Tweak class comment example to not violate type naming guidelines.

Update Objective-C style guide to 2.21:
 - Prohibit +new.

Update JavaScript style guide to 2.9:
 - Add new "Function Declarations Within Blocks" section.
 - Add new "Internet Explorer's Conditional Comments" section.
 - Add new "Alias long type names to improve readability" section.
 - Add @lends.
2010-10-04 16:26:53 +00:00
mmentovai
b729e3cfe3 Update C++ style guide to 3.171:
- Add a section to specify deprecation comments.
2010-08-10 18:40:41 +00:00
mmentovai
b6870cb5db Update C++ style guide to 3.170:
- Allow overloading a function judiciously.
 - _unittest and _regtest are deprecated.
 - Document C++0x policy.
 - Allow namespace aliases in .h files when inside namespaces.
 - Give examples for and against parentheses with return.
 - Update set of allowed Boost headers.
 - Add a caveat to the forward-declaration section, mentioning impicit
   constructors.
2010-08-05 00:39:32 +00:00
mmentovai
8411f0c651 Update Python style guide with styleguide.xsl r51. 2010-08-04 17:46:16 +00:00
mmentovai
b2ad010f74 Update JavaScript style guide to 2.3:
- Clarify the semantics of @private and @protected, in particular how they
   differ from the expectations of users of C++ and Java.
2010-08-04 17:43:38 +00:00
mmentovai
4d50302d0e Update Objective-C style guide to 2.20:
- Allow dot notation for simple property access.
 - Clarify spacing around category definitions and parameters that take
   protocols.
2010-08-04 17:39:00 +00:00
robbyw@google.com
bb32401998 Added JavaScript style guide 2010-07-12 22:02:20 +00:00
robbyw@google.com
52f62a450b Update look and feel of the style guides 2010-07-12 21:58:39 +00:00
mmentovai
e5aeb8fb72 Update C++ style guide to 3.161:
- Forbid the use of operator synonyms such as "and."
 - Specify the naming convention (OrDie) to use when a function has
   crash-on-failure semantics.
 - Allow static const data members to be non-private.
 - Specify placement of friend declarations.
 - Require each file to include headers that they use.

Update Objective-C style guide to 2.18:
 - Prefer @optional to informal protocols when possible.
 - Specify formatting for invoking methods.
 - Require that -dealloc be easy to review.
2010-05-12 16:52:16 +00:00
erg+personal@google.com
0518964d22 Update cpplint.py to #150:
- Be explicit about "class Foo :\n public Bar" being wrong.
- Allow snprintf(NULL, 0, ...) pattern.
- Extend NOLINT syntax.
- Remove NOLINT hint.
- <new> is an STL header.
- Use original filename for header guard when invoked by flymake.
- Avoid false-positive build/include_what_you_use errors for use
  of classes called "string" other than STL ones.

Review URL: http://codereview.chromium.org/1697023
2010-04-30 20:43:03 +00:00
monsur
2d29e83ea3 Adding licensing footer 2010-03-08 18:32:48 +00:00
monsur
8643ca8da7 Grammatical updates to JSON-C Style Guide. New CSS for HTML version of JSON-C Style Guide. 2010-02-25 18:45:27 +00:00
monsur
233b48fc74 Adding an HTML version of the JSON-C Style Guide 2010-02-24 15:52:50 +00:00
monsur
f07658c730 Adding first iteration of the JSON-C Style Guide for JSON APIs 2010-02-22 22:39:56 +00:00
erg@google.com
5e1696994b Check for mercurial checkouts in addition to svn and git.
Patch by Florian Loitsch <floitsch@google.com>
2010-01-28 20:17:01 +00:00
mmentovai
9ec7bd6269 Update C++ style guide to 3.154:
- Add call_traits to the set of allowed boost libraries.
 - Add an exception to the rule against default arguments to cover the useful
   case of simulating variadic functions.
 - Discourage the usage of ## in macros.
 - Clarify example: it's acceptable to declare two parameters on one line even
   if they don't all fit on that one line.
 - Fix a typo ("make use symmetric spacing").
 - Change bitwise AND to logical AND in a condition.

Update styleguide.xsl to 1.27:
 - Change a bunch of SPANs into DIVs.

Update Python style guide to 2.15:
 - Apply styleguide.xsl 1.27, changing a bunch of SPANs into DIVs.
2009-12-03 22:25:38 +00:00
mmentovai
f7facf9026 Update C++ style guide to 3.146:
- Make the messaging on DISALLOW_EVIL_CONSTRUCTORS more clear that we should
   not be rewriting old code but should simply prefer DISALLOW_COPY_AND_ASSIGN
   on new code.
 - s/Initializer Lists/Constructor Initializer Lists/ since people search for
   this based on knowing it's part of the constructor, but forget the precise
   name.
 - Allow data members in a test fixture to be private.
 - Loosen restrictions on globals.
 - Add explicit guideline for nested namespace formatting.
 - Strengthen the prohibition against operator overloading for operator&.
 - Add recommendation for "_" over "-" in file names.
 - Revise the "Copy Constructors" section for brevity and clarity.  Emphasize
   preference for standard over nonstandard copy operations.
 - Weaken the wording at the top of the "Doing Work in Constructors" section,
   making it clear that Init() methods are not absolutely required for
   non-trivial initialization.
 - Fix minor typos and grammatical errors.

Update Objective-C style guide to 2.14:
 - Add the Rule of Four for indenting parameters.  Allow either of two forms
   for formatting methods with short first keywords.
 - Update the guidance on BOOL vs. bool.
 - Whitespace cleanup.

Update Python style guide to 2.14:
 - Consolidate discussion of the string module, apply, map, filter, and reduce
   into a single section.
 - Make it explicit that functions and classes can be nested inside methods.
2009-10-23 21:01:49 +00:00
erg@google.com
2df72b34d0 Update google-c-style.el to #6:
- Deal with if/for/while better in multi-line expressions.
2009-10-09 21:51:56 +00:00
erg@google.com
a868d2d725 Update cpplint.py to #131:
- Optional check to make sure #includes are in alphabetical order.
- Optional "--counting=" option for statistics on what errors were found.
- Fix typos.
- Warn on overloading the unary operator&(). (Binary operator&() is fine).
- Fix false positives on "new int(x)"; it is not a cast.
- Allow "NOLINT" on header guards.
- Prevent members of a class from being "const string&".
2009-10-09 21:18:45 +00:00
erg@google.com
21a495826e Update google-c-style.el to #4:
- Deal with case where the previous line ends with an open parenthesis.
2009-08-03 21:00:44 +00:00
apicard@google.com
9d234080c5 M pyguide.html 2009-07-23 20:29:34 +00:00
apicard@google.com
7dbc495a6c M pyguide.html 2009-07-23 20:19:09 +00:00
apicard@google.com
f900c2c70d A pyguide.html 2009-07-23 20:09:56 +00:00
samantharachelcook
169ed434f1 2009-07-21 18:07:18 +00:00
samantharachelcook
192968e372 2009-07-21 17:04:05 +00:00
samantharachelcook
1b525a42ee 2009-07-21 17:03:50 +00:00
samantharachelcook
1a0b9ae389 2009-07-21 17:03:20 +00:00
samantharachelcook
ab4e2d3b76 2009-07-21 17:02:48 +00:00
samantharachelcook
30c24cfa1e 2009-07-21 17:00:03 +00:00
samantharachelcook
9d49a55abb 2009-07-21 16:59:42 +00:00
samantharachelcook
46635c97a8 2009-07-21 16:56:19 +00:00
erg@google.com
969161cb78 Relicense cpplint under 3 clause BSD for webkit folks.
Review URL: http://codereview.chromium.org/147238
2009-06-26 22:06:46 +00:00
erg@google.com
e35f765fa6 Update cpplint.py to #122:
- Don't check quoted filenames with irrelevant tests.
- Make cpplint accept 'for (foo; bar; ) {}'.
- Work with temporary files generated by Emacs flymake-mode.
- Don't warn on "/// Doxygen comments."
- Check the use of DCHECK in the same way we check the use of CHECK.
- Properly handle relative file paths with IncludeWhatYouUse checking.
- Start checking for IncludeWhatYouUse in a limited way in .cc files.
2009-06-19 20:52:09 +00:00
mmentovai
a764d2becf Update Objective-C style guide to 2.12:
- Refer to the correct section on avoiding exceptions
2009-04-17 17:48:25 +00:00
mmentovai
71619d34e3 Update C++ style guide to 3.133:
- Clarify that a "very strong convention" is, in fact, only very strong
   within Google code
 - Update the style guide with an additional naming possibility for enums:
   kEnumName
 - Reword the summary for the section on header file dependencies
 - Simplify wording regarding static variables

Update Objective-C style guide to 2.11:
 - Provide guidance on when to use #import and #include
 - Display revision in style guide

Update styleguide.xsl with a hint of things to come

Set svn:eol-style on xmlstyle.html
2009-03-25 22:24:14 +00:00
erg@google.com
3664910272 Update cpplint.py to #114:
- Prevent invalid increment constructs
- Allow long URLs in lines without hitting the 80 char limit
- Prevent false positives of "Extra space after ( in function call" in macro definitions.
2009-03-25 21:18:36 +00:00