-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update contributing docs #1574
Merged
Merged
Update contributing docs #1574
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
91bcbbf
Update contributing docs
EnTeQuAk e2655a5
More logs cleanups, remove grunt commands that are already documented…
EnTeQuAk bd3ff7b
Fold in review comments. Thanks @tofumatt and @muffinresearch
EnTeQuAk e3f00a6
Merge branch 'master' of github.com:mozilla/addons-linter into 1572-u…
EnTeQuAk 3f7c14d
Remove en-US
EnTeQuAk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
{ | ||
"rules":{ | ||
"no-console":0 | ||
"no-console": 0 | ||
}, | ||
"env": { | ||
"node": true, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,138 @@ | ||
Thanks for wanting to contribute to Mozilla's Add-ons Linter! You rock! 😊 | ||
Hi! Thanks for wanting to contribute to Mozilla's Add-ons Linter! You rock! 😊 | ||
|
||
## Submitting a Pull Request | ||
This linter is used to help develop and publish [Add-ons](https://developer.mozilla.org/en-US/Add-ons/) for Firefox. You're an add-on developer, we would really value your contributions–no one knows add-on development and publishing better than an add-on developer! | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may want to remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh good point, damn copy & paste. Thanks! |
||
|
||
If you're submitting a pull request, please reference the issue it closes | ||
inside your pull request. Keep your commits atomic; you should have one | ||
commit per issue solved. | ||
Here are links to all the sections in this document: | ||
|
||
Add tests for your code and make sure all existing tests pass. If the tests | ||
fail or you don't maintain 100% test coverage we won't be able to accept your | ||
pull request. | ||
<!-- If you change any of the headings in this document, remember to update the table of contents. --> | ||
<!-- To update the TOC, run the command `npm run gen-contributing-toc` from your root directory and you will auto generate a new TOC. --> | ||
|
||
### Tests | ||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
|
||
Our tests include `eslint` style checks; these keep our code consistent. | ||
You can review the rules in the [`.eslintrc`][eslint] file. | ||
|
||
Please run the tests locally with `npm test` before you commit. | ||
- [Picking an issue](#picking-an-issue) | ||
- [Installation](#installation) | ||
- [Testing the linter](#testing-the-linter) | ||
- [Run all tests](#run-all-tests) | ||
- [Run a single test](#run-a-single-test) | ||
- [Debug a test](#debug-a-test) | ||
- [Build addons-linter](#build-addons-linter) | ||
- [Creating a pull request](#creating-a-pull-request) | ||
- [Writing commit messages](#writing-commit-messages) | ||
- [Tips](#tips) | ||
|
||
[eslint]: https://github.com/mozilla/addons-linter/blob/master/.eslintrc | ||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
||
|
||
# Picking an issue | ||
|
||
For first-time contributors or those who want to start with a small task: [check out our list of good first bugs](https://github.com/mozilla/addons-linter/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+bug%22). These issues have an assigned mentor to help you out and are great issues for learning about the linter and our development process. | ||
|
||
If you're already familiar with the project or would like take on something a little more challenging, please take a look at the [contrib: welcome](https://github.com/mozilla/addons-linter/issues?q=is%3Aissue+is%3Aopen+label%3A"contrib%3A+welcome) issues. | ||
|
||
If you'd like to work on a bug, please comment on it to let the maintainers know. | ||
If someone else has already commented and taken up that bug, please refrain from working on it and submitting | ||
a PR without asking the maintainers as it leads to unnecessary duplication of effort. | ||
|
||
|
||
# Installation | ||
|
||
To get started on a patch, first install `addons-linter` from [source](README.md#development). | ||
|
||
# Testing the linter | ||
|
||
To run tests and check for JavaScript syntax issues as you change the code, run: | ||
|
||
npm test | ||
|
||
## Run all tests | ||
|
||
To run the entire suite of tests once and exit, type: | ||
|
||
npm run test-once | ||
|
||
This is the same as the `npm test` command but it won't re-run automatically as | ||
you edit files. | ||
|
||
## Run a single test | ||
|
||
Instead of running the entire suite, you can run a single test by invoking | ||
the `jest` executable directly with the `-t` option to filter by test | ||
description. For example, if the test you'd like to run is defined in | ||
`tests/test.linter.js` and is described as | ||
"should collect an error when not an xpi/zip" then you could run it like this: | ||
|
||
./node_modules/.bin/jest -r tests/test.linter.js -f "not an xpi/zip" | ||
|
||
## Debug a test | ||
|
||
You can enter the [Node debugger](https://nodejs.org/api/debugger.html) by | ||
directly invoking the `npm run debug` command. For example, | ||
if the test you want to debug is defined in `tests/test.linter.js` then you | ||
could enter the debugger like this: | ||
|
||
node --inspect --inspect-brk ./node_modules/.bin/jest tests/test.linter.js -t 'flag potentially minified' | ||
|
||
You could also put the `debugger` statement somewhere in the code to set a | ||
breakpoint. | ||
|
||
# Build addons-linter | ||
|
||
Type `npm run build` to build a new version of the libraries used by the | ||
`./bin/addons-linter` command. When successful, you will see newly built files in | ||
the `./dist/` directory. | ||
|
||
# Creating a pull request | ||
|
||
When you create a | ||
[pull request](https://help.github.com/articles/creating-a-pull-request/) | ||
for a new fix or feature, be sure to mention the issue | ||
number for what you're working on. | ||
The best way to do it is to mention the issue like | ||
this at the top of your description: | ||
|
||
Fixes #123 | ||
|
||
The issue number in this case is "123." | ||
The word *Fixes* is magical; GitHub will automatically close the issue when your | ||
pull request is merged. | ||
|
||
# Writing commit messages | ||
|
||
Good commit messages serve at least three important purposes: | ||
|
||
* They speed up the reviewing process. | ||
* They help us write good release notes. | ||
* They help future maintainers understand your change and the reasons behind it. | ||
|
||
Structure your commit message like this: | ||
|
||
From: [[http://git-scm.com/book/ch5-2.html]] | ||
|
||
> ``` | ||
> Short (50 chars or less) summary of changes | ||
> | ||
> More detailed explanatory text, if necessary. Wrap it to about 72 | ||
> characters or so. In some contexts, the first line is treated as the | ||
> subject of an email and the rest of the text as the body. The blank | ||
> line separating the summary from the body is critical (unless you omit | ||
> the body entirely); tools like rebase can get confused if you run the | ||
> two together. | ||
> | ||
> Further paragraphs come after blank lines. | ||
> | ||
> - Bullet points are okay, too | ||
> | ||
> - Typically a hyphen or asterisk is used for the bullet, preceded by a | ||
> single space, with blank lines in between, but conventions vary here | ||
> ``` | ||
|
||
* Write the summary line and description of what you have done in the imperative mode, that is as if you were commanding someone. Start the line with "Fix", "Add", "Change" instead of "Fixed", "Added", "Changed". | ||
* Always leave the second line blank. | ||
* Be as descriptive as possible in the description. It helps reasoning about the intention of commits and gives more context about why changes happened. | ||
|
||
Tips | ||
---- | ||
|
||
* If it seems difficult to summarize what your commit does, it may be because it includes several logical changes or bug fixes, and are better split up into several commits using `git add -p`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.