Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Coding Style of XWalk for Android

Elliot Smith edited this page Jun 25, 2014 · 3 revisions

The content on this page has been migrated to the main website at: https://crosswalk-project.org/#contribute/coding_style (as of 2014-06-25). Please make any modifications there.

General Coding Style

In genral, we follow the Chromium coding style: http://www.chromium.org/developers/coding-style, and there are some basic rules:

  • NEVER use TAB, use spaces instead of TAB
  • Do NOT leave spaces at the end of line
  • Do NOT leave blank lines at the end of file
  • Be CAREFUL with License headers

Coding Style of C++

For C++ Coding style, we basically follow Google C++ Style Guide:

Coding Style of Java

For Java Code, we follow the Android Open Source style guide

Coding Style of Python

Python code should follow PEP-8, except that Chromium uses two-space indentation instead of four-space indentation, and it uses MixedCase for method names and function names instead of lower_case_with_underscores. PEP-8 guide:

Coding Style of HTML/JavaScript/CSS

For Web resources, we follow Chromium's "Web Development Style Guide":

Clone this wiki locally