google /styleguide
Style guides for Google-originated open-source projects
★ 39,812⑂ 12,919👁 1,236⑃ 590● 369▤ 0◈ 0
39,812
stars
+2+22+161
12,919
forks
1,236
watchers
590
prs
369
issues
0
releases
0
discussions
README
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.
[Angular Style Guide][angular]
[Common Lisp Style Guide][cl]
[C++ Style Guide][cpp]
[C Style Guide][csharp]
[Effective Dart][dart]
[Go Style Guide][go]
[Haskell Style Guide][haskell]
[HTML/CSS Style Guide][htmlcss]
[JavaScript Style Guide][js]
[Java Style Guide][java]
[JSON Style Guide][json]
[Kotlin Style Guide][kotlin]
[Markdown Style Guide][markdown]
[Objective-C Style Guide][objc]
[Python Style Guide][py]
[R Style Guide][r]
[Rust Style Guide][rust]
[Shell Style Guide][sh]
[Swift Style Guide][swift]
[TCL/TK Style Guide][tcltk]
[TypeScript Style Guide][ts]
[Verilog Style Guide][verilog]
[Vim script Style Guide][vim]
[XML Document Format Style Guide][xml]
Source Code Management
Since projects are largely maintained in a [VCS], writing good commit messages
is important to long term project health. Please refer to
How to Write a Git Commit Message as an excellent
resource. While it explicitly refers to the Git [SCM], its principles apply to
any system, and many Git conventions are trivial to translate to others.
Editors & Tools
Google engineers use a wide variety of editors & IDEs.
Eclipse & IntelliJ
C++: eclipse-cpp-google-style.xml
Java:
Emacs: [google-c-style.el][emacs]
Vim:
Python: google_python_style.vim
We used to host the cpplint tool, but we stopped making internal updates public.
An open source community has forked the project, so users are encouraged to use
instead.
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.
While many of these guides are hosted directly in this project, others might be
hosted in other projects. Sometimes those projects are also maintained by
Google, sometimes they are wider community projects that Google contributes to
like anyone else. Before reporting issues against a particular language/guide,
please check where the guide is hosted.
People can file [issues using the GitHub tracker][gh-tracker]. Issues that raise
questions, justify changes on Top issues
#631Markdown: ATX-style headers should focus on consistency for justification12 comments · 2021-03-28#640Confusing description for dictionary indentation10 comments · 2021-06-20#303Java Style Guide: Constants example (Joiner vs Logger)7 comments · 2017-12-11#970Feature Request: LLM-optimized version of the style guide6 comments · 2026-04-27#847Python: Clarify if order of docstring sections is fixed6 comments · 2024-08-09#907Python styleguide `ExceptionGroup` update for docstrings5 comments · 2025-03-25#820java: javadoc: Consider clarifying “containing only the aligned leading asterisk”5 comments · 2024-04-08#417Inconsistent indentation suggestions for Python5 comments · 2018-11-23