Skip to content
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

Create CONTRIBUTING.md #372

Merged
merged 1 commit into from
Mar 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
**All PR are welcome :)**


### In a few steps
1. clone the repo with `git clone --branch dev git@github.com:BlogoText/blogotext.git`
2. create a new branch `git checkout -b branch-name`
3. do your work
4. check your code (see below)
5. `git push`
6. Go to your github repository, and create a pull request from your branch to `dev` main repo.

### Few rules

Always work on a dedicated branch:

git checkout -b branch-name

Before modifying code **and** pushing changes, stay up to date with the `dev` branch:

// Add blogotext to upstream source
git remote add upstream https://github.com/BlogoText/blogotext.git

// Now, you can refresh your fork from the souce
git pull --squash upstream dev

You can found some documentation on [help.github.com / syncing-a-fork](https://help.github.com/articles/syncing-a-fork/)

### Check your code

Travis CI will do it for you, but to prevent errors you can test yourself the code:

# Download the tool
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar

# Usage
php phpcs.phar --standard=PSR2 -np --tab-width=4 --encoding=utf-8 .

If you are stuck with a **lot of errors**, use this tool which can refactor the code for you:

# Download the tool
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar

# Usage
php phpcbf.phar --standard=PSR2 -np --tab-width=4 --encoding=utf-8 .

! phpcbf.phar can not work with window (require diff, path...) you can add ` --no-patch`