forked from crosswalk-project/crosswalk
-
Notifications
You must be signed in to change notification settings - Fork 0
Coding Style of XWalk for Android
sqliu edited this page Sep 2, 2013
·
11 revisions
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 and the end of line
- Do NOT leave blank lines and the end of file
- Be CAREFUL with License headers
For C++ Coding style, we basically follow Google C++ Style Guide:
For Java Code, we follow the Android Open Source style guide
- http://source.android.com/source/code-style.html
- http://www.chromium.org/developers/coding-style/java
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:
- http://www.python.org/dev/peps/pep-0008/
- http://www.chromium.org/chromium-os/python-style-guidelines
- Two-space indentation instead of four-space indentation
- Uses MixedCase for method names and function names instead of lower_case_with_underscores
For Web resources, we follow Chromium's "Web Development Style Guide":