aspirepress / AspireUpdate

A plugin that allows for rewriting the URLs used to fetch updates from WordPress.org to some other endpoint
22 stars 10 forks source link

Add .editorconfig file to the project to enforce standards for code formatting and support in common IDEs #86

Open asirota opened 2 hours ago

asirota commented 2 hours ago

.editorconfig would also be added to the project: https://editorconfig.org/

asirota commented 2 hours ago

https://editorconfig.org/#download -> plugins for IDEs that require a plugin to respect .editorconfig

asirota commented 2 hours ago
#editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.js]
trim_trailing_whitespace = false

[*.css]
trim_trailing_whitespace = false

[*.php]
trim_trailing_whitespace = false

spaces or tabs? js formats, css formats, php formats.... let's discuss

Here are supported keys: https://spec.editorconfig.org/#supported-pairs

costdev commented 2 hours ago

For reference, here's the one WordPress Core uses.

Aside from wp-config-sample.php, I find this represents a typical setup.

On the "spaces or tabs" question, for me personally, I'd say tabs for most, spaces for YAML. Possibly spaces for JSON if that's the preference.

namithj commented 2 hours ago

Need to make sure these are the same ones WPCS is using. Else phpcs will format it one way and the editor another way.

namithj commented 2 hours ago

Yeah the core one is the way to go

costdev commented 2 hours ago

We can get a PR up pretty quickly for this, so we just need to consider two things: