May 25, 2021 Electron
The following is the coding specification for the Electron project.
We follow Chromium's coding specifications for C and Python.
Y
ou can use
script/cpplint.py
verify that the document meets the requirements.
The Pyhton version we are currently using is Python 2.7.
Many of the interfaces and data types in Chromium are used in the code, so I hope you're familiar with them. T he Important Interfaces and Data Structures in Chromium is a good getting started document that mentions special types, in-domain types (automatically freeing memory when exiting scope), logging mechanisms, and so on.
For CoffeeScript, we follow GitHub's coding specifications and the following rules:
-
_
to connect words,
such as
file-name.coffee
file_name.coffee
which follows the name of the
github/atom
module-name
This rule
applies only
.coffee
files.
When creating a new API, we prefer to use getters and setters instead
of jQuery single-function
naming, such as
.getText()
and
.setText(text)
.text([text])