Merge branch 'master' of https://github.com/WoltLab/WCF
[GitHub/WoltLab/WCF.git] / CONTRIBUTING.md
1 CONTRIBUTING
2 ============
3
4 First of all: Thanks for your interest in contributing to WoltLab Suite Core! However, you have to meet some requirements in order to get your changes accepted.
5
6 **Notice:** This is the development tree of WoltLab Suite Core representing the upcoming version of WoltLab Suite, if you wish to submit pull requests for WSC 3.0.x, please select the branch "3.0".
7
8 General requirements
9 --------------------
10 - **API changes are undesirable**, we want to maintain full backwards compatibility to WSC 3.0.x
11 - Testing is the key, you MUST try out your changes before submitting pull requests. It saves us and yourself a lot of time.
12 - The code SHOULD be written by yourself, otherwise you have to check the license beforehand with regard to compatibility and give the proper credit to the original author.
13
14 Files
15 -----
16 - Unix newlines (\n) MUST be used in every file (php, tpl, less, js, etc.)
17 - All files MUST be saved in ASCII encoding, except language files, which MUST be UTF-8 encoded
18
19 Formatting
20 ----------
21 - Tabs MUST be used for indentation, you HAVE TO use a tab size of 8
22 - empty lines MUST be indentated as deep as the previous line
23 - All identifiers and comments MUST be written in English
24 - PHP
25 - The closing PHP tag MUST be omitted
26 - Every file MUST end with a newline character (\n)
27
28 Additionally: Have a look at existing files to find out what they should look like.
29
30 Automated tests
31 ---------------
32 We are running [PHP Codesniffer](https://github.com/squizlabs/PHP_CodeSniffer) to ensure most of our formatting rules. You SHOULD test your changes before submitting them with it.
33
34 1. Install PHP Codesniffer, either via PEAR or via cloning it
35 2. Execute the following command in the root of your clone of WoltLab Suite Core:
36
37 ```sh
38 $ phpcs -p --extensions=php --standard="`pwd`/CodeSniff/WCF" .
39 ```
40 3. Fix any errors
41 4. Repeat it until no more errors occur