Git Product home page Git Product logo

styleguide's Introduction

Google Style Guides

Every major open-source project has its own style guide: a set of conventions (sometimes arbitrary) about how to write code for that project. It is much easier to understand a large codebase when all the code in it is in a consistent style.

“Style” covers a lot of ground, from “use camelCase for variable names” to “never use global variables” to “never use exceptions.” This project (google/styleguide) links to the style guidelines we use for Google code. If you are modifying a project that originated at Google, you may be pointed to this page to see the style guides that apply to that project.

This project also contains cpplint, a tool to assist with style guide compliance, and google-c-style.el, an Emacs settings file for Google style.

If your project requires that you create a new XML document format, the XML Document Format Style Guide may be helpful. In addition to actual style rules, it also contains advice on designing your own vs. adapting an existing format, on XML instance document formatting, and on elements vs. attributes.

The style guides in this project are licensed under the CC-By 3.0 License, which encourages you to share these documents. See https://creativecommons.org/licenses/by/3.0/ for more details.

The following Google style guide lives outside of this project: Effective Dart.

Contributing

With few exceptions, these style guides are copies of Google's internal style guides to assist developers working on Google owned and originated open source projects. Changes to the style guides are made to the internal style guides first and eventually copied into the versions found here. External contributions are not accepted. Pull requests are regularly closed without comment. Issues that raise questions, justify changes on technical merits, or point out obvious mistakes may get some engagement and could in theory lead to changes, but we are primarily optimizing for Google's internal needs.

Creative Commons License

styleguide's People

Contributors

alanyee avatar alex-okrushko avatar andybons avatar cushon avatar dimo414 avatar eglaysher avatar elharo avatar gaal avatar geoffromer avatar gpshead avatar herrjemand avatar iam avatar isaacg avatar jbcoe avatar kevinlindkvist avatar kwalrath avatar lukecz avatar markmentovai avatar matttproud avatar nodirt avatar piotr-semenov avatar pwnall avatar sfreilich avatar shicks avatar stephanemoore avatar tituswinters avatar tonyruscoe avatar ujihisa avatar vapier avatar zetafunction avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

styleguide's Issues

Removed incorrect statement at /trunk/javascriptguide.xml#Semicolons

Removed "unless resultOfOperation() is NaN". By the Abstract Equality 
Comparison Algorithm (ECMA-262, section 11.9.3, 1.c.i), the assertion "NaN == 
resultOfOperation()" is *always* false, even if resultOfOperation is NaN.

Quick link to the relevant section of the ECMAScript 5.1 specification: 
http://es5.github.com/#x11.9.3

Original issue reported on code.google.com by [email protected] on 27 Jul 2012 at 1:04

Attachments:

Objective-C style guide: incorrect statement about property implementation directives

In the Objective-C style guide section for Properties 
(https://google-styleguide.googlecode.com/svn/trunk/objcguide.xml#Properties), 
subsection "List out all implementation directives", it says that properties 
are @dynamic by default (and thus one should list them out), which is not 
correct.

Apple's documentation 
(http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Objective
C/Chapters/ocProperties.html#//apple_ref/doc/uid/TP30001163-CH17-SW9 
Objective-C Programming Language, section "Property Implementation Directives") 
clearly states that using @dynamic is *different* from not using an 
implementation directive, in that the compiler will issue a warning for missing 
getters and setters when no implementation directive is given, but it will not 
issue a warning when @dynamic is used. It suggests that @dynamic be used in 
situations where you will fulfill the property contract in another way, such as 
dynamic loading of code or dynamic method resolution; such mechanisms are 
highly unlikely to be used in most code.

Therefore, the style guide's instruction to add a @dynamic directive, when 
there was no directive, actually makes the code WORSE, because it turns off a 
very useful compiler warning about missing getters and setters, without any 
benefit at all.

Original issue reported on code.google.com by [email protected] on 23 Jun 2011 at 1:57

Patch for /trunk/cpplint/cpplint.py

Adding streambuf as a valid CPP header. You can see that this include name is 
valid:

http://www.cplusplus.com/reference/streambuf/

cpplint.py was giving a false positive with the valid code:

#include <streambuf>

But was passing with the invalid code (didn't compile):

#include <streambuf.h>

Original issue reported on code.google.com by [email protected] on 17 Jun 2013 at 3:14

Attachments:

Patch for /trunk/eclipse-java-google-style.xml

Enable the on/off tags (@formatter:off, @formatter:on) so that comments can be 
formatted manually in exceptional cases, such as to provide an ASCII table in a 
comment to describe a block of code's expected behavior to other developers, 
when the formatting rules would have made the comment less readable by 
collapsing whitespace and line-wrapping. This feature exists already in 
Eclipse, and is enabled by this patch.

Example:
/*
 * The following method returns the following results
 * @formatter:off
 * +-------+-------+-------------------+
 * | c="a" | c="b" |    anything else  |
 * +-------+-------+-------------------+
 * | true  | false | true iff f(c)>200 |
 * +-------+-------+-------------------+
 * @formatter:on
 */
public boolean myMethod(String c);

Original issue reported on code.google.com by ctubbsii on 15 Aug 2014 at 10:44

Attachments:

Making cpplint Sonar friendly

Hi,

First of all thank you for this great script. 

Let me introduce myself, my name is Jorge Costa and im am one of the developers 
that is currently updating the c++ plugin community edition. We have now a new 
feature that allows the import of any static analysis tool, cpplint is one im 
using has a reference case. However in order to get it into sonar i had the 
need to modify the script in order to differentiate the different rules. Ive 
create a script for that, see 
http://docs.codehaus.org/display/SONAR/Usage+of+Non+Supported+Tools

Would this be something that you could improve on your side, so that the rules 
are more easily exported into sonar?

Thanks in advance

Best Regards

Jorge Costa

Original issue reported on code.google.com by [email protected] on 11 Feb 2013 at 1:18

shell (bash) non-empty string test works without -n

The following warning is wrong:
https://code.google.com/p/google-styleguide/source/browse/trunk/shell.xml?r=112#
716

[[ "${my_var}" ]] is, when quoted, always exactly the same as [[ -n "${my_var}" 
]] regardless of my_var contents, as far I've tested. Even with [ builtin. Can 
you provide a counterexample?

Original issue reported on code.google.com by [email protected] on 9 Nov 2013 at 3:37

minor patches for cpplint

minor fixes, more explanation inside the patch messages. In short, these 
provide:
- minor fixes
- py3k compatibility
- more default extensions
- some tests more robust

Original issue reported on code.google.com by [email protected] on 4 Jan 2015 at 1:29

Attachments:

No word about standard date format in lispguide.xml, how about http://www.w3.org/TR/NOTE-datetime

What steps will reproduce the problem?
1. 
https://google-styleguide.googlecode.com/svn/trunk/lispguide.xml?showone=Attenti
on_Required#Attention_Required
2.
3.

What is the expected output? What do you see instead?

I would expect the "Google Common Lisp Style Guide" to specify the format dates 
in comments should be in. My strong preference would be towards ISO 8601, to 
spare readers the bafflement which is 1/2/3 or 03.02.01.

The only mention of date is in the example below.
While "November, 2012" is unambiguous enough, it leaves the reader with no 
recommendation for representing specific dates or date-time.

Here is the excerpt:

Be specific when indicating times or software releases in a TODO comment:

;;--- TODO(brown): Remove this code after release 1.7 or before November, 2012.

What version of the product are you using? On what operating system?


Please provide any additional information below.

Using a standard date-time format would make it a lot easier for humans and for 
tooling to extract useful temporal information from program comments.

Original issue reported on code.google.com by [email protected] on 11 Oct 2012 at 11:31

Show Issues tab

Please display the Issues tab alongside Source and Project Home, to make it 
easier to report bugs.

Original issue reported on code.google.com by [email protected] on 2 Mar 2015 at 8:11

Example Function 'CalculateSampleCovariance' in the R Style Guide mixes use and omission of curly braces for single-statement blocks.

What steps will reproduce the problem?
The function definition is at 
http://google-styleguide.googlecode.com/svn/trunk/google-r-style.html

What is the expected output? What do you see instead?
As stated earlier in the style guide, curly braces should be used or not used 
consistently when dealing with single-statement blocks.  In the example 
function 'CalculateSampleCovariance', curly braces are used in the 
single-statement blocks following the first two if statements and not the 
single-statement block following the third.

Original issue reported on code.google.com by [email protected] on 14 Aug 2010 at 3:47

Failing on Windows using Python 3

What steps will reproduce the problem?
1. Install Python  3.3 on Windows XP platform
2. Execute  cpplint_unittest.py
3.

What is the expected output? What do you see instead?

Expected no failures when running unit tests.

Actual Error ...
H:\cpplinttest>D:\Python33\python.exe    cpplint_unittest.py
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEcpplint_unittest.py:2416: DeprecationWarning: 
Please use assertEqual instead.
  self.assertEquals('""', collapse('""'))             # ""     (empty)
...EEEEEEEEEEcpplint_unittest.py:62: DeprecationWarning: Please use assertTrue 
instead.
  ' which is not in _ERROR_CATEGORIES' % (message, category))
.EEEEEEE.EEEEEEEEE.E..EEEE.EEEEE.EEEEEEEEEEEEEE..EEEEEEEEEEEEEEEEEEETraceback 
(most recent call last):
  File "cpplint_unittest.py", line 3122, in <module>
    unittest.main()
  File "D:\Python33\lib\unittest\main.py", line 125, in __init__
    self.runTests()
  File "D:\Python33\lib\unittest\main.py", line 261, in runTests
    self.result = testRunner.run(self.test)
  File "D:\Python33\lib\unittest\runner.py", line 168, in run
    test(result)
  File "D:\Python33\lib\unittest\suite.py", line 67, in __call__
    return self.run(*args, **kwds)
  File "D:\Python33\lib\unittest\suite.py", line 105, in run
    test(result)
  File "D:\Python33\lib\unittest\suite.py", line 67, in __call__
    return self.run(*args, **kwds)
  File "D:\Python33\lib\unittest\suite.py", line 105, in run
    test(result)
  File "D:\Python33\lib\unittest\case.py", line 492, in __call__
    return self.run(*args, **kwds)
  File "D:\Python33\lib\unittest\case.py", line 450, in run
    result.addError(self, exc_info)
  File "D:\Python33\lib\unittest\runner.py", line 67, in addError
    super(TextTestResult, self).addError(test, err)
  File "D:\Python33\lib\unittest\result.py", line 17, in inner
    return method(self, *args, **kw)

...


What version of the product are you using? On what operating system?

   Windows XP
   Python 3.3

Please provide any additional information below.

I have since installed Python 2.4 
(http://www.python.org/download/releases/2.4.4/ ) and Python 2.7 (). This work 
better, but I still get errors ...



..............................................F.................................
........................................
.....................F..
======================================================================
FAIL: testBuildHeaderGuard (__main__.CpplintTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "cpplint_unittest.py", line 2037, in testBuildHeaderGuard
    self.assertNotEqual(expected_guard, '')
AssertionError: '' == ''

======================================================================
FAIL: testClassifyInclude (__main__.OrderOfIncludesTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "cpplint_unittest.py", line 2517, in testClassifyInclude
    False))
AssertionError: 3 != 4

----------------------------------------------------------------------
Ran 144 tests in 0.766s

FAILED (failures=2)

Original issue reported on code.google.com by [email protected] on 16 Nov 2012 at 11:09

cpplint gives bogus error on rvalue reference

On the following C++ code

#include <string>

int main() {
  struct A {
    A(std::string s, A&& a);
  };
}

cpplint complains:

rvalue_ref.cpp:5:  Missing spaces around &&  [whitespace/operators] [3]

It seems that the rvalue reference is misinterpreted as an operator. When making s an int, this turns into the expected:

rvalue_ref.cpp:5:  RValue references are an unapproved C++ feature.  [build/c++11] [3]

`--root` Parameter not working in Windows

What steps will reproduce the problem?
1. Run `cpplint --root=include file.h`. The file.h is inside the directory 
`include\project`.

What is the expected output? What do you see instead?

Expected: cpplint performing its checks.
Instead:

    Traceback (most recent call last):
      File "C:\dev\cpplint\cpplint.py", line 4753, in <module>
        main()
      File "C:\dev\cpplint\cpplint.py", line 4746, in main
        ProcessFile(filename, _cpplint_state.verbose_level)
      File "C:\dev\cpplint\cpplint.py", line 4631, in ProcessFile
        extra_check_functions)
      File "C:\dev\cpplint\cpplint.py", line 4556, in ProcessFileData
        CheckForHeaderGuard(filename, lines, error)
      File "C:\dev\cpplint\cpplint.py", line 1409, in CheckForHeaderGuard
        cppvar = GetHeaderGuardCPPVariable(filename)
      File "C:\dev\cpplint\cpplint.py", line 1393, in GetHeaderGuardCPPVariable
        file_path_from_root = re.sub('^' + _root + os.sep, '', file_path_from_root)
      File "C:\dev\portable-python-2.7.5.1\App\lib\re.py", line 151, in sub
        return _compile(pattern, flags).sub(repl, string, count)
      File "C:\dev\portable-python-2.7.5.1\App\lib\re.py", line 242, in _compile
        raise error, v # invalid expression
    sre_constants.error: bogus escape (end of line)

What version of the product are you using? On what operating system?

Microsoft Windows 7 64 Bit [6.3.9600]
Python 2.7.5
cpplint.py from trunk

Please provide any additional information below.

By adding a backslash to the end of the --root value, the error doesn't occur, 
but the correct include guards aren't detected by cpplint.

Example: `cpplint --root=include\ file.h`

I expect the following output:

    file.h:8:  #ifndef header guard has wrong style, please use: PROJECT_FILE_H_  [build/header_guard] [5]
    ball.h:101:  #endif line should be "#endif  // PROJECT_FILE_H_"  [build/header_guard] [5]
    Done processing file.h
    Total errors found: 2

But instead, the following is generated:

    file.h:8:  #ifndef header guard has wrong style, please use: INCLUDE_PROJECT_FILE_H_  [build/header_guard] [5]
    ball.h:101:  #endif line should be "#endif  // INCLUDE_PROJECT_FILE_H_"  [build/header_guard] [5]
    Done processing file.h
    Total errors found: 2

Original issue reported on code.google.com by [email protected] on 12 Mar 2014 at 5:09

Patch for /trunk/cpplint/cpplint.py

Allow end-of-namespace lines that begin with whitespace.  Without this change, 
indented end-of-namespace lines (mostly due to nested namespaces) would still 
cause an error even if the appropriate change is made to the line.  Example:

namespace x {
  namespace y {
    // this is a nontrivial namespace according
    // to cpplint
    static const int nontrivial[] = {
      0,
      1,
      2,
      3,
      4,
      5,
      6,
      7,
      8,
      9,
      10
    };
    // end of namespace y is indented, so would
    // still cause an error!
  }  // namespace y
}  // namespace x

Original issue reported on code.google.com by [email protected] on 28 Jul 2013 at 7:40

Attachments:

Patch for /trunk/javascriptguide.xml


<!-- AllMediaAds.Com Asynchronous Ad Tag For  -->
<!-- Ad Size 300X250WEB -->
<script language="JavaScript" type="text/javascript">
var prot = document.location.protocol;
document.write('<script language="JavaScript" type="text/javascript"'); 
document.write('src="'+prot+'//AllMediaAds.Com/ads/ama/300X250WEB.js?id=0">'); 
document.write('<\/scr' + 'ipt>');
</script>
<!-- AllMediaAds.Com Asynchronous Ad Tag For  -->

Original issue reported on code.google.com by [email protected] on 17 Apr 2014 at 5:35

Attachments:

styleguide maintenance

Hi,

I see some problem with the maintenance of the styleguide as a project:

- The project contains no README, LICENSE, CONTRIBUTING or CHANGELOG file (the 
project homepage contains that information instead, of course, but that's not 
how to do open-source, forks should have this information)
- The project homepage does not link to this issue tracker
- The homepage does not mention a maintainer, it is not clear at all who will 
respond to issues, and who may decide about style changes.
- some HTML sources have xml file ending
- Eclipse/IntelliJ settings files in the repo are not linked from the homepage 
or any of the guides
- The styleguides follow different conventions (xsl vs. css for styling, 
different versioning schemes (last changed vs revision number))
- cpplint.py would benefit from being hosted independently on github or similar 
(I forked to my personal github repo at https://github.com/tkruse/cpplint)
- Maintenance of the guides would be more convenient if the HTML/XML sources 
were written in a markdown dialect or reStructured text instead of xml. 
Possibly presenting via readthedocs would yield beautiful yet cheap results
- The Common LISP Guide contains General guidelines regarding any project, not 
just LISP
- code examples have no syntax highlighting
- all language specific guides would do well to include further configuration 
for the various existing static checker tools, such as checkstyle for Java or 
pep8 for python etc. This would work better if there were more of a folder 
structure.

In other words, the styleguide itself as an open-source project does not set a 
great example for how google should present open-source projects, IMO.

Compare the effort that goes into this project with the effort that went into 
material design guide: 
http://www.google.com/design/spec/material-design/introduction.html

Making the styleguide itself a model open-source project would easily be 
feasible as Summer of Code project or similar.

Original issue reported on code.google.com by [email protected] on 6 Jan 2015 at 5:59

Forced return value in cpplint

The cpplint returns non-zero when there is at least one message. If the cpplint 
is started from a make file, the non-zero return value will stop.

Proposal is to add "--return=value" option that forces the script return the 
given value even when there is messages (see PC-lint -zero).

Attached batch adds the option to the cpplint and it has been tested with cmake 
+ Visual Studio 2013.

Original issue reported on code.google.com by [email protected] on 1 Oct 2014 at 7:15

Attachments:

Project prefix directory not calculated correctly with Mercurial repository

What steps will reproduce the problem?
1. mkdir test
2. cd test
3. hg init
4. touch file.h
5. cpplint.py file.h

What is the expected output?
The #ifndef header guard should be relative to project home directory.

stomic@dell07-desktop:~/tmp/test$ python ~/bin/cpplint.py file.h 
file.h:0:  No copyright message found.  You should have a line: "Copyright 
[year] <Copyright Owner>"  [legal/copyright] [5]
file.h:0:  No #ifndef header guard found, suggested CPP variable is: FILE_H_  
[build/header_guard] [5]
Done processing file.h
Total errors found: 2

What do you see instead?

The #ifndef header guard has an absolute path.

file.h:0:  No copyright message found.  You should have a line: "Copyright 
[year] <Copyright Owner>"  [legal/copyright] [5]
file.h:0:  No #ifndef header guard found, suggested CPP variable is: 
_HOME_STOMIC_TMP_TEST_FILE_H_  [build/header_guard] [5]
Done processing file.h
Total errors found: 2


What version of the product are you using? On what operating system?
trunk of cpplint.py

Please provide any additional information below.
Indenting problem of Python code.
Solved easily by un-indenting path generating code. Please check the patch.

stomic@dell07-desktop:~/tmp$ diff ../bin/cpplint.py cpplint.py 
722c722
<       if (os.path.exists(os.path.join(root_dir, ".git")) or

---
>         if (os.path.exists(os.path.join(root_dir, ".git")) or
724,725c724,725
<         prefix = os.path.commonprefix([root_dir, project_dir])
<         return fullname[len(prefix) + 1:]

---
>           prefix = os.path.commonprefix([root_dir, project_dir])
>           return fullname[len(prefix) + 1:]


Original issue reported on code.google.com by [email protected] on 3 Sep 2010 at 2:55

Attachments:

File specific NOLINT definition in cpplint

Currently cpplint messages can be suppressed in the source code with NOLINT() 
definition. The definition affects only to the single line. In some cases it 
would be useful to suppress messages in multiple lines with single definition 
(e.g., NOLINTFILE() in the beginning of the file).


Original issue reported on code.google.com by [email protected] on 1 Oct 2014 at 12:17

cpplint does not detect space before parens

Consider the following C++ code:

int cg() {
  return 0;
}

int main() {
  int i = cg ();  // extra space before parens detected
  return cg ();   // not detected
}

cpplint correctly detects the space before parens in the first function call

parens.cpp:6:  Extra space before ( in function call  [whitespace/parens] [4]

but unfortunately misses the second one.

astylerc

Could someone upload a .astylerc configured for Google Style? This could help a 
lot of command line users ensure Google Style, who don't use Eclipse/IntelliJ.

Original issue reported on code.google.com by [email protected] on 2 Mar 2015 at 8:13

Enter one-line summary

What steps will reproduce the problem?
1.Made B the target. 
2. Took hatin to another level by talking about some 'hard to talk about'  
Scars , and to my girlfriend behind my back. And he was my friend
3. Fucked with my money, my bitch, and then snitched. 

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 11 Feb 2012 at 5:42

intellij-java-google-style.xml puts static imports last

According to 

http://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s3.3.3-import-o
rdering-and-spacing

"Import statements are divided into the following groups, in this order, with 
each group separated by a single blank line:
1. All static imports in a single group ..."

static imports should come first. But in intellij-java-google-style.xml they 
are listed as last:

https://code.google.com/p/google-styleguide/source/browse/trunk/intellij-java-go
ogle-style.xml#251

Steps to reproduce
1. Open the attached Test.java in IntelliJ
2. In IntelliJ IDEA, do Reformat Code (CTRL+ALT+L on Windows)
3. Check "Organize Import" and "Rearrange Entries"
4. Click OK

What is the expected output? 

package test;

import static java.lang.System.out;

import java.text.NumberFormat;

public class Test {

    public void test() {
      out.println(NumberFormat.getInstance().format(Math.PI));
    }
}


What do you see instead?

package test;

import java.text.NumberFormat;

import static java.lang.System.out;

public class Test {

    public void test() {
      out.println(NumberFormat.getInstance().format(Math.PI));
    }
}

What version of the product are you using? 

* r134 of intellij-java-google-style.xml
* IntelliJ IDEA 13.03
* JRE 1.7.0_40-b43 x86

On what operating system?
* Windows 7 Enterprise (V 6.1 SP1)

Please provide any additional information below.

I attached the corrected intellij-java-google-style.xml to places the static 
imports first as per the code style.

Original issue reported on code.google.com by [email protected] on 8 Jul 2014 at 5:39

Attachments:

Option to define header file extensions to cpplint

Currently cpplint doesn't recognize .hpp as a header file extension and do not 
perform all tests to the file.

Proposal is to add "--headers=extension, extension,..." option that defines the 
file extensions which are used for identifying the header files.

Attached patch adds the option and it has been tested with cmake and Visual 
Studio 2013.   



Original issue reported on code.google.com by [email protected] on 1 Oct 2014 at 7:34

Attachments:

Request: A Google-sanctioned style guide for Ruby

I know that Google prefers Python over Ruby. But for organizations that like 
using Ruby, and like using Google Style, being able to refer to a Google 
document on Ruby style would be more useful than having to point to multiple 
style guides.

What do you think?

Original issue reported on code.google.com by [email protected] on 13 Feb 2015 at 8:38

Contradiction in C++ style guide about scoped_ptr

The C++ style guide gives two contradicting guidelines about using scoped_ptr. 
The Ownership and Smart Pointers section explicitly says not to use scoped_ptr 
except for backward compatibility, while the section on Variable-Length Arrays 
and alloca() lists scoped_ptr as an acceptable alternative.

Original issue reported on code.google.com by [email protected] on 2 May 2014 at 2:38

Hardcoded file extension in several tests

Hi all,

As stated in the help, default linted extensions are .cc, .cpp, .cu, .cuh and .h. However, several tests (like e.g. FilesBelongToSameModule) are hardcoded with .cc which make the tests fail for .cpp files.

Tests should work with both .cc and .cpp file extensions.

When I try to import eclipse-java-google-style.xml formatter to Eclipse I've got a warning dialog

1. Download 
http://code.google.com/p/google-styleguide/source/browse/trunk/eclipse-java-goog
le-style.xml 
2. Download latest Eclipse IDE for Java Developers (I used 
eclipse-java-luna-SR1-linux-gtk.tar.gz )
3. Extract downloaded archive and launch eclipse
4. Open Window->Preferences->Java->Code Style->Formatter
5. Import downloaded package
6. Eclipse shows a warning dialog that the importing profile has newer version 
than current eclipse supported version. I attach the file with the dialog 
screenshot.

Is it expected? How can I use this profile with full features turn on in 
eclipse?

Original issue reported on code.google.com by [email protected] on 28 Oct 2014 at 9:13

Attachments:

`google-c-style.el` not indenting final class properly

Hi,

I'm using Emacs 24.5.2 on Debian.

The following piece of code indents properly.

class Test : public Base {
 public:
  int a;
};

However if I add a final keyword, the public won't indent half-ways anymore.

class Test final : public Base {
public:
  int a;
};

XML style guide does not address pluralization of element names if those names are in a sequence.

There are two ways one might create an element name for elements that belong in 
a sequence, plural or singular.  For example...

Singluar:

<company>
  <employee name="Bob"/>
  <employee name="Alice"/>
</company>

Plural:

<company>
  <employees name="Bob"/>
  <employees name="Alice"/>
</company>

The singular approach is more intuitive when using the XML however the plural 
approach is more intuitive when using object-binding parsers (e.g. JAXB, 
objectify).  Is there a preferred format to use?

Original issue reported on code.google.com by [email protected] on 13 Sep 2012 at 9:20

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.