Crosswalk coding style
As a general rule, we follow the Chromium coding style: http://www.chromium.org/developers/coding-style.
For quick reference, here are some key rules:
- Never use tabs for indentation; use spaces instead. The number of spaces per indentation level depends on the programming language: see the links below for details.
- Remove trailing spaces from every line.
- Remove any blank lines at the end of a file.
- Be careful with license headers: if you copy or modify a file from somewhere else, ensure that the licence header remains intact.
Coding Style for C++
For C++ code, we follow the Google C++ Style Guide.
Note that C++11 can and should be used in Crosswalk extensions for Tizen.
Coding Style for Java
For Java code, we follow the Android Open Source style guide:
Coding Style for Python
For Python code, we follow PEP-8, with the following exceptions:
- Use two spaces for indentation instead of four.
- Use
MixedCasefor method names and function names instead oflower_case_with_underscores.
(These exceptions align Crosswalk Python code with Chromium Python code.)
For more details, see:
Coding Style of HTML/JavaScript/CSS
For web resources, we follow Chromium's "Web Development Style Guide".
English
