diff options
author | Sean Molenaar <sean@m2mobi.com> | 2018-11-29 20:59:46 +0100 |
---|---|---|
committer | Sean Molenaar <sean@m2mobi.com> | 2018-12-14 07:54:43 +0100 |
commit | becce6b7520912257c3d72697a3aefec9923a467 (patch) | |
tree | a2e0da34df11ade7c630e9b681fac6d3b2383918 /CONTRIBUTING.md | |
parent | 0f2645145ac31ad77788954c513f391bc4fbb295 (diff) |
Define an official codestyle and adhere to it.
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r-- | CONTRIBUTING.md | 22 |
1 files changed, 7 insertions, 15 deletions
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 |