Skip to content

Commit 533dfc4

Browse files
codebytereckerr
authored andcommitted
enhance documentation around contributing to electron (electron#11887)
* add issues document * add documentation coding style to doc * copyediting * replace `nodejs/node` with `electron/electron` * fix commasplice * fix two most important... s/is/are/ * omit unnecessary words * add pull requests doc * copyediting * add general code style to styleguide * updates to CONTRIBUTING.md * copyediting * mark shell blocks as ```sh * mitigate phrase duplication e.g. 'best practice' * lots of opinionated changes to omit unnecessary words * fix numbering & re-apply changes that I overwrote
1 parent 31e0bc0 commit 533dfc4

File tree

4 files changed

+397
-62
lines changed

4 files changed

+397
-62
lines changed

CONTRIBUTING.md

Lines changed: 29 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,15 @@ The following is a set of guidelines for contributing to Electron.
1010
These are just guidelines, not rules, use your best judgment and feel free to
1111
propose changes to this document in a pull request.
1212

13-
## Submitting Issues
13+
## [Issues](https://electronjs.org/docs/development/issues)
1414

15-
### Creating Issues
16-
* You can create an issue [here](https://github.com/electron/electron/issues/new),
17-
but before doing that please read the notes below and include as many details as
18-
possible with your report. If you can, please include:
19-
* The version of Electron you are using
20-
* The operating system you are using
21-
* If applicable, what you were doing when the issue arose and what you
22-
expected to happen
23-
* Other things that will help resolve your issue:
24-
* Screenshots and animated GIFs
25-
* Error output that appears in your terminal, dev tools or as an alert
26-
* Perform a [cursory search](https://github.com/electron/electron/issues?utf8=✓&q=is%3Aissue+)
27-
to see if a similar issue has already been submitted
15+
Issues are created [here](https://github.com/electron/electron/issues/new).
16+
17+
* [How to Contribute in Issues](https://electronjs.org/docs/development/issues#how-to-contribute-in-issues)
18+
* [Asking for General Help](https://electronjs.org/docs/development/issues#asking-for-general-help)
19+
* [Submitting a Bug Report](https://electronjs.org/docs/development/issues#submitting-a-bug-report)
20+
* [Triaging a Bug Report](https://electronjs.org/docs/development/issues#triaging-a-bug-report)
21+
* [Resolving a Bug Report](https://electronjs.org/docs/development/issues#resolving-a-bug-report)
2822

2923
### Issue Maintenance and Closure
3024
* If an issue is inactive for 45 days (no activity of any kind), it will be
@@ -34,56 +28,29 @@ the issue will be closed.
3428
* If an issue has been closed and you still feel it's relevant, feel free to
3529
ping a maintainer or add a comment!
3630

37-
## Development
38-
* Build instructions can be found in [docs/development](docs/development).
39-
40-
## Submitting Pull Requests
41-
42-
* Include screenshots and animated GIFs in your pull request whenever possible.
43-
* Follow the JavaScript, C++, and Python [coding style defined in docs](/docs/development/coding-style.md).
44-
* Write documentation in [Markdown](https://daringfireball.net/projects/markdown).
45-
See the [Documentation Styleguide](/docs/styleguide.md).
46-
* Use short, present tense commit messages. See [Commit Message Styleguide](#git-commit-messages).
31+
## [Pull Requests](https://electronjs.org/docs/development/pull-requests)
4732

48-
## Styleguides
33+
Pull Requests are the way concrete changes are made to the code, documentation,
34+
dependencies, and tools contained in the `electron/electron` repository.
4935

50-
### General Code
36+
* [Setting up your local environment](https://electronjs.org/docs/development/pull-requests#setting-up-your-local-environment)
37+
* [Step 1: Fork](https://electronjs.org/docs/development/pull-requests#step-1-fork)
38+
* [Step 2: Build](https://electronjs.org/docs/development/pull-requests#step-2-build)
39+
* [Step 3: Branch](https://electronjs.org/docs/development/pull-requests#step-3-branch)
40+
* [The Process of Making Changes](https://electronjs.org/docs/development/pull-requests#the-process-of-making-changes)
41+
* [Step 4: Code](https://electronjs.org/docs/development/pull-requests#step-4-code)
42+
* [Step 5: Commit](https://electronjs.org/docs/development/pull-requests#step-5-commit)
43+
* [Commit message guidelines](https://electronjs.org/docs/development/pull-requests#commit-message-guidelines)
44+
* [Step 6: Rebase](https://electronjs.org/docs/development/pull-requests#step-6-rebase)
45+
* [Step 7: Test](https://electronjs.org/docs/development/pull-requests#step-7-test)
46+
* [Step 8: Push](https://electronjs.org/docs/development/pull-requests#step-8-push)
47+
* [Step 8: Opening the Pull Request](https://electronjs.org/docs/development/pull-requests#step-8-opening-the-pull-request)
48+
* [Step 9: Discuss and Update](#step-9-discuss-and-update)
49+
* [Approval and Request Changes Workflow](https://electronjs.org/docs/development/pull-requests#approval-and-request-changes-workflow)
50+
* [Step 10: Landing](https://electronjs.org/docs/development/pull-requests#step-10-landing)
51+
* [Continuous Integration Testing](https://electronjs.org/docs/development/pull-requests#continuous-integration-testing)
5152

52-
* End files with a newline.
53-
* Place requires in the following order:
54-
* Built in Node Modules (such as `path`)
55-
* Built in Electron Modules (such as `ipc`, `app`)
56-
* Local Modules (using relative paths)
57-
* Place class properties in the following order:
58-
* Class methods and properties (methods starting with a `@`)
59-
* Instance methods and properties
60-
* Avoid platform-dependent code:
61-
* Use `path.join()` to concatenate filenames.
62-
* Use `os.tmpdir()` rather than `/tmp` when you need to reference the
63-
temporary directory.
64-
* Using a plain `return` when returning explicitly at the end of a function.
65-
* Not `return null`, `return undefined`, `null`, or `undefined`
53+
## Style Guides
6654

67-
### Git Commit Messages
55+
See [Coding Style](https://electronjs.org/docs/development/coding-style) for information about which standards Electron adheres to in different parts of its codebase.
6856

69-
* Use the present tense ("Add feature" not "Added feature")
70-
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
71-
* Limit the first line to 72 characters or less
72-
* Reference issues and pull requests liberally
73-
* When only changing documentation, include `[ci skip]` in the commit description
74-
* Consider starting the commit message with an applicable emoji:
75-
* :art: `:art:` when improving the format/structure of the code
76-
* :racehorse: `:racehorse:` when improving performance
77-
* :non-potable_water: `:non-potable_water:` when plugging memory leaks
78-
* :memo: `:memo:` when writing docs
79-
* :penguin: `:penguin:` when fixing something on Linux
80-
* :apple: `:apple:` when fixing something on macOS
81-
* :checkered_flag: `:checkered_flag:` when fixing something on Windows
82-
* :bug: `:bug:` when fixing a bug
83-
* :fire: `:fire:` when removing code or files
84-
* :green_heart: `:green_heart:` when fixing the CI build
85-
* :white_check_mark: `:white_check_mark:` when adding tests
86-
* :lock: `:lock:` when dealing with security
87-
* :arrow_up: `:arrow_up:` when upgrading dependencies
88-
* :arrow_down: `:arrow_down:` when downgrading dependencies
89-
* :shirt: `:shirt:` when removing linter warnings

docs/development/coding-style.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ These are the style guidelines for coding in Electron.
55
You can run `npm run lint` to show any style issues detected by `cpplint` and
66
`eslint`.
77

8+
## General Code
9+
10+
* End files with a newline.
11+
* Place requires in the following order:
12+
* Built in Node Modules (such as `path`)
13+
* Built in Electron Modules (such as `ipc`, `app`)
14+
* Local Modules (using relative paths)
15+
* Place class properties in the following order:
16+
* Class methods and properties (methods starting with a `@`)
17+
* Instance methods and properties
18+
* Avoid platform-dependent code:
19+
* Use `path.join()` to concatenate filenames.
20+
* Use `os.tmpdir()` rather than `/tmp` when you need to reference the
21+
temporary directory.
22+
* Using a plain `return` when returning explicitly at the end of a function.
23+
* Not `return null`, `return undefined`, `null`, or `undefined`
24+
825
## C++ and Python
926

1027
For C++ and Python, we follow Chromium's [Coding
@@ -21,6 +38,13 @@ document. The document mentions some special types, scoped types (that
2138
automatically release their memory when going out of scope), logging mechanisms
2239
etc.
2340

41+
## Documentation
42+
43+
* Write [remark](https://github.com/remarkjs/remark) markdown style
44+
45+
You can run `npm run lint-docs` to ensure that your documentation changes are
46+
formatted correctly.
47+
2448
## JavaScript
2549

2650
* Write [standard](https://npm.im/standard) JavaScript style.

docs/development/issues.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Issues In Electron
2+
3+
# Issues
4+
5+
* [How to Contribute in Issues](#how-to-contribute-in-issues)
6+
* [Asking for General Help](#asking-for-general-help)
7+
* [Submitting a Bug Report](#submitting-a-bug-report)
8+
* [Triaging a Bug Report](#triaging-a-bug-report)
9+
* [Resolving a Bug Report](#resolving-a-bug-report)
10+
11+
## How to Contribute in Issues
12+
13+
For any issue, there are fundamentally three ways an individual can
14+
contribute:
15+
16+
1. By opening the issue for discussion: If you believe that you have found
17+
a new bug in Electron, you should report it by creating a new issue in
18+
the `electron/electron` issue tracker.
19+
2. By helping to triage the issue: You can do this either by providing
20+
assistive details (a reproducible test case that demonstrates a bug) or by
21+
providing suggestions to address the issue.
22+
3. By helping to resolve the issue: This can be done by demonstrating
23+
that the issue is not a bug or is fixed; but more often, by opening
24+
a pull request that changes the source in `electron/electron` in a
25+
concrete and reviewable manner.
26+
27+
## Asking for General Help
28+
29+
Because the level of activity in the `electron/electron` repository is
30+
so high, questions or requests for general help using Electron should
31+
be directed at the [community slack channel](https://atomio.slack.com)
32+
or the [forum](https://discuss.atom.io/c/electron).
33+
34+
## Submitting a Bug Report
35+
36+
When opening a new issue in the `electron/electron` issue tracker, users
37+
will be presented with a template that should be filled in.
38+
39+
```markdown
40+
<!--
41+
Thanks for opening an issue! A few things to keep in mind:
42+
43+
- The issue tracker is only for bugs and feature requests.
44+
- Before reporting a bug, please try reproducing your issue against
45+
the latest version of Electron.
46+
- If you need general advice, join our Slack: http://atom-slack.herokuapp.com
47+
-->
48+
49+
* Electron version:
50+
* Operating system:
51+
52+
### Expected behavior
53+
54+
<!-- What do you think should happen? -->
55+
56+
### Actual behavior
57+
58+
<!-- What actually happens? -->
59+
60+
### How to reproduce
61+
62+
<!--
63+
64+
Your best chance of getting this bug looked at quickly is to provide a REPOSITORY that can be cloned and run.
65+
66+
You can fork https://github.com/electron/electron-quick-start and include a link to the branch with your changes.
67+
68+
If you provide a URL, please list the commands required to clone/setup/run your repo e.g.
69+
70+
$ git clone $YOUR_URL -b $BRANCH
71+
$ npm install
72+
$ npm start || electron .
73+
74+
-->
75+
```
76+
77+
If you believe that you have found a bug in Electron, please fill out this
78+
form to the best of your ability.
79+
80+
The two most important pieces of information needed to evaluate the report are
81+
a description of the bug and a simple test case to recreate it. It easier to fix
82+
a bug if it can be reproduced.
83+
84+
See [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve).
85+
86+
## Triaging a Bug Report
87+
88+
It's common for open issues to involve discussion. Some contributors may
89+
have differing opinions, including whether the behavior is a bug or feature.
90+
This discussion is part of the process and should be kept focused, helpful,
91+
and professional.
92+
93+
Terse responses that provide neither additional context nor supporting detail
94+
are not helpful or professional. To many, such responses are annoying and
95+
unfriendly.
96+
97+
Contributors are encouraged to solve issues collaboratively and help one
98+
another make progress. If encounter an issue that you feel is invalid, or
99+
which contains incorrect information, explain *why* you feel that way with
100+
additional supporting context, and be willing to be convinced that you may
101+
be wrong. By doing so, we can often reach the correct outcome faster.
102+
103+
## Resolving a Bug Report
104+
105+
Most issues are resolved by opening a pull request. The process for opening and
106+
reviewing a pull request is similar to that of opening and triaging issues, but
107+
carries with it a necessary review and approval workflow that ensures that the
108+
proposed changes meet the minimal quality and functional guidelines of the
109+
Electron project.

0 commit comments

Comments
 (0)