From 8909906186eaf844778e8941886d9c03126f3ef1 Mon Sep 17 00:00:00 2001 From: magsout Date: Sun, 14 May 2017 16:38:25 +0200 Subject: [PATCH] Issue #1474 - added documentation --- docs/pr-coding-guidelines.md | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/docs/pr-coding-guidelines.md b/docs/pr-coding-guidelines.md index 738d9c632..3a8a76377 100644 --- a/docs/pr-coding-guidelines.md +++ b/docs/pr-coding-guidelines.md @@ -19,15 +19,15 @@ 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 ``` @@ -35,18 +35,18 @@ All code contributions should come in the form of a pull request, as a topic bra 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` @@ -144,10 +144,18 @@ We do not use frameworks. However we use libraries, such suitcss-components-grid ### Javascript -The js folder contains two subfolders: `lib` contains all project source files and `vendor` contains all third party libraries. The files out of the two sub folders contain the compiled source code. +The js folder contains two sub folders: `lib` contains all project source files and `vendor` contains all third party libraries. The files out of the two sub folders contain the compiled source code. > Note: All code changes should be made to the files in `lib` +#### Linting + +For the consistency of our codebase, we use eslint with these rules: https://github.com/webcompat/webcompat.com/blob/master/.eslintrc. We also use Prettier for formatting our code. We have set up two recipes to check and fixe the codebase. + +`npm run lint` check all JavaScript files and display the resulting errors. If you get errors, you have two possibilities. You can correct yourself or you can run `npm run fix` which use Prettier to format the code. + +In order to avoid errors during a Pull Request, `npm run lint` will be executed before each commit. + @@something to write by miketaylr@@