From becce6b7520912257c3d72697a3aefec9923a467 Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Thu, 29 Nov 2018 20:59:46 +0100 Subject: Define an official codestyle and adhere to it. --- CONTRIBUTING.md | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'CONTRIBUTING.md') diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e14b07828..5f591330e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,8 +1,8 @@ # Contributing Read this when you want to: -* file an issue (bug or feature request) -* help translate the News file to your language +* [file an issue (bug or feature request)](#Issues) +* [help translate the News file to your language](#Translation) * start programming and change the way the News app works * add cool new feeds to the feed explore section * want to provide additional full text feed rules @@ -119,16 +119,8 @@ We usually hang out on **irc.freenode.net** in the **#nextcloud-news** and **#ne ### Coding Style Guidelines -* Use 4 spaces for indention. Why spaces? Because it looks the same on every machine and on the web where you can't normally control the tab width. -* Place the open curly braces on the same line as the parameter block, e.g.: - ```php - if (condition) { - // code - } else { - // code - } - ``` - -* Place a space before and after the parameter block for if, else, for, foreach, function -* Everything should be in camelCase except classes which should be in PascalCase -* For linting JavaScript, a [jshint file](https://github.com/nextcloud/news/blob/master/js/.jshintrc) is used that is run before compiling the JavaScript +The PHP code should all adhere to [PSR-2](https://www.php-fig.org/psr/psr-2/). +*Note that this is a different codestyle than nextcloud itself uses.* +To test the codestyle you can run `make phpcs`. + +For linting JavaScript, a [jshint file](https://github.com/nextcloud/news/blob/master/js/.jshintrc) is used that is run before compiling the JavaScript -- cgit v1.2.3