Chromium developers,

I have just submitted a PRESUBMIT.py for chrome/ which will run
cpplint.py on your change as part of the presubmit process. cpplint is
currently run at reduced strictness--cpplint run separately may
generate more errors[1]. Currently, it only runs it at (gcl/git cl)
upload time and only generates warnings. In the future, it should
error at commit time, but I want to put this through a trial period so
please pay attention to the warnings and yell and scream at me if
there are false positives. If I hear nothing, I'll enable errors at
commit time sometime next week.

I've also gone through chrome/ code and fixed most style errors.
Here's a few recurring problems to watch out for:

- There is supposed to be a space between (if|while|for) and the
opening parenthesis. There ISN'T supposed to be a space between a
function name and it's arguments.
- When declaring a class that inherits, the ':' should not just be
hanging on the previous line.
- On that note, please remember that "class x : public baseclass" and
"class x : baseclass" may both compile but have different meanings and
that you probably want the first.
- Remember that 'private:', 'public:' and 'protected:' should be
indented one space.
- Don't use tabs.
- Header guards should be of the form "CHROME_DIR_DIR_DIR_FILE_H_".
Header files require header guards; don't omit them. (Exception: the
"-message.h" headers which do multiple include trickery.)
- ';' shouldn't be used in empty loops. Use "{}" instead.
- If an else has a brace on one side, it should have it on both.

Time permitting, I also hope to have app/ , base/ , and maybe views/
lint clean with presubmit checks in the future. I also hope to make
the linter more strict in the future; this is just a starting point.

-- Elliot

[1] For the curious: currently, the presubmit process runs normal
chrome/ code through "--verbose=4" and unit test code through
"--verbose=5". In addition, there's a list of tests that we instruct
cpplint.py to not run due either to common false positives or style
violations that are really, really common.

-- 
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev

Reply via email to