|
| 1 | +# Contributing to renderforest-sdk-php |
| 2 | + |
| 3 | +## Code Contributions |
| 4 | + |
| 5 | +#### Step 1: Clone |
| 6 | + |
| 7 | +Clone the project on [GitHub](https://github.com/renderforest/renderforest-sdk-php.git) |
| 8 | + |
| 9 | + ``` bash |
| 10 | + $ git clone https://github.com/renderforest/renderforest-sdk-php.git |
| 11 | + $ cd renderforest-sdk-php |
| 12 | + ``` |
| 13 | + |
| 14 | +For developing new features and bug fixes, the stage branch should be pulled and built upon. |
| 15 | + |
| 16 | +#### Step 2: Branch |
| 17 | + |
| 18 | +Create a new topic branch to contain your feature, change, or fix: |
| 19 | + |
| 20 | + ``` bash |
| 21 | + $ git checkout -b <topic-branch-name> |
| 22 | + ``` |
| 23 | + |
| 24 | +#### Step 3: Commit |
| 25 | + |
| 26 | +Make sure git knows your name and email address: |
| 27 | + |
| 28 | + ``` bash |
| 29 | + $ git config --global user.name "Example User" |
| 30 | + $ git config --global user.email "[email protected]" |
| 31 | + ``` |
| 32 | + |
| 33 | +Add and commit: |
| 34 | + |
| 35 | + ``` bash |
| 36 | + $ git add my/changed/files |
| 37 | + $ git commit |
| 38 | + ``` |
| 39 | + |
| 40 | +Commit your changes in logical chunks. Please adhere to these [Commit message guidelines](#commit-message-guidelines) |
| 41 | + or your code is unlikely be merged into the main project. |
| 42 | + |
| 43 | +#### Step 4: Rebase |
| 44 | + |
| 45 | +Use git rebase to synchronize your work with the main repository. |
| 46 | + |
| 47 | + ``` bash |
| 48 | + $ git fetch upstream |
| 49 | + $ git rebase upstream/master |
| 50 | + ``` |
| 51 | + |
| 52 | +#### Step 5: Push |
| 53 | + |
| 54 | +Push your topic branch: |
| 55 | + |
| 56 | + ``` bash |
| 57 | + $ git push origin <topic-branch-name> |
| 58 | + ``` |
| 59 | + |
| 60 | +#### Step 6: Pull Request |
| 61 | + |
| 62 | +Open a Pull Request with a clear title and description. |
| 63 | + |
| 64 | + |
| 65 | +## Commit message guidelines |
| 66 | + |
| 67 | + |
| 68 | +The commit message should describe what changed and why. |
| 69 | + |
| 70 | + 1. The first line should: |
| 71 | + * contain a short description of the change |
| 72 | + * be 60 characters or less |
| 73 | + * be prefixed with the name of the changed subsystem |
| 74 | + * be entirely in lowercase with the exception of proper nouns, acronyms, and the words that refer to code, |
| 75 | + like function/variable names |
| 76 | + |
| 77 | + Examples: |
| 78 | + |
| 79 | + ``` |
| 80 | + lib: add changeTitle method to Sites |
| 81 | + deps: add mime package to dependencies |
| 82 | + examples: fix typos in Aws_sdk.php |
| 83 | + helpers: refactor base64_helper.php |
| 84 | + ``` |
| 85 | + 2. Keep the second line blank. |
| 86 | + |
| 87 | + 3. Wrap all other lines at 72 columns: |
| 88 | + * describe each line in logical chunks |
| 89 | + * start each line with: space hyphen space ( - ...) |
| 90 | + * be entirely in lowercase with the exception of proper nouns, acronyms, and the words that refer to code, |
| 91 | + like function/variable names |
| 92 | + |
| 93 | + Examples: |
| 94 | + |
| 95 | + ``` |
| 96 | + - add private method _awsMimeType to Aws_sdk to check media type |
| 97 | + - refactor private method from Auth class |
| 98 | + - add PhpDoc on User class method |
| 99 | + ``` |
0 commit comments