Skip to:

Opened 10 years ago

Closed 10 years ago

#2598 closed enhancement (fixed)

Introduce .editorconfig to bbPress

Reported by: netweb's profile netweb Owned by: netweb's profile netweb
Milestone: 2.6 Priority: normal
Severity: normal Version: trunk
Component: Tools - Code Improvements Keywords: commit


Configuring your editor/IDE for submitting code/patches to bbPress and follow the code styling guidelines of bbPress 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 bbPress 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 bbPress 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.

via #BuddyPress5638

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)

2598.diff (555 bytes) - added by netweb 10 years ago.
2598.2.diff (561 bytes) - added by netweb 10 years ago.

Download all attachments as: .zip

Change History (7)

10 years ago

#1 @netweb
10 years ago

2598.diff​ is an exact duplicate of WordPress' .editorconfig (without the *.txt and txt,wp-config-sample.php)


WordPress Coding Standards

10 years ago

#2 @netweb
10 years ago

In 2598.2.diff add support for YAML files should use the same code styling as JSON files in .editorconfig

To maintain portability, tab characters must not be used in indentation

This ticket was mentioned in IRC in #bbpress-dev by netweb. View the logs.

10 years ago

#4 @johnjamesjacoby
10 years ago

  • Keywords commit added; has-patch removed

Looks great to me. Go ahead and commit at your convenience.

#5 @netweb
10 years ago

  • Owner set to netweb
  • Resolution set to fixed
  • Status changed from new to closed

In 5362:

Add .editorconfig file, see
"EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs."
Props netweb. Fixes #2598

Note: See TracTickets for help on using tickets.