Skip to content

Commit d14b214

Browse files
committed
Add contributing guide
1 parent b8a1990 commit d14b214

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed

CONTRIBUTING.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Contributing to Phug
2+
3+
## Code of Conduct
4+
5+
We worked hard to provide this pug port. And we get any profit of it. That's why we ask you to be polite and respectful. For example, when you report an issue, please use human-friendly sentences ("Hello", "Please", "Thanks", etc.)
6+
7+
## Issue Contributions
8+
9+
Please report any security issue or risk by emailing phug@selfbuild.fr. Please don't disclose security bugs publicly until they have been handled by us.
10+
11+
For any other bug or issue, please click this link and follow the template if applicable:
12+
[Create new issue](https://github.com/phug-php/compiler/issues/new)
13+
14+
This template will help your provide us the informations we need for most issues (the PHP and/or Pug code you use, the expected behaviour and the current behaviour).
15+
16+
## Code Contributions
17+
18+
Fork the [GitHub project](https://github.com/phug-php/compiler) and chek out your copy locally:
19+
20+
```shell
21+
git clone https://github.com/<username>/phug.git
22+
cd phug
23+
git remote add upstream https://github.com/phug-php/compiler.git
24+
```
25+
Replace `<username>` with your GitHub username.
26+
27+
Then, you can work on the master or create a specific branch for your development:
28+
29+
```shell
30+
git checkout -b my-feature-branch -t origin/master
31+
```
32+
33+
You can now edit the "phug" directory contents.
34+
35+
Before committing, please set your name and your e-mail (use the same e-mail address as in your GitHub account):
36+
37+
```shell
38+
git config --global user.name "Your Name"
39+
git config --global user.email "your.email.address@example.com"
40+
```
41+
42+
The ```--global``` argument will apply this setting for all your git repositories, remove it to set only your phug fork with them.
43+
44+
Now you can index and commit your modifications as you usually do with git:
45+
46+
```shell
47+
git add --all
48+
git commit -m "The commit message log"
49+
```
50+
51+
If your patch fixes an open issue, please insert ```#``` immediately followed by the issue number:
52+
53+
```shell
54+
git commit -m "#21 Fix this or that"
55+
```
56+
57+
Use git rebase (not git merge) to sync your work from time to time:
58+
59+
```shell
60+
git fetch origin
61+
git rebase origin/master
62+
```
63+
64+
Please add some tests for bug fixes and features (for example a pug file and the expected HTML file in /tests/templates), then check all is right with phpunit:
65+
66+
Install PHP if you have'nt yet, then install composer:
67+
https://getcomposer.org/download/
68+
69+
Update dependencies:
70+
```
71+
./composer.phar update
72+
```
73+
74+
Or if you installed composer globally:
75+
```
76+
composer update
77+
```
78+
79+
Then call phpunit:
80+
```
81+
./vendor/bin/phpunit
82+
```
83+
84+
Make sure all tests succeed before submit your pull-request, else we will not be able to merge it.
85+
86+
Push your work on your remote GitHub fork with:
87+
```
88+
git push origin my-feature-branch
89+
```
90+
91+
Go to https://github.com/yourusername/phug and select your feature branch. Click the 'Pull Request' button and fill out the form.
92+
93+
We will review it within a few days. And we thank you in advance for your help.

0 commit comments

Comments
 (0)