Skip to content
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

chore: Use 4 columns for tab indents #7754

Closed
wants to merge 1 commit into from
Closed

Conversation

tofumatt
Copy link
Member

@tofumatt tofumatt commented Jul 6, 2018

In the interest of receiving less shame images and more consistency in our newlines for comments/bode, I propose we set a consistent column width for tabs in our code.

I've been running tabs in Gutenberg and other WordPress projects, but I kept my tab column width at 2 spaces because that's what other JS projects tend to use and I'm used to it. It seems 4-column-width, hard tabs are the WordPress norm, so we should have people's editors respect that.

@tofumatt tofumatt requested review from aduth and a team July 6, 2018 18:01
@gziolo
Copy link
Member

gziolo commented Jul 6, 2018

I'm always happy to land all the tools that automate everthing 👍

@gziolo
Copy link
Member

gziolo commented Jul 6, 2018

By the way, we probably should integrate https://github.com/Automattic/wp-prettier into our workflow - it's prettier's fork which respects extensive spacing enforced by WordPress coding styles. Related issue in our repository #2819. Related issue in prettiers's repository: prettier/prettier#1303.

@ntwb
Copy link
Member

ntwb commented Jul 7, 2018

This isn't required, and I'm closing this PR. If you want to have 2, 4, or even 8 columns as your view in your IDE/Editor then go for it. The only WordPress Coding Standards requirement is that the code indentation uses tabs and not spaces.

The following are all valid uses of indentation, though the shame milage may vary when sharing screenshots with others 😏
screen shot 2018-07-07 at 10 30 39 am
screen shot 2018-07-07 at 10 31 24 am
screen shot 2018-07-07 at 10 31 52 am

Edit: p.s. I think you'll find @aduth shaming was in relation to the comment formatting and not indentation 😂

@ntwb ntwb closed this Jul 7, 2018
@ntwb ntwb deleted the chore/editorconfig branch July 7, 2018 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants