Skip to content

Commit 1211680

Browse files
author
Lee Dohm
committed
📝 Unify the two contributing documents
Both documents had some really great stuff to them, but there was too much overlap. I did my best to unify them into one document, taking the best features of each.
1 parent 55881d5 commit 1211680

File tree

2 files changed

+104
-179
lines changed

2 files changed

+104
-179
lines changed

CONTRIBUTING.md

Lines changed: 103 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,122 @@
11
# :tada: Contributing to Atom :tada:
22

3-
These are just guidelines, not rules, use your best judgement and feel free
4-
to propose changes to this document in a pull request.
3+
The following is a set of guidelines for contributing to Atom and its packages,
4+
which are hosted in the [Atom Organization](https://github.com/atom) on GitHub.
5+
If you're unsure which package is causing your problem or if you're having an
6+
issue with Atom core, please use the feedback form in the application or email
7+
[[email protected]](mailto:[email protected]). These are just guidelines, not rules,
8+
use your best judgement and feel free to propose changes to this document in a
9+
pull request.
510

6-
## Issues
7-
* Include screenshots and animated GIFs whenever possible, they are immensely
8-
helpful.
9-
* Include the behavior you expected to happen and other places you've seen
10-
that behavior such as Emacs, vi, Xcode, etc.
11-
* Check the Console app for stack traces to include if reporting a crash.
12-
* Check the Dev tools (`alt-cmd-i`) for errors and stack traces to include.
11+
## Submitting Issues
12+
13+
* Include screenshots and animated GIFs whenever possible; they are immensely
14+
helpful.
15+
* Include the behavior you expected and other places you've seen that behavior
16+
such as Emacs, vi, Xcode, etc.
17+
* Check the dev tools (`alt-cmd-i`) for errors and stack traces to include.
18+
* On Mac, check Console.app for stack traces to include if reporting a crash.
19+
* Perform a cursory search to see if a similar issue has already been submitted.
1320

1421
### Package Repositories
1522

1623
This is the repository for the core Atom editor only. Atom comes bundled with
1724
many packages and themes that are stored in other repos under the
18-
[atom organization](https://github.com/atom) such as [tabs](https://github.com/atom/tabs),
25+
[Atom organization](https://github.com/atom) such as
26+
[tabs](https://github.com/atom/tabs),
1927
[find-and-replace](https://github.com/atom/find-and-replace),
20-
[language-javascript](https://github.com/atom/language-javascript),
21-
and [atom-light-ui](http://github.com/atom/atom-light-ui).
28+
[language-javascript](https://github.com/atom/language-javascript), and
29+
[atom-light-ui](http://github.com/atom/atom-light-ui).
2230

2331
If you think you know which package is causing the issue you are reporting, feel
2432
free to open up the issue in that specific repository instead. When in doubt
2533
just open the issue here but be aware that it may get closed here and reopened
2634
in the proper package's repository.
2735

36+
## Hacking on Packages
37+
38+
### Cloning
39+
40+
The first step is creating your own clone. You can of course do this manually
41+
with git, or you can use the `apm develop` command to create a clone based on
42+
the package's `repository` field in the `package.json`.
43+
44+
For example, if you want to make changes to the `tree-view` package, run the
45+
following command:
46+
47+
```
48+
> apm develop tree-view
49+
Cloning https://github.com/atom/tree-view ✓
50+
Installing modules ✓
51+
~/.atom/dev/packages/tree-view -> ~/github/tree-view
52+
```
53+
54+
This clones the `tree-view` repository to `~/github`. If you prefer a different
55+
path, specify it via the `ATOM_REPOS_HOME` environment variable.
56+
57+
### Running in Development Mode
58+
59+
Editing a package in Atom is a bit of a circular experience: you're using Atom
60+
to modify itself. What happens if you temporarily break something? You don't
61+
want the version of Atom you're using to edit to become useless in the process.
62+
For this reason, you'll only want to load packages in **development mode** while
63+
you are working on them. You'll perform your editing in **stable mode**, only
64+
switching to development mode to test your changes.
65+
66+
To open a development mode window, use the "Application: Open Dev" command,
67+
which is normally bound to `cmd-shift-o`. You can also run dev mode from the
68+
command line with `atom --dev`.
69+
70+
To load your package in development mode, create a symlink to it in
71+
`~/.atom/dev/packages`. This occurs automatically when you clone the package
72+
with `apm develop`. You can also run `apm link --dev` and `apm unlink --dev`
73+
from the package directory to create and remove dev-mode symlinks.
74+
75+
### Installing Dependencies
76+
77+
Finally, you need to install the cloned package's dependencies by running
78+
`apm install` within the package directory. This step is also performed
79+
automatically the first time you run `apm develop`, but you'll want to keep
80+
dependencies up to date by running `apm update` after pulling upstream changes.
81+
2882
## Pull Requests
29-
* Include screenshots and animated GIFs whenever possible.
30-
* Follow the [CoffeeScript](#coffeescript-styleguide),
31-
[JavaScript](https://github.com/styleguide/javascript),
32-
and [CSS](https://github.com/styleguide/css) styleguides
33-
* Include thoughtfully worded [Jasmine](http://jasmine.github.io/)
34-
specs
35-
* Avoid placing files in `vendor`. 3rd-party packages should be added as a
36-
`package.json` dependency.
37-
* Files end with a newline.
38-
* Requires should be in the following order:
83+
84+
* Include screenshots and animated GIFs in your pull request whenever possible.
85+
* Follow the [CoffeeScript](#coffeescript-styleguide),
86+
[JavaScript](https://github.com/styleguide/javascript),
87+
and [CSS](https://github.com/styleguide/css) styleguides.
88+
* Include thoughtfully-worded, well-structured
89+
[Jasmine](http://pivotal.github.com/jasmine) specs.
90+
* Document new code based on the
91+
[Documentation Styleguide](#documentation-styleguide)
92+
* End files with a newline.
93+
* Place requires in the following order:
3994
* Built in Node Modules (such as `path`)
4095
* Built in Atom and Atom Shell Modules (such as `atom`, `shell`)
4196
* Local Modules (using relative paths)
42-
* Class variables and methods should be in the following order:
43-
* Class methods (methods starting with a `@`)
44-
* Instance methods
45-
* Beware of platform differences
97+
* Place class properties in the following order:
98+
* Class methods and properties (methods starting with a `@`)
99+
* Instance methods and properties
100+
* Avoid platform-dependent code:
46101
* Use `require('atom').fs.getHomeDirectory()` to get the home directory.
47102
* Use `path.join()` to concatenate filenames.
48-
* Use `os.tmpdir()` instead of `/tmp
103+
* Use `os.tmpdir()` rather than `/tmp` when you need to reference the
104+
temporary directory.
49105

50106
## Git Commit Messages
51-
* Use the present tense
52-
* Reference issues and pull requests liberally
53-
* Consider starting the commit message with an applicable emoji:
107+
108+
* Use the present tense ("Add feature" not "Added feature")
109+
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
110+
* Limit the first line to 72 characters or less
111+
* Reference issues and pull requests liberally
112+
* Consider starting the commit message with an applicable emoji:
54113
* :lipstick: `:lipstick:` when improving the format/structure of the code
55114
* :racehorse: `:racehorse:` when improving performance
56115
* :non-potable_water: `:non-potable_water:` when plugging memory leaks
57116
* :memo: `:memo:` when writing docs
58117
* :penguin: `:penguin:` when fixing something on Linux
59118
* :apple: `:apple:` when fixing something on Mac OS
60-
* :bug: `:bug:` when fixing a bug
119+
* :bug: `:bug:` when fixing a bug
61120
* :fire: `:fire:` when removing code or files
62121
* :green_heart: `:green_heart:` when fixing the CI build
63122
* :white_check_mark: `:white_check_mark:` when adding tests
@@ -66,17 +125,24 @@ in the proper package's repository.
66125
## CoffeeScript Styleguide
67126

68127
* Set parameter defaults without spaces around the equal sign
69-
* `clear = (count=1) ->` instead of `clear = (count = 1) ->`
128+
* `clear = (count=1) ->` instead of `clear = (count = 1) ->`
129+
* Use parentheses if it improves code clarity.
130+
* Prefer alphabetic keywords to symbolic keywords:
131+
* `a is b` instead of `a == b`
132+
* Avoid spaces inside the curly-braces of hash literals:
133+
* `{a: 1, b: 2}` instead of `{ a: 1, b: 2 }`
134+
* Include a single line of whitespace between methods.
70135

71136
## Documentation Styleguide
72137

73138
* Use [TomDoc](http://tomdoc.org).
74139
* Use [Markdown](https://daringfireball.net/projects/markdown).
75-
* Reference classes with `{ClassName}`.
76-
* Reference instance methods with `{ClassName::methodName}`.
77-
* Reference class methods with `{ClassName.methodName}`.
78-
* Delegate to comments elsewhere with `{Delegates to: ClassName.methodName}`
79-
style notation.
140+
* Reference methods and classes in markdown with the custom `{}` notation:
141+
* Reference classes with `{ClassName}`
142+
* Reference instance methods with `{ClassName::methodName}`
143+
* Reference class methods with `{ClassName.methodName}`
144+
* Delegate to comments elsewhere with `{Delegates to: ClassName.methodName}`
145+
style notation.
80146

81147
### Example
82148

docs/contributing.md

Lines changed: 0 additions & 142 deletions
This file was deleted.

docs/contributing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../CONTRIBUTING.md

0 commit comments

Comments
 (0)