Skip to content

Commit 31ab390

Browse files
committed
Merge pull request #30 from SparkPost/contributing
Added CONTRIBUTING.md and updated contribution guidelines.
2 parents 7c39c1e + 6948efd commit 31ab390

File tree

2 files changed

+73
-15
lines changed

2 files changed

+73
-15
lines changed

CONTRIBUTING.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Contributing to php-sparkpost
2+
Transparency is one of our core values, and we encourage developers to contribute and become part of the SparkPost developer community.
3+
4+
The following is a set of guidelines for contributing to php-sparkpost,
5+
which is hosted in the [SparkPost Organization](https://github.com/sparkpost) on GitHub.
6+
These are just guidelines, not rules, use your best judgment and feel free to
7+
propose changes to this document in a pull request.
8+
9+
## Submitting Issues
10+
* You can create an issue [here](https://github.com/sparkpost/php-sparkpost/issues/new), but
11+
before doing that please read the notes below on debugging and submitting issues,
12+
and include as many details as possible with your report.
13+
* Include the version of php-sparkpost you are using.
14+
* Perform a [cursory search](https://github.com/SparkPost/php-sparkpost/issues?q=is%3Aissue+is%3Aopen)
15+
to see if a similar issue has already been submitted.
16+
17+
## Development
18+
19+
### Setup (Getting the Tools)
20+
#### Install Composer
21+
```
22+
curl -sS https://getcomposer.org/installer | php
23+
```
24+
25+
Add composer install directory to $PATH `~/.composer/vendor/bin/`
26+
27+
#### Install PHPUnit for Testing
28+
```
29+
composer global require "phpunit/phpunit=4.3.*"
30+
```
31+
32+
We recommend increasing PHP’s memory limit, by default it uses 128MB. We ran into some issues during local development without doing so. You can do this by editing your php.ini file and modifying `memory_limit`. We set ours to `memory_limit = 1024M`.
33+
34+
#### Install XDebug for code coverage generation
35+
Follow the instructions at [xdebug.org](http://xdebug.org/wizard.php)
36+
37+
#### Development Tool Resources
38+
* https://getcomposer.org/doc/00-intro.md#globally-on-osx-via-homebrew-
39+
* https://phpunit.de/manual/current/en/installation.html
40+
41+
### Local Development
42+
* Fork [this repository](http://github.com/SparkPost/php-sparkpost)
43+
* Clone your fork
44+
* Run `composer install`
45+
* Write code!
46+
47+
### Contribution Steps
48+
49+
#### Guidelines
50+
51+
- Provide documentation for any newly added code.
52+
- Provide tests for any newly added code.
53+
- Follow [PSR-1](http://www.php-fig.org/psr/psr-1/)
54+
55+
1. Create a new branch named after the issue you’ll be fixing (include the issue number as the branch name, example: Issue in GH is #8 then the branch name should be ISSUE-8)
56+
2. Write corresponding tests and code (only what is needed to satisfy the issue and tests please)
57+
* Include your tests in the 'test' directory in an appropriate test file
58+
* Write code to satisfy the tests
59+
3. Ensure automated tests pass
60+
4. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to [AUTHORS](https://github.com/SparkPost/php-sparkpost/blob/master/AUTHORS.md).
61+
62+
63+
### Testing
64+
Once you are setup for local development:
65+
* You can execute the unit tests using: `composer test`
66+
* You can view coverage information by viewing: `open test/output/report/index.html`
67+
68+
## Releasing
69+
70+
* Update version information in composer.json during development.
71+
* Once its been merged down, create a release tag in git.
72+
* Composer will automatically pickup the new tag and present it as a release.

README.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,5 @@ try {
119119
* By default, open and click tracking are enabled for a transmission.
120120
* By default, a transmission will use the published version of a stored template.
121121

122-
## Development
123-
124-
### Setup
125-
Run `composer install` inside the directory to install dependecies and development tools.
126-
127-
### Testing
128-
Once all the dependencies are installed, you can execute the unit tests using:
129-
```
130-
composer test
131-
```
132-
133122
### Contributing
134-
1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
135-
2. Fork [the repository](http://github.com/SparkPost/php-sparkpost) on GitHub to start making your changes to the **master** branch (or branch off of it).
136-
3. Write a test which shows that the bug was fixed or that the feature works as expected.
137-
4. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to [AUTHORS](https://github.com/SparkPost/php-sparkpost/blob/master/AUTHORS.md).
123+
See [contributing](https://github.com/SparkPost/php-sparkpost/blob/contributing/CONTRIBUTING.md).

0 commit comments

Comments
 (0)