Commit Graph

273 Commits

Author SHA1 Message Date
Piotr Semenov
af8c84341d Merge branch 'semenovp_fixes' of https://github.com/piotr-semenov/styleguide into semenovp_fixes 2016-06-30 11:47:22 +03:00
Piotr Semenov
a3c36d93d2 [FEATURE] Adds the unit-test for case "NOLINT, NOLINTNEXTLINE works for };". 2016-06-30 11:45:37 +03:00
Piotr Semenov
b7e2ef6de2 [FIX] Bug: NOLINT, NOLINTNEXTLINE has no effect for "};". 2016-06-30 11:44:21 +03:00
Michael Diamond
c938dbaa4d Updated Java Style Guide to reflect current internal version. 2016-06-29 19:36:05 -04:00
Alan Yee
b4e1659acd Update shebang line
This shebang line is more portable, as the user may not have python installed in /usr/local/bin/python. Also, according to PEP 486, the line makes the Python Launcher aware of virtual environments.
2016-06-24 15:53:24 -07:00
Milan Lempera
0cb4617e4c fix links to Javascript guide 2016-06-22 12:45:58 +02:00
Sergey Sharybin
3b0ea894c1 Fix regex escape issue when using --root on Windows
The code was using directory separator in the regex itself,
which means on Windows it was leaving unescaped backslash.

Added explicit escape for such cases.
2016-05-31 00:21:14 +02:00
Piotr Semenov
f2ced939eb [FIX] Bug: NOLINT, NOLINTNEXTLINE has no effect if used for the closing-brace line "};" in the lambda declaration. 2016-05-20 18:39:34 +03:00
Alexander F Rødseth
7ebdcc4f94 Fix broken link
The link the bottom of https://google.github.io/styleguide/shell.xml is
broken. When changing from cppguide.xml to cppguide.html, it works.

Also cleaned up trailing whitespace.
2016-05-19 23:04:17 +02:00
Andrew Bonventre
70d6b7d4b8 Merge pull request #116 from Dominator008/javascript
Remove trailing whitespaces and a false claim in the JavaScript Style Guide
2016-05-17 14:51:17 -07:00
Elliot Glaysher
66718b1d33 Merge pull request #130 from alexv1n/uprev-cpplint
Update cpplint.py to r456
2016-05-06 15:56:52 -07:00
Alex Vakulenko
01e47236c8 Update cpplint.py to r456
456 - Tweak lint to sometimes allow { on line following array initialization.
455 - Recognize more types.
454 - Try a bit harder to detect templated types.
453 - Changed error message wording on build/storage_class to be less ambiguous.
452 - Recognize more types to silence false positives for brace warnings.
451 - <skipped>
450 - <skipped>
449 - Ignore whitespace/tab for Linux Kernel files.
448 - Remove some more false positive lint warnings for int64{n}.
447 - Just one warning message for line length is enough, don't need two.
446 - Allow braced conversions to int16, uint64, etc. per the style guide.
445 - Fixed handling of backslash escapes for checking whether a "//" is quoted.
444 - Reduced dependency on hardcoded .cc extension.
443 - Disable single-arg constructor checks by default, since ClangTidy has the
      same check. We could just delete the check entirely, but it's slightly
      useful in places that can't run ClangTidy.
442 - Fix matching of macro names in CheckTrailingSemicolon to include digits.
441 - Deleted checks:
      - All checks for RValue references.
      - Spacing check around boolean &&, because those look like RValue
        references.
      A huge amount of code and effort were dedicated to tell RValue
      references apart from boolean expressions, and to differentiate
      allowed versus banned RValue references. But we still get regular
      false positives from this one check. Rather than making the check
      more complex than what it already is, it seemed safer to just delete
      it altogether for now, and have a different process for catching
      RValue references.
440 - Add rule to cpplint to throw error on empty if statement bodies without
      else clauses. If statement bodies with comments are not considered empty.
439 - Allow spaces before closing brace of namespace block so that namespaces
      inside of macro definitions (where the entire macro definition is
      indented) are not treated as errors.
438 - cpplint: fix a false positive on `new const int(x)`.
437 - Only check for function length when current line is inside a function.
436 - cpplint: Catch static `std::string` instances as well as those written as
      `string`. Previously users would sometimes work around the lint warning by
      changing their code to even worse code by adding the "std::" prefix.
435 - cpplint: Be a little smarter about warning on indentation.
434 - cpplint: Remove false positives on some functions returning string const&.
433 - cpplint: improve diagnostics of global/static string objects.
432 - Allow non-const reference parameters for iostream based types.
431 - Better handling of raw strings inside comments.
430 - <noop>
429 - <skipped>
428 - <skipped>
427 - Add support to CHECK_NOTNULL when checking if a member variable is
      initialized with itself.
426 - Allow suppressing specific warnings in C headers.
425 - Allow spaces before parens for inline assembly.
424 - Remove lint checks for {EXPECT,ASSERT}_.*_M.
423 - Allow comment lines of more than 80 characters if they contain a single
      "word" (without any spaces).
422 - cpplint: Warn on inclusion of C++14 headers.
421 - cpplint: recognize <shared_mutex> as a standard library header.
420 - Add <scoped_allocator> to cpplint's list of C++ standard headers.
419 - Add cpplint check for tr1/ headers. We removed the nanny guards for these
418 - <skipped>
417 - Update the styleguide and cpplint to allow unnamed parameters
416 - Remove the rule explicitly banning non-default move operations.
415 - Remove the check for explicit multi arg constructors
414 - Include clarity of lambda default captures in "pros" section, mention
      of capturing `this` and lambdas which escape the current scope in "cons".
      Soften the ban on default captures to a preference, with admonition against
      using them for capturing `this` or when they will escape the current scope.
      This is a fairly straightforward change with a brief inclusion
      of 2 problematic cases for implicit capture. As this is the style
      guide, I'm not sure how much more detail is appropriate.
413 - Fixed a bug by making regex in CleanseRawStrings match multiple raw strings
      on a single line in left-to-right order.
412 - Fixed false positive for classes derived using decltype()
411 - <skipped>
410 - Recognize '1LL<<20' as numeric and don't flag it for spacing.
2016-05-06 14:10:17 -07:00
Fabian Guera
2322e4ffaa
Make "root" flag configurable via CPPLINT.CFG 2016-05-01 17:36:30 +02:00
Geoff Romer
175866f6c4 Merge pull request #128 from wieczorek1990/gh-pages
Reverted XML namespace name changes
2016-04-28 12:50:28 -07:00
Łukasz Wieczorek
6f37bdf200 Reverted XML namespace name changes 2016-04-28 19:25:32 +02:00
Geoff Romer
8a3b573abb Merge pull request #118 from herrniemand/gh-pages
Replaced HTTP where HTTPS was available
2016-04-27 10:34:29 -07:00
Ackermann Yuriy
b545d7f67f Reverted to non-markdown and applyed HTTPS fix. 2016-04-27 14:06:21 +12:00
Ackermann Yuriy
7969290bac Replaced HTTP where HTTPS been awailable. 2016-04-01 21:41:34 +13:00
Ackermann Yuriy
acb4f9016f Removed link shortening. 2016-04-01 21:36:44 +13:00
Michael Zhou
d6fddbbf3e Remove a false claim about multi-line strings
The claim that multi-line strings are not part of ECMAScript is
false. See the "LineContinuation" production in:
http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.4.

Removed the false claim.
2016-03-28 15:06:44 -04:00
Michael Zhou
3c3c96b2c3 Remove trailing whitespaces in JavaScript Style Guide 2016-03-28 15:05:44 -04:00
Titus Winters
8c09ccf840 Merge pull request #106 from alanyee/patch-1
Grammar fix
2016-03-02 08:16:31 -05:00
Alan Yee
04b42100ea Grammar fix
Replaced "less" with "fewer"
2016-03-01 13:49:01 -08:00
Titus Winters
b43afc71a5 Merge pull request #91 from zettca/patch-1
Fix links to C++ guide
2016-02-16 12:00:00 -05:00
Titus Winters
842ac63548 Merge pull request #105 from erictleung/add-license-logo-and-format-readme
Reflow README to 80 characters & add license logo
2016-02-16 10:42:35 -05:00
Eric Leung
5ec31fe134 Reflow README to 80 characters & add license logo 2016-02-16 07:10:34 -08:00
Andrew Bonventre
2a576b1397 Merge pull request #101 from Lambdac0re/patch-1
Fixed Wikipedia link
2016-01-18 14:51:37 -05:00
Lambdac0re
ef3245788c Fixed Wikipedia link
The paragraph was renamed
2016-01-18 20:38:21 +01:00
Mark Mentovai
7a179d1ac2 Merge pull request #99 from tituswinters/gh-pages
Update to current.
2016-01-06 16:49:00 -05:00
Titus Winters
0124f309e4 Update to current.
Most significant updates:
* Casting (for arithmetic types, maybe use {}s)
* Namespaces
* Aliases
2016-01-06 16:09:22 -05:00
Mark Mentovai
14ab228ab6 Restore missing newline 2016-01-04 10:49:37 -05:00
Bruno Henriques
57cd3410f9 Fix links to C++ guide 2015-11-27 18:12:52 +00:00
Andrew Bonventre
e1333014b5 Merge pull request #63 from erictleung/gh-pages
Update README.md with R Style Guide
2015-11-01 09:44:45 -05:00
Andrew Bonventre
162db3d5aa Merge pull request #85 from frp/gh-pages
Fix links in C++ guide to point to GitHub
2015-11-01 09:43:29 -05:00
Roman Franchuk
7e0bcd7e29 Fix links in C++ guide to point to GitHub
The links were pointing to googlecode.com. Two of them resulted in "404
Not Found", one resulted in the message "the project is moved".
2015-11-01 12:52:05 +02:00
Nodir Turakulov
2bfe5f4aa8 Merge pull request #76 from dirk-thomas/patch-1
Update link to point to github instead of googlecode
2015-10-13 16:18:28 -07:00
Dirk Thomas
79ea3810bb update link to point to github instead of googlecode 2015-10-13 15:58:53 -07:00
Geoff Romer
3591b2e540 Update C++ Style Guide to 4.177. 2015-09-11 15:09:00 -07:00
Nodir Turakulov
294c447974 Fix unclear line limit
Fixes #67
2015-09-03 19:04:20 -07:00
Nodir Turakulov
edccafae5a Google Documentation Guide
Includes Markdown Style Guide
See docguide/README.md
2015-08-31 11:37:09 -07:00
Eric Leung
e0432d43d2 Update README.md with R Style Guide 2015-08-08 14:26:37 -07:00
Elliot Glaysher
43d738ab8b Update README.md to link to the served versions of all the pages. 2015-05-20 15:29:26 -07:00
Elliot Glaysher
51ce2f4117 Create README.md
Copy the current blurb from https://code.google.com/p/google-styleguide/ into a README.md as a first step.
2015-05-20 12:28:50 -07:00
avakulenko@google.com
554223dc54 Update cpplint.py to #409
409 - Fixed false positive for access-specifier used with virtual in inheritance.
408 - Fixed false positive in determining rvalue parameter types for functions
      whose return type is on the previous line.
407 - Allow different include sections to be separated by anything other than
      #include.
406 - Disable readability/streams warnings in cpplint, to reflect style guide
      changes.
405 - Fixed false positive for whitespace checks with CUDA code.
404 - Do not issue cpplint warnings for use of Doxygen-style comments.
403 - Allow RValue types that were listed in template-argument-list.
      Fixed handling of RValue types after pointer parameters.
402 - Change the style guide to allow std::forward and associated use of rvalue
      references.
401 - Fixed cpplint crash when checking header guards for filenames containing
      meta characters.
400 - Fixed false positive for alignas() used with anonymous struct or union.
399 - Fixed false positive for template function calls with braced constructor.
398 - Allow #endif header guard comments to use "/**/" style if there are no
      "//" comments in the same file.
397 - Fixed false positives for DISALLOW macro check position check.
396 - Don't treat lambda functions with return value syntax as casts.
395 - <skipped>
394 - Fixed RValue references for out-of-line inner class constructor
      declarations.
393 - Fixed false positive for redundant override/final by ignoring declarators.
392 - Fixed false positive for taking address of a function pointer return value
      being recognized as taking address of a cast.
391 - Version of cpplint that fixes the spacing around the '=' operator.
390 - <skipped>
389 - Don't warn on non-const reference arguments of out-of-line method
      definitions.
388 - Fixed false positive for "virtual" from virtual base class be interpreted
      as virtual member function.

R=erg@google.com

Review URL: https://codereview.appspot.com/184990043
2014-12-04 22:00:20 +00:00
dbarnett@google.com
4052f397d9 Fix typo in vimscriptfull guide: addmatch->matchadd 2014-11-15 02:14:20 +00:00
erg@google.com
a8999a616f Add autoload magic comments for the functions exposed by google-c-style.
This should make packaged versions of google-c-style (like from MELPA)
provide the symbols without doing explicit 'require.

Patch by Kimmo Kinnunen <kkinnunen@nvidia.com>.
2014-09-29 18:18:46 +00:00
mark@chromium.org
3ed10fb207 Update C++ style guide to 4.45.
Much of the guide has been refactored, rewritten, and revised.
2014-09-08 17:01:51 +00:00
avakulenko@google.com
310681b865 Added support for 'linelength' setting in CPPLINT.cfg
It is now possible to override the line length per project
by usign 'linelength' setting in CPPLINT.cfg.

R=erg@google.com

Review URL: https://codereview.appspot.com/132050043
2014-08-22 19:38:55 +00:00
avakulenko@google.com
a8ee7eaaa4 Update cpplint.py to #387:
387 - Allow lint warnings on the next line to be suppressed with NOLINTNEXTLINE.
386 - Fixed false positive for strcat and strcpy.
385 - Fixed false positive for bitwise and on last line of a multi-line
384 - Remove unused deprecated testing/base/googletest.h header.
383 - Fixed false positive for bitwise and on last line of a multi-line
      initializer list that ends with closing brace on the same line.
382 - Allow header guard warning to be silenced with
      "// NOLINT(build/header_guard)" comment.
381 - Removed check for spaces between "//" and "TODO".
380 - Fix typo: Redudnant -> Redundant
379 - Added check for redundant "virtual" and "override" function-specifier.
378 - Updated missing "explicit" message to match style guide wording
377 - Add cpplint check to prevent .cc file inclusions from other packages.
      These are generally bad and we should prevent regressions like this until
      proper BUILD layering checks are in place.
376 - Silence missing braces warning for conditional statements inside lambdas.
375 - Warn about multi-arg constructors being explicit only at highest severity
      level.
374 - Warn about non-single-argument constructors marked explicit.
373 - Exclude 'case' from function spacing check.
372 - Exclude third party headers such as Python.h from these checks:
371 - Fixed false positive for function pointer parameters followed by other
      parameters.
370 - Allow RValue reference for default inline constructor.
369 - Fixed false positive for array of references and operator,().
368 - Silence named parameter warning for macros.
367 - Fixed false positive for duplicate header warning across preprocessor
      boundaries.
366 - Allow rvalue references for constructors and assignment operator.
365 - Stop handling DISALLOW_EVIL_CONSTRUCTORS in cpplint.py,
      since it's going away.
364 - Fixed false positive for member function in nested classes.
363 - Namespace indentation for cpplint. The C++ style guide enforced that items
      within a namespace do not receive an extra level of indentation.
362 - Fixed false positive for multi-line member functions returning strings.
361 - Do not suggest replacement CHECK macros if custom error messages are used.
360 - Silence nonconst reference warning for multiline derived functions.
359 - Silence non-const reference warnings for derived functions.
358 - Added link to developer guide.
357 - Remove the partial ban on std::move and related features. More general
356 - Fixed false positive for << inside macros.
355 - Make _NestingState class public.
354 - Fixed false positive for multiline function templates.
353 - Fixed false positive for lambda capture.
352 - Silence RValue reference warnings that are enclosed in a
351 - Do not warn on CR-LF lines if all input lines are uniformly CR-LF.
350 - Tweaked the error messages for static mutex with default constructors.
349 - Fixed false positive for unnamed parameters in macros.
348 - Recognize &&... as RValue references.
347 - Use alternative error message for including <ostream>.
346 - Fixed false positive for function style template argument.
345 - Fixed false positive for braced constructor call inside brackets.
344 - Minor spelling and grammar fix.
343 - Fixed false positive for non-const reference check inside constructor
342 - Fixed cases where rvalue references are not identified correctly:
341 - Check that third party header files have some header guard, but do not
340 - Don't check header guards in third party files.
339 - Instead of treating thread annotations as macro function calls, skip over
      them in parsing function signatures.  This silences false positives for
      lambdas with thread annotations.
338 - Fixed false positive for deprecated cast where return type of function
337 - Fixed false positive for alias-declarations of function pointers.
336 - Improved error message for taking address of something dereferenced
335 - Added support for C++14 digit separators.
334 - Silence long line warnings for JNI.
333 - Fixed false positive for constructor calls for rand{} being
332 - Elide C++11 raw strings as an empty quoted string instead of
331 - Split up long functions in cpplint.py and cpplint_unittest.py
330 - Fixed false positive for missing space check around "using operator;"
329 - Fixed false positive for indent check around multi-line raw strings.

R=erg@google.com

Review URL: https://codereview.appspot.com/125980043
2014-08-11 19:41:35 +00:00
erg@google.com
7430eefe76 Modify cpplint.py to allow CPPLINT.cfg overrides
Added the ability to provide CPPLINT.cfg files to provide
linter message filters per sub-directory and special exclusion
rules. Each file can have instructions like:

filter=-build/include_order,+build/include_alpha
exclude_files=.*\.cc

The above disables build/include_order warning and enables
build/include_alpha as well as excludes all .cc from being
processed by linter, in the current directory (where the .cfg
file is located) and all sub-directories.

Patch by avakulenko@google.com.
Related CL: https://codereview.chromium.org/406373002/

Review URL: https://codereview.appspot.com/115340043
2014-07-28 22:33:46 +00:00