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

Add .editorconfig for code formatting consistency #2540

Open
johanbove opened this issue Oct 6, 2019 · 2 comments

Comments

@johanbove
Copy link
Contributor

commented Oct 6, 2019

Happened to notice some code-formatting inconsistencies in regards to spaces and etc in older files.

To make it easier for developers to stick to the code formatting guidelines, I would like to propose to introduce an .editorconfig file which would help set up the developer's IDE to stick to the project expected defaults.

An example .editorconfig file:

# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true

See https://editorconfig.org/

cf. http://docs.withknown.com/en/latest/developers/standards/#indentation

@mapkyca

This comment has been minimized.

Copy link
Member

commented Oct 7, 2019

I'm not familiar with this, how widely supported is this file?

Also note that there is a phpcs file, so I'd be keen to see that kept updated: https://github.com/mapkyca/known-phpcs

@johanbove

This comment has been minimized.

Copy link
Contributor Author

commented Oct 7, 2019

Regarding the editorconfig support:

That's a good question. Looking at the Github project and the number of integrations that are available for all editors, I would say it's fairly widely supported. https://github.com/editorconfig

It helps us to have everyone use spaces instead of tabs, even-though colleagues might use a different editor for coding.

(Originally published at: https://social.johanbove.info/2019/10/07/replying-to-add-editorconfig-for-code-formatting-consistency)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.