From 241d7107b216853b8daabe4facd337ef0ba789a6 Mon Sep 17 00:00:00 2001 From: Karl Wiberg Date: Fri, 8 Sep 2017 15:07:15 +0200 Subject: [PATCH] Style guide: Add sections for Java, Objective-C/C++, and Python MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They're just pointers to the corresponding Chromium or Google style guides. BUG=none NOTRY=true Change-Id: Ib808db1cc4fc4d8a4ea708e6ec1c92d6d219b78e Reviewed-on: https://chromium-review.googlesource.com/657419 Commit-Queue: Karl Wiberg Reviewed-by: Danil Chapovalov Reviewed-by: Kári Tristan Helgason Reviewed-by: Sami Kalliomäki Reviewed-by: Niels Möller Reviewed-by: Edward Lesmes Cr-Commit-Position: refs/heads/master@{#19758} --- style-guide.md | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/style-guide.md b/style-guide.md index bb2524a73a..6f68ef6007 100644 --- a/style-guide.md +++ b/style-guide.md @@ -1,5 +1,15 @@ # WebRTC coding style guide +## General advice + +Some older parts of the code violate the style guide in various ways. + +* If making small changes to such code, follow the style guide when + it’s reasonable to do so, but in matters of formatting etc., it is + often better to be consistent with the surrounding code. +* If making large changes to such code, consider first cleaning it up + in a separate CL. + ## C++ WebRTC follows the [Chromium][chr-style] and [Google][goog-style] C++ @@ -10,14 +20,6 @@ both. [chr-style]: https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/c++/c++.md [goog-style]: https://google.github.io/styleguide/cppguide.html -Some older parts of the code violate the style guide in various ways. - -* If making small changes to such code, follow the style guide when - it’s reasonable to do so, but in matters of formatting etc., it is - often better to be consistent with the surrounding code. -* If making large changes to such code, consider first cleaning it up - in a separate CL. - ### ArrayView When passing an array of values to a function, use `rtc::ArrayView` @@ -46,6 +48,25 @@ pre-dates the use of the current C++ style guide for this code base. * If making large changes to C code, consider converting the whole thing to C++ first. +## Java + +WebRTC follows the [Google Java style guide][goog-java-style]. + +[goog-java-style]: https://google.github.io/styleguide/javaguide.html + +## Objective-C and Objective-C++ + +WebRTC follows the +[Chromium Objective-C and Objective-C++ style guide][chr-objc-style]. + +[chr-objc-style]: https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/objective-c/objective-c.md + +## Python + +WebRTC follows [Chromium’s Python style][chr-py-style]. + +[chr-py-style]: https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/styleguide.md#python + ## Build files The WebRTC build files are written in [GN][gn], and we follow