moxie-lean / Lean

Bare bones WordPress starter theme focused on modularity, scalability and performance.
http://getmoxied.net/
GNU General Public License v2.0
19 stars 4 forks source link

Implement Coding standards #2

Closed mitogh closed 8 years ago

mitogh commented 9 years ago

Wordpress code standards it's good but personally there few things were I'm not very comfortable regarding to the rules they follow so here are some changes I suggest to this, of course if you are not agree with this we can keep the way it's at the moment. So if you are agree just add :+1: and if not :-1: and a reason about it.

Basically I want to change the way we are indented the HTML and CSS and JS.

  1. For HTML & CSS (SASS as well) I would like to follow: http://codeguide.co/ instead of WP standards, why? Because I think for HTML & CSS it's better to indent with spaces and have only 2 spaces in the markup instead of 4 and tabs as WP standards does.
  2. For JS I would like to follow: https://github.com/airbnb/javascript instead of the WP standard as well where they suggest same as PHP 1 tab for indent.

In the case of PHP code like:

<?php
foreach( $myArray as $element ){
    echo $element;
}
?> 

I think there we could follow WP standards. This is easily customizable with the .editorconfig. So please let me know your thoughts.

@jeffreynolte @wissambellali @desaiuditd @nacho87

Thank you.

jeffreynolte commented 9 years ago

:+1: @mitogh I am all for this. Some quick question

HTML/CSS

Definitely on board with the Airbnb guide, it is what I personally follow as well.

mitogh commented 9 years ago

Well basically SMACSS it's a good practices to name the classes, this guide it's more like use 2 spaces for indentation of CSS, SASS, HTML. The order of the properties of each selector but does not conflict with SMACSS.

Yes I think we can use that based on .editorconfig

cc @jeffreynolte

jeffreynolte commented 9 years ago

Works for me @mitogh

mitogh commented 9 years ago

Thanks @jeffreynolte, I already added the AIRBN rules:

https://github.com/moxienyc/Lean/blob/development/.jscsrc

And two tasks to review the code:

gulp jscs // Review rules from airbn style guide
gulp reviewJS // Review AIRBN rules and jsHint rules. 
jeffreynolte commented 9 years ago

:+1: Nice!

mitogh commented 9 years ago

This has been completed for JS

mitogh commented 8 years ago

PHP sniffer rules has been added.

:tada: :balloon:

mitogh commented 8 years ago

Great now travis :astonished: :wine_glass:

Closing this one.