Skip to:
Content

Opened 5 years ago

Closed 5 years ago

#2614 closed defect (fixed)

Multiple strings in .editorconfig section names should be wrapped in curly brackets

Reported by: treyhunner Owned by: netweb
Milestone: 2.6 Priority: normal
Severity: normal Version: trunk
Component: Tools - Code Improvements Keywords: has-patch
Cc: trey@…

Description

The following sections are invalid:

  • *.json,*.yml
  • *.txt,wp-config-sample.php

They should instead be:

  • {*.json,*.yml}
  • {*.txt,wp-config-sample.php}

See http://editorconfig.org/#file-format-details

This is also a problem in bbpress: https://bbpress.trac.wordpress.org/changeset/5383

Attachments (1)

2614.diff (307 bytes) - added by netweb 5 years ago.

Download all attachments as: .zip

Change History (7)

#1 @treyhunner
5 years ago

  • Cc trey@… added

@netweb
5 years ago

#2 @netweb
5 years ago

Trey, thanks, I presume still wrapped in square brackets? eg [{*.json,*.yml}] per patch 2614.diff?

Presumably then many of the projects via editorconfig/wiki/Projects-Using-EditorConfig are 'doing it wrong'

A quick look at some of the 'big' projects the only one I saw using braces was Mozilla here

#3 @netweb
5 years ago

  • Component changed from General to Code Improvements
  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 2.6
  • Summary changed from EditorConfig file broken to Multiple strings in .editorconfig section names should be wrapped in curly brackets

#4 @treyhunner
5 years ago

Yes that is correct. Square brackets for the section and curly braces to denote the either-or conditions in the shell glob.

I have only noticed one project "doing it wrong" in this way before. I'll try to comb through some of the other large projects I'm aware of that use EditorConfig.

If you find/found any others that do it incorrectly without braces, please let me know and I'll file an issue with them. Thanks!

#5 @netweb
5 years ago

Created tickets and patches for #WordPress28494 and #BuddyPress5699

#6 @netweb
5 years ago

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

In 5385:

Multiple strings in .editorconfig sections should be wrapped in curly brackets
Props treyhunner. Fixes #2614

Note: See TracTickets for help on using tickets.