Make WordPress Core

Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#26018 closed defect (bug) (fixed)

Coding standards / whitespace for wp-admin/js/word-count.js

Reported by: dougwollison Owned by:
Priority: normal Milestone: 3.8
Component: Editor Version:
Severity: normal Keywords:
Cc: Focuses:

Description

Patch to come

Attachments (2)

26018.diff​ (2.0 KB ) - added by dougwollison 13 years ago.
Initial changes: spacing, braces, equals, keys fixed and globals declared. Also fixed what looks like a syntax error with one of the regexs.
26018.2.diff​ (566 bytes ) - added by jorbin 13 years ago.

Download all attachments as: .zip

Change History (8)

@dougwollison
13 years ago

Initial changes: spacing, braces, equals, keys fixed and globals declared. Also fixed what looks like a syntax error with one of the regexs.

@jorbin
13 years ago

#1 follow-up: @jorbin
13 years ago

Thanks for the patch. A couple of concerns.

If we want to change one of the regexs, we should ideally do it through it's own tickets and create unit tests as a part of that. That specific regex has been there for 3 years (since [17936] )

All the formatting changes make the svn history much harder to follow for this file. While that is a concern that these jshint changes themselves are going to do that as well, the benefits of having a passing jshint for preventing bugs and enforcing many parts of our standard out ways this cost. To quote @nacin as we do in our style guide, ​“Code refactoring should not be done just because we can.”. I think it's fine on lines we are changing anyways and in general that is the best way for us to go about cleaning up our files.

I've submitted an updated patch with just the jshint related changes

#2 @nacin
13 years ago

  • Summary jshint shouldn't throw errors: wp-admin/js/word-count.js → Coding standards / whitespace for wp-admin/js/word-count.js

I ended up fixing word-count.js in [26209] because I thought it wasn't claimed (accounting error).

Renaming this ticket to reflect whitespace changes.

#3 in reply to: ↑ 1 @dougwollison
13 years ago

Replying to jorbin:

Thanks for the patch. A couple of concerns.

If we want to change one of the regexs, we should ideally do it through it's own tickets and create unit tests as a part of that. That specific regex has been there for 3 years (since [17936] )

All the formatting changes make the svn history much harder to follow for this file. While that is a concern that these jshint changes themselves are going to do that as well, the benefits of having a passing jshint for preventing bugs and enforcing many parts of our standard out ways this cost. To quote @nacin as we do in our style guide, ​“Code refactoring should not be done just because we can.”. I think it's fine on lines we are changing anyways and in general that is the best way for us to go about cleaning up our files.

I've submitted an updated patch with just the jshint related changes

You're right; if the regex works then ignore that change and use yours. I only noticed it anyway because it was screwing with my editor's syntax highlighting for the inline comment on that line.

#4 @wonderboymusic
12 years ago

  • Resolution → fixed
  • Status new → closed

In [26209]

#5 @SergeyBiryukov
12 years ago

  • Milestone Awaiting Review → 3.8

#6 @SergeyBiryukov
12 years ago

  • Component Build/Test Tools → Editor
Note: See TracTickets for help on using tickets.