Commit | Line | Data |
---|---|---|
f9b320a3 TD |
1 | CONTRIBUTING |
2 | ============ | |
3 | ||
4 | First of all: Thanks for your interest in contributing to WoltLab Community Framework! You have to meet some requirements to get your changes accepted though. | |
5 | ||
6 | General requirements | |
7 | -------------------- | |
8 | - Testing is key, you MUST try out your changes before submitting pull requests. It saves us and yourself a lot of time. | |
9 | - The code SHOULD be written by yourself, otherwise you have to check the license before for compatibility and give proper credit to the original author. | |
10 | ||
11 | Files | |
12 | ----- | |
13 | - Unix newlines (\n) MUST be used in every file (php, tpl, less, js, etc.) | |
14 | - All files MUST be saved in ASCII encoding, except language files, which MUST be UTF-8 encoded | |
15 | ||
16 | Formatting | |
17 | ---------- | |
18 | - Tabs MUST be used for indentation, you HAVE TO use a tab size of 8 | |
19 | - empty lines MUST be indentated as deep as the previos line | |
20 | - All identifiers and comments MUST be written in englisch language | |
21 | - PHP | |
22 | - The closing PHP tag MUST be omitted | |
23 | - Every file MUST end with a newline character (\n) | |
24 | ||
25 | Additionally: Have a look at existing files to find out what they should look like. | |
26 | ||
27 | Automated tests | |
28 | --------------- | |
29 | We are running [PHP Codesniffer](https://github.com/squizlabs/PHP_CodeSniffer) to ensure most of our formatting rules. You SHOULD test your changes before submission with it. | |
30 | ||
31 | 1. Install PHP Codesniffer, either via PEAR or via cloning it | |
32 | 2. Execute the following command in the root of your clone of Community Framework: | |
33 | ||
34 | ```sh | |
35 | $ phpcs -p --extensions=php --standard="`pwd`/CodeSniff/WCF" . | |
36 | ``` | |
37 | 3. Fix any errors | |
38 | 4. Repeat until no more errors show up |