Commit Graph
6 Commits
Author SHA1 Message Date
Jon Meow eda43faa5a Note namespace and static recommendations in C++ style guide (#1041) 2022-01-27 11:26:47 -08:00
Geoff RomerandChandler Carruth bf49f2efed Proposal: Property naming in C++ (#720)
This proposed style change allows C++ classes in the Carbon project to provide methods that are named like variables, so long as they behave like _properties_ of the class. It also requires data member names to have a trailing `_`.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2021-09-28 14:36:43 -07:00
Jon MeowandChandler Carruth 50fa120c87 Add style guideline for using std::foo; (#263)
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2021-02-22 10:38:54 -08:00
Chandler Carruth 79ad0bf228 Make the rules for braces on ifs and loops simpler and more strict. (#194)
This simply requires braces and doesn't allow single-line `if`s. There
is some minor readability loss here, but it seems minor and provides
extremely simple rules which I'd value.

I can also trivially get clang-tidy to both check for this and
automatically fix code to conform.

Just sending this as a code review as it seems fully in the direction of
the style guide approved by the core team and I've heard no real
objections. That said, if anyone is concerned, I'm happy to take it
through the proposal process.
2020-12-02 20:07:13 -08:00
Jon Meow 79a9b51d07 Update pre-commits, add and address flake8 (#195)
Adopts new copyright and markdown toc checks.

The new toc check generates the toc header, so that's why all the md files changed (this had felt better to me for the long-term, more auto-generated content)
2020-11-13 16:34:23 -08:00
f44cf22924 Add a C++ style guide for the project (#113)
When writing C++ code for Carbon, we want to keep all of our code consistent,
easy to learn, and help avoid spending undue code review time arguing about
the same core style and idiomatic issues.

This adopts the Google C++ style guide as a baseline, and then makes minimal,
focused additions and adjustments to it to suit the needs of Carbon.

Co-authored-by: Thomas Köppe <tkoeppe@google.com>
Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
Co-authored-by: Geoff Romer <gromer@google.com>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
Co-authored-by: austern <austern@google.com>
Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
2020-11-13 00:49:54 -08:00