Skip to content

Commit

Permalink
Issue #1474 - added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
magsout committed Jun 6, 2017
1 parent dbaae3f commit eee042b
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions docs/pr-coding-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,34 @@ All code contributions should come in the form of a pull request, as a topic bra

```bash
# makes sure, you are on the master branch
git checkout master
git checkout master

# if you are SURE your fork is up-to-date
git pull origin master
# OR

# OR
# if you are NOT SURE your fork is up-to-date
git pull upstream master

# creates new branch
git checkout -b issues/NumberOfIssue/VersionOfPR
```

5. Create your patch; commit your changes. Referencing the issue number you're working on from the message is recommended.
> Note: Please keep the title under 50 chars. If you'd like to provide more information, just add the details to the commit body.

```bash
# check for changed files
git status
# add files to commit, e.g. as following
git add file.js foldername/foldername2/file2.js
git add file.js foldername/foldername2/file2.js
# add commit message including issue number
git commit -m 'Issue #NumberOfIssue - Fixes broken layout on mobile browsers'
```

6. Push your branch to GitHub:

`git push origin issues/NumberOfIssue/VersionOfPR`
Expand Down Expand Up @@ -148,7 +148,18 @@ The js folder contains two subfolders: `lib` contains all project source files a
> Note: All code changes should be made to the files in `lib`
@@something to write by miketaylr@@
#### Linting
To make it easier for everyone to contribute, we use [eslint](http://eslint.org/) to keep the code base steady. You can view the rules in our [ESLint config](https://github.com/webcompat/webcompat.com/blob/master/.eslintrc#L34). For further explanation of the rules, please have a look at the [ESLint documentation](http://eslint.org/docs/rules/).
For the linting process, we use [Prettier](http://jlongster.com/A-Prettier-Formatter).
In order to avoid errors during a Pull Request, `npm run lint` will be executed before each commit.
`npm run lint` checks all relevant JavaScript files and displays, if something needs to be fixed.
If you get an error displayed, there are two ways to fix it.
1. You can run `npm run fix` automatically, which is great for small issues like missing spaces or lines in various files.
2. You can correct it manually as every error message includes the file and line of the error as well as the rule which was violated will be displayed..
Hopefully this will help you clear up a few struggles.

0 comments on commit eee042b

Please sign in to comment.