Opened 10 years ago
Closed 10 years ago
#5638 closed enhancement (fixed)
Introduce .editorconfig to BuddyPress
Reported by: | netweb | Owned by: | djpaul |
---|---|---|---|
Milestone: | 2.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Core | Keywords: | has-patch commit |
Cc: |
Description
Configuring your editor/IDE for submitting code/patches to BuddyPress and follow the code styling guidelines of BuddyPress is not the simplest of tasks...
"EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs. The EditorConfig project consists of a file format for defining coding styles and a collection of text editor plugins that enable editors to read the file format and adhere to defined styles. EditorConfig files are easily readable and they work nicely with version control systems."
Particularly as WordPress has now implemented this via #WP26429 if your editor or IDE supports this and you checkout the BuddyPress repo into a folder contained within the WordPress develop repo the default is to inherit all the rules from the upstream .editorconfig
.
To this end BuddyPress should include an .editorconfig
file to explicitly declare it's own code styling guidelines or the same .editorconfig
file as WordPress to use their .editorconfig
rules.
I just came across this whilst creating a patch for the BuddyPress package.json
file, WordPress uses 'spaces' for tab indentation whereas BuddyPress are using tabs
. I quickly fudged the WordPress .editorconfig
file to match BuddyPress' so I could create a patch for package.json
to match the current whitespace format.
Attachments (2)
Change History (9)
#4
@
10 years ago
Cool, the majority of BuddyPress' source already matches the proposed 'standards' listed in the .editorconfig
.
As patches come in for those who do use an .editorconfig
there will be at times various patches with some extra changes pertaining to 'end of line', 'insert final new line', 'trim trailing whitespace' and 'tab vs space' indentation, in these cases we need to be nice to the patch submitter and understand that those changes are included in the patch due to their IDE/Editor use of the .editorconfig
.
#5
@
10 years ago
In 5638.2.diff add support for YAML files should use the same code styling as JSON files in .editorconfig
http://yaml.org/spec/1.2/spec.html#id2777534
To maintain portability, tab characters must not be used in indentation
5638.diff is an exact duplicate of WordPress'
.editorconfig
(without the*.txt
andtxt,wp-config-sample.php
)Source: https://core.trac.wordpress.org/browser/trunk/.editorconfig
WordPress Coding Standards http://make.wordpress.org/core/handbook/coding-standards/