1 # Contributing to Electron
3 :+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
5 This project adheres to the [Contributor Covenant 1.2](http://contributor-covenant.org/version/1/2/0).
6 By participating, you are expected to uphold this code. Please report unacceptable behavior to atom@github.com.
8 The following is a set of guidelines for contributing to Electron.
9 These are just guidelines, not rules, use your best judgment and feel free to
10 propose changes to this document in a pull request.
14 * You can create an issue [here](https://github.com/atom/electron/issues/new),
15 but before doing that please read the notes below and include as many details as
16 possible with your report. If you can, please include:
17 * The version of Electron you are using
18 * The operating system you are using
19 * If applicable, what you were doing when the issue arose and what you
21 * Other things that will help resolve your issue:
22 * Screenshots and animated GIFs
23 * Error output that appears in your terminal, dev tools or as an alert
24 * Perform a [cursory search](https://github.com/atom/electron/issues?utf8=✓&q=is%3Aissue+)
25 to see if a similar issue has already been submitted
27 ## Submitting Pull Requests
29 * Include screenshots and animated GIFs in your pull request whenever possible.
30 * Follow the CoffeeScript, JavaScript, C++ and Python [coding style defined in docs](/docs/development/coding-style.md).
31 * Write documentation in [Markdown](https://daringfireball.net/projects/markdown).
32 See the [Documentation Styleguide](/docs/styleguide.md).
33 * Use short, present tense commit messages. See [Commit Message Styleguide](#git-commit-messages).
39 * End files with a newline.
40 * Place requires in the following order:
41 * Built in Node Modules (such as `path`)
42 * Built in Electron Modules (such as `ipc`, `app`)
43 * Local Modules (using relative paths)
44 * Place class properties in the following order:
45 * Class methods and properties (methods starting with a `@`)
46 * Instance methods and properties
47 * Avoid platform-dependent code:
48 * Use `path.join()` to concatenate filenames.
49 * Use `os.tmpdir()` rather than `/tmp` when you need to reference the
51 * Using a plain `return` when returning explicitly at the end of a function.
52 * Not `return null`, `return undefined`, `null`, or `undefined`
54 ### Git Commit Messages
56 * Use the present tense ("Add feature" not "Added feature")
57 * Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
58 * Limit the first line to 72 characters or less
59 * Reference issues and pull requests liberally
60 * When only changing documentation, include `[ci skip]` in the commit description
61 * Consider starting the commit message with an applicable emoji:
62 * :art: `:art:` when improving the format/structure of the code
63 * :racehorse: `:racehorse:` when improving performance
64 * :non-potable_water: `:non-potable_water:` when plugging memory leaks
65 * :memo: `:memo:` when writing docs
66 * :penguin: `:penguin:` when fixing something on Linux
67 * :apple: `:apple:` when fixing something on Mac OS
68 * :checkered_flag: `:checkered_flag:` when fixing something on Windows
69 * :bug: `:bug:` when fixing a bug
70 * :fire: `:fire:` when removing code or files
71 * :green_heart: `:green_heart:` when fixing the CI build
72 * :white_check_mark: `:white_check_mark:` when adding tests
73 * :lock: `:lock:` when dealing with security
74 * :arrow_up: `:arrow_up:` when upgrading dependencies
75 * :arrow_down: `:arrow_down:` when downgrading dependencies
76 * :shirt: `:shirt:` when removing linter warnings