New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code style: consistent indentation with 4 spaces everywhere #8212
Comments
Personally I prefer 2 spaces in less/css files as it is much easier to read IMO. Same for JSON files. |
Standards are not really meant to satisfy personal preferences. We don't use PSR-2 because we think it looks good, but rather because it's simpler for everybody and it's consistent with the rest of the PHP world. Simple and consistency are good for the project (a good illustration is how the indentation is all mixed up today), that's why I'm suggesting this change (not because I like it better with 4 spaces). |
You asked, so I answered my opinion on that. Standards are good and important, but JSON/less is not PHP and if something is easier readable for a special purpose it can be ok to not follow standards. We spent most of our time reading code so it's quite important. I'm not saying I'm not ok with 4 spaces, just saying what I prefer. |
@tsteur because most of our less files already use 4 spaces, it would be nice to use 4 spaces for less files (this avoids having to screw all the git history if we changed it to 2 spaces...) Anyway, we don't need to force space count for less or json - we could just keep standards for javascript and php for now since that's the core of our codebase? |
I really do not care whether it's 4 or 2 spaces. Just personally think 2 spaces are for me better to read, at least for me. I do not work so often with it anyway so do not even mind if it is mixed with 2 or 4 spaces :) |
👍 for consistent indentation across all code files (.php, .less, .css, .html, etc.) |
Closing - this may be applied in the follow up issue |
Just FYI: There is eg the JavaScript coding standard that uses 2 spaces https://github.com/feross/standard |
I'm not sure it's covered by #8211 so here is a small issue to decide this: Piwik's codebase has inconsistent indentation accross languages. PHP is always 4 spaces (as per PSR-2), Javascript too IIRC, but Less/CSS and sometimes JSON are often a mix of 2 and 4 spaces.
How about we say it's 4 spaces for everything and be done with it? Anybody against that?
The text was updated successfully, but these errors were encountered: