29 KiB
Contributing to Atom
:+1:🎉 First off, thanks for taking the time to contribute! 🎉👍
The following is a set of guidelines for contributing to Atom and its packages, which are hosted in the Atom Organization on GitHub. These are just guidelines, not rules, use your best judgment and feel free to propose changes to this document in a pull request.
This project adheres to the Contributor Covenant 1.2. By participating, you are expected to uphold this code. Please report unacceptable behavior to atom@github.com.
Table Of Contents
- Submitting Issues
- Pull Requests
- Git Commit Messages
- CoffeeScript Styleguide
- Specs Styleguide
- Documentation Styleguide
- Issue and Pull Request Labels
Submitting Issues
- You can create an issue here, but before doing that please read the notes below on debugging and submitting issues, and include as many details as possible with your report.
- Check the debugging guide for tips on debugging. You might be able to find the cause of the problem and fix things yourself.
- Include the version of Atom you are using and the OS.
- Include screenshots and animated GIFs whenever possible; they are immensely helpful.
- Include the behavior you expected and other places you've seen that behavior such as Emacs, vi, Xcode, etc.
- Check the dev tools (
alt-cmd-i) for errors to include. If the dev tools are open before the error is triggered, a full stack trace for the error will be logged. If you can reproduce the error, use this approach to get the full stack trace and include it in the issue. - On Mac, check Console.app for stack traces to include if reporting a crash.
- Perform a cursory search to see if a similar issue has already been submitted.
- Please setup a profile picture to make yourself recognizable and so we can all get to know each other better.
Package Repositories
This is the repository for the core Atom editor only. Atom comes bundled with many packages and themes that are stored in other repos under the Atom organization such as tabs, find-and-replace, language-javascript, and atom-light-ui.
If your issue is related to a specific package, open an issue on that package's issue tracker. If you're unsure which package is causing your problem or if you're having an issue with Atom core, open an issue on this repository.
For more information on how to work with Atom's official packages, see Contributing to Atom Packages
Pull Requests
- Include screenshots and animated GIFs in your pull request whenever possible.
- Follow the CoffeeScript, JavaScript, and CSS styleguides.
- Include thoughtfully-worded, well-structured
Jasmine specs in the
./specfolder. Run them usingapm test. See the Specs Styleguide below. - Document new code based on the Documentation Styleguide
- End files with a newline.
- Place requires in the following order:
- Built in Node Modules (such as
path) - Built in Atom and Atom Shell Modules (such as
atom,shell) - Local Modules (using relative paths)
- Built in Node Modules (such as
- Place class properties in the following order:
- Class methods and properties (methods starting with a
@) - Instance methods and properties
- Class methods and properties (methods starting with a
- Avoid platform-dependent code:
- Use
require('fs-plus').getHomeDirectory()to get the home directory. - Use
path.join()to concatenate filenames. - Use
os.tmpdir()rather than/tmpwhen you need to reference the temporary directory.
- Use
- Using a plain
returnwhen returning explicitly at the end of a function.- Not
return null,return undefined,null, orundefined
- Not
Git Commit Messages
- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally
- Consider starting the commit message with an applicable emoji:
- 🎨
:art:when improving the format/structure of the code - 🐎
:racehorse:when improving performance - 🚱
:non-potable_water:when plugging memory leaks - 📝
:memo:when writing docs - 🐧
:penguin:when fixing something on Linux - 🍎
:apple:when fixing something on Mac OS - 🏁
:checkered_flag:when fixing something on Windows - 🐛
:bug:when fixing a bug - 🔥
:fire:when removing code or files - 💚
:green_heart:when fixing the CI build - ✅
:white_check_mark:when adding tests - 🔒
:lock:when dealing with security - ⬆️
:arrow_up:when upgrading dependencies - ⬇️
:arrow_down:when downgrading dependencies - 👕
:shirt:when removing linter warnings
- 🎨
CoffeeScript Styleguide
- Set parameter defaults without spaces around the equal sign
clear = (count=1) ->instead ofclear = (count = 1) ->
- Use spaces around operators
count + 1instead ofcount+1
- Use spaces after commas (unless separated by newlines)
- Use parentheses if it improves code clarity.
- Prefer alphabetic keywords to symbolic keywords:
a is binstead ofa == b
- Avoid spaces inside the curly-braces of hash literals:
{a: 1, b: 2}instead of{ a: 1, b: 2 }
- Include a single line of whitespace between methods.
- Capitalize initialisms and acronyms in names, except for the first word, which
should be lower-case:
getURIinstead ofgetUriuriToOpeninstead ofURIToOpen
- Use
slice()to copy an array - Add an explicit
returnwhen your function ends with afor/whileloop and you don't want it to return a collected array. - Use
thisinstead of a standalone@return thisinstead ofreturn @
Specs Styleguide
- Include thoughtfully-worded, well-structured
Jasmine specs in the
./specfolder. - treat
describeas a noun or situation. - treat
itas a statement about state or how an operation changes state.
Example
describe 'a dog', ->
it 'barks', ->
# spec here
describe 'when the dog is happy', ->
it 'wags its tail', ->
# spec here
Documentation Styleguide
- Use AtomDoc.
- Use Markdown.
- Reference methods and classes in markdown with the custom
{}notation:- Reference classes with
{ClassName} - Reference instance methods with
{ClassName::methodName} - Reference class methods with
{ClassName.methodName}
- Reference classes with
Example
# Public: Disable the package with the given name.
#
# * `name` The {String} name of the package to disable.
# * `options` (optional) The {Object} with disable options (default: {}):
# * `trackTime` A {Boolean}, `true` to track the amount of time taken.
# * `ignoreErrors` A {Boolean}, `true` to catch and ignore errors thrown.
# * `callback` The {Function} to call after the package has been disabled.
#
# Returns `undefined`.
disablePackage: (name, options, callback) ->
Issue and Pull Request Labels
This section lists the labels we use to help us track and manage issues and pull requests. Most labels are used across the core atom/atom repository and all package repositories, but some are specific for atom/atom.
GitHub search makes it easy to use labels for finding groups of issues or pull requests you're interested in. For example, you might be interested in open issues across atom/atom and all Atom-owned packages which are labeled as bugs, but still need to be reliably reproduced or perhaps open pull requests in atom/atom which haven't been reviewed yet. To help you find issues and pull requests, each label is listed with search links for finding open items with that label in atom/atom only and also across all Atom repositories. We encourage you to read about other search filters which will help you write more focused queries.
The labels are loosely grouped by their purpose, but it's not required that every issue has a label from every group or that an issue can't have more than one label from the same group.
Please open an issue on atom/atom if you have suggestions for new labels, and if you notice some labels are missing on some repositories, then please open an issue on that repository.
Type of Issue and Issue State
| Label name | atom/atom 🔎 |
atom‑org 🔎 |
Description |
|---|---|---|---|
enhancement |
search | search | A feature request. |
bug |
search | search | A confirmed bug or issue very likely to be a bug. |
question |
search | search | A question more than a bug report or feature request (e.g. how do I do X). |
feedback |
search | search | General feedback more than a bug report or feature request. |
help-wanted |
search | search | The Atom core team would appreciate help from the community in resolving these issues. |
beginner |
search | search | Less complex issue which would be a good first issue to work on for users who want to contribute to Atom. |
more-information-needed |
search | search | More information needs to be collected about the problem or feature request (e.g. steps to reproduce). |
needs-reproduction |
search | search | Likely a bug, but hasn't been reliably reproduced. |
triage-help-needed |
search | search | Help is needed to triage this issue, normally from the Atom core team, e.g. to determine if it's a bug or not. |
blocked |
search | search | Issue is blocked on another issue. |
duplicate |
search | search | Issue is a duplicate of another issue. |
wontfix |
search | search | The Atom core team decided not to fix this issue for now, either because it's working as intended or for some other reason. |
invalid |
search | search | Issue isn't valid (e.g. user error). |
package-idea |
search | search | A feature request which might be a good candidate for a new package, instead of extending Atom or a core Atom package. |
wrong-repo |
search | search | Issue was reported on the wrong repository (e.g. a bug related to a package was reported on atom/atom). |
Topic Categories
| Label name | atom/atom 🔎 |
atom‑org 🔎 |
Description |
|---|---|---|---|
windows |
search | search | Related to Atom running on Windows. |
linux |
search | search | Related to Atom running on Linux. |
mac |
search | search | Related to Atom running on OSX. |
documentation |
search | search | Related to any type of documentation (e.g. API documentation and the flight manual). |
performance |
search | search | Related to performance. |
security |
search | search | Related to security. |
ui |
search | search | Related to visual design. |
api |
search | search | Related to Atom's public APIs. |
uncaught-exception |
search | search | Issues created for uncaught exceptions thrown, normally from the Notifications package. |
crash |
search | search | Problems which cause Atom to crash. |
auto-indent |
search | search | Related to auto-indenting text. |
encoding |
search | search | Related to character encoding. |
network |
search | search | Related to network problems or working with remote files (e.g. on network drives). |
git |
search | search | Related to Git functionality (e.g. problems with gitignore files or with showing the correct file status). |
atom/atom Topic Categories
| Label name | atom/atom 🔎 |
atom‑org 🔎 |
Description |
|---|---|---|---|
editor-rendering |
search | search | Related to language-independent aspects of rendering text (e.g. scrolling, soft wrap, and font rendering). |
build-error |
search | search | Related to problems with building Atom from source. |
error-from-pathwatcher |
search | search | Related to errors thrown by the pathwatcher library. |
error-from-save |
search | search | Related to errors thrown when saving files. |
error-from-open |
search | search | Related to errors thrown when opening files. |
installer |
search | search | Related to the Atom installers for different OSes. |
auto-updater |
search | search | Related to the auto-updater for different OSes. |
deprecation-help |
search | search | Issues for helping package authors remove usage of deprecated APIs in packages. |
Core Team Project Management
| Label name | atom/atom search |
atom‑org 🔎 |
Description |
|---|---|---|---|
in-progress |
search | search | Tasks which the Atom core team is working on currently. |
on-deck |
search | search | Tasks which the Atom core team plans to work on next. |
shipping |
search | search | Tasks which the Atom core team completed and will be released in one of the next releases. |
post-1.0-roadmap |
search | search | Atom core team's roadmap post 1.0.0 version. |
atom |
search | search | Topics discussed for prioritization at next meeting of Atom core team members. |
Pull Request Labels
| Label name | atom/atom pull requests |
atom‑org pull requests |
Description |
|---|---|---|---|
work-in-progress |
search | search | The author is still working on the pull request, more changes will follow. |
needs-review |
search | search | Needs code review, and also approval from maintainers or Atom core team. |
under-review |
search | search | Pull request is being reviewed by a maintainer or Atom core team. |
requires-changes |
search | search | Needs to be updated based on review comments and then reviewed again. |
needs-testing |
search | search | Should be tested manually by running the version of Atom in this branch. |