Skip to content

Commit 8abd939

Browse files
committed
Add contributing guidelines
1 parent 2766ff9 commit 8abd939

File tree

3 files changed

+81
-10
lines changed

3 files changed

+81
-10
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ install: composer update --prefer-dist
3131

3232
script:
3333
- vendor/bin/phpunit
34-
- composer phpstan
34+
- vendor/bin/phpstan analyse --ansi --no-progress

CONTRIBUTING.md

+78-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,85 @@
11

22
# Thanks for contributing!
3-
:+1: First of all, thanks for contributing! The team is happy to help if you have any questions. Have a look to this contributing guide and also to the [FAQ section](https://github.com/KnpLabs/snappy/blob/master/doc/faq.md). :feet:
4-
The following is a set of guidelines for contributing to Snappy, which is hosted by the [KNP Labs Organization](https://github.com/KnpLabs) on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document opening a pull request. :shipit:
3+
4+
:+1: First of all, thanks for contributing! The team is happy to help if you
5+
have any questions. Have a look to this contributing guide and also to the
6+
[FAQ section](https://github.com/KnpLabs/snappy/blob/master/doc/faq.md). :feet:
7+
The following is a set of guidelines for contributing to Snappy, which is hosted
8+
by the [KNP Labs Organization](https://github.com/KnpLabs) on GitHub. These are
9+
mostly guidelines, not rules. Use your best judgment, and feel free to propose
10+
changes to this document opening a pull request. :shipit:
511

612
## Code of Conduct
7-
This project and everyone participating in it is governed by the following [Code of Conduct](https://github.com/KnpLabs/snappy/blob/master/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
813

9-
## Before adding issues
14+
This project and everyone participating in it is governed by the following
15+
[Code of Conduct](https://github.com/KnpLabs/snappy/blob/master/CODE_OF_CONDUCT.md).
16+
By participating, you are expected to uphold this code.
17+
18+
## Reporting a bug
19+
20+
#### Before submitting a bug
21+
- Verify that you are using the latest Snappy version;
22+
- Double-check the [documentation](https://github.com/KnpLabs/snappy/blob/master/README.md)
23+
and the [FAQ section](https://github.com/KnpLabs/snappy/blob/master/doc/faq.md)
24+
to see if you're not misusing the library;
25+
- Check if the issue is a Snappy issue and not a wkhtmltopdf issue (see [how to](#how-to-verify-if-the-issue-is-a-snappy-issue));
26+
- Check if the issue has already been reported. If it has and the issue is still
27+
open, add a comment to the existing issue instead of opening a new one.
28+
29+
##### How to verify if the issue is a Snappy issue
30+
In order to verify that the issue is a Snappy issue and not a wkhtmltopdf issue,
31+
simply copy paste the command displayed in the error message in your command prompt.
32+
If the same error appears on the command line, then it's a wkhtmltopdf issue and
33+
you'll have more chance to resolve your issue [there](https://github.com/wkhtmltopdf/wkhtmltopdf/issues).
34+
35+
#### How to submit a (good) bug report
36+
To report a Snappy bug please open a [GitHub issue](https://github.com/KnpLabs/snappy/issues)
37+
following the rules below.
38+
39+
- Use a clear and descriptive title for the issue to identify the problem;
40+
- Describe the steps needed to reproduce the bug including a code example when
41+
possible;
42+
- Give as much detail as possible about your environment (OS, PHP version,
43+
Snappy configuration, ...);
44+
45+
## Suggesting enhancements
46+
47+
To suggest Snappy enhancements please open a [GitHub issue](https://github.com/KnpLabs/snappy/issues)
48+
following the rules below.
49+
50+
- Use a clear and descriptive title for the issue to identify the problem;
51+
- Provide a step-by-step description of the suggested enhancement in as many
52+
details as possible;
53+
- Explain why this enhancement would be useful with one or more use cases;
54+
55+
## Contributing to the code
56+
57+
A pull request, is the best way to provide a bug fix or to propose enhancements to Snappy.
58+
59+
When submitting a pull request please be sure to follow the same rules described
60+
above in [Reporting a bug](#reporting-a-bug) and [Suggesting enhancements](suggesting-enhancements)
61+
sections depending on the nature of your change.
1062

11-
Please verify the problem is actually a snappy problem and not a **wkhtmltopdf problem**.
63+
> Before starting to work on a large change please open an issue to ask the
64+
maintainers if they are fine with it (no one likes to work for nothing!).
1265

13-
To do so, simply copy paste the command displayed in the error message in your command prompt.
14-
If the same error appears on the command line, then it's a wkhtmltopdf problem,
15-
and you'll have more chance to resolve your issue [there](https://github.com/wkhtmltopdf/wkhtmltopdf/issues).
66+
1. Fork the repository
67+
2. Once the repository has been forked clone it locally
68+
```
69+
git clone [email protected]:USERNAME/snappy.git
70+
```
71+
3. Create a new branch
72+
```
73+
git checkout -b BRANCH_NAME master
74+
```
75+
4. Code!!!
76+
5. Add/Update tests (if needed)
77+
6. Update documentation (if needed)
78+
7. Run the tests and make sure that they are passing
79+
```
80+
composer unit-tests
81+
composer static-analysis
82+
```
83+
8. Squash your commits
84+
9. Rebase your branch on master and fix merge conflicts
85+
10. Open the pull request

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
}
4444
},
4545
"scripts": {
46-
"phpstan": "vendor/bin/phpstan analyse --ansi"
46+
"unit-tests": "vendor/bin/phpunit",
47+
"static-analysis": "vendor/bin/phpstan analyse --ansi"
4748
},
4849
"extra": {
4950
"branch-alias": {

0 commit comments

Comments
 (0)