ezrpg-legacy / ezRPG-1.2.x

ezrpgproject.net
8 stars 7 forks source link

Ensure consistent coding style #44

Closed deohnas closed 7 years ago

deohnas commented 7 years ago

I'd suggest we put in a .editorconfig file to ensure consistent coding style.

editorconfig is just a tool that developers install onto their text editor / IDE and it will configure different settings for the given project. Useful when working on multiple different projects with different coding styles (i.e. Wordpress or Drupal, etc)

Here's an example:

root = true

[*]
indent_style = spaces
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

Not sure about insert_final_newline = false since it seem to be inconsistent in if it should be preset or not currently.

uaktags commented 7 years ago

It's too bad that PHPStorm requires a plugin for it, but it's definitely a great idea for keeping consitiancy between coding. We have a lot of code, especially my own, that has coding style taking back seat to just making sure functionality works. Combining this along with a set guidance for how updates should be pushed and merged should do wonders for project integrity.

deohnas commented 7 years ago

I don't believe any text editors or IDEs have it pre installed per default, but all the popular ones have a plugin available. it's a pretty standardized way to ensure code style consistency and are used by Drupal, phpBB, myBB, Symfony, Laravel just to name a few.