energylocal / cydynni

Cyd Ynni - community energy, hydro web app
GNU Affero General Public License v3.0
10 stars 4 forks source link

implement a coding style guid #30

Open emrysr opened 6 years ago

emrysr commented 6 years ago

use something like this to ensure the code styling is consistent http://editorconfig.org/

davehun commented 6 years ago

we have a linter that rejects builds if they fail to pass the lint style.

glynhudson commented 6 years ago

Example editor config https://github.com/OpenEVSE/ESP8266_WiFi_v2.x/blob/master/.editorconfig

carwyn commented 6 years ago

I'd recommend using an auto-format on save/commit tool like Golang has enforced and Rust are looking at. This doesn't cover all linting issues but certainly helps, not sure if there are any good ones for PHP? They tend to be a bit more aggressive than editorconfig.

In terms of style guide I'd always advocate on using the upstream guides if they exist, for PHP I think these would be: