I checked front_page.module with the latest version of code review by coder.module, and there were several dozen formatting issues. The suggested patch fixes this, and does nothing else.

Comments

fgm’s picture

Status: Active » Needs review

Forgot to set status.

beginner’s picture

Thanks.
Why is this filed for D4.7?

beginner’s picture

Version: 4.7.x-4.0 » master
Status: Needs review » Needs work

Ok, I see.
The patch is against version 1.63 of front_page.module.
The current head version is v 1.71.

I had already cleaned some coding standard problems, but not all. What would be useful is a patch against HEAD.

I could apply the patch for 4.7, but that version is not really supported anymore, and the patch is not valid for HEAD.

fgm’s picture

Title: front_page.module does not pass coder review » front_page.module 4.7.x does not pass coder review
Version: master » 4.7.x-4.1
StatusFileSize
new31.54 KB

Indeed, the patch is only for v1.63, which I thought to be the latest version in the 4.7 branch, as some "polish" for the last stable version in that branch. However, I just noticed there is a more recent version, much higher in the tree, v1.28.2.1, tagged 4-7--4.1. The new patch attached to this comment applies to v1.28.2.1

I can also make one for the D5 branch, of course. On which version should I base it ? 1.72 ? But I'd still like to have the 4.7 version include it (my current largest site is 4.7-based and will be skipping directly to 6, for which there is no current branch for this module).

I didn't remember Dublin Drupaller had added me to the dev list for this module, though :-)

fgm’s picture

Status: Needs work » Needs review

Forgot to set status again.

beginner’s picture

Status: Needs review » Needs work

Yes, the branching for the earlier releases were not properly done. In order to fix a minor bug with the 4.7 version, I had to create a branch from a much earlier version.

So, v1.28.2.1 is the right version to patch.

I couldn't apply the patch because of non-standard line endings. See:
http://drupal.org/patch/create#unix-line-endings

Current HEAD works for D5, and it will become D6. If you want those fixes in the future D6, HEAD/D5 has to be patched first.

fgm’s picture

StatusFileSize
new30.93 KB

Here is a version with LF endings. Does it apply ?

fgm’s picture

Status: Needs work » Needs review
StatusFileSize
new30.93 KB

Here is a version with LF endings. Does it apply ?

beginner’s picture

Version: 4.7.x-4.1 » master
Status: Needs review » Active

Committed to the 4.7 branch. Thanks.

We need the same for HEAD.

beginner’s picture

Title: front_page.module 4.7.x does not pass coder review » front_page.module does not pass coder review
fgm’s picture

Version: master » 5.x-1.9
Status: Active » Needs review
StatusFileSize
new22.79 KB

Thanks for RTBCing the 4.7.x patch.

Here is a version rerolled for 1.72.

beginner’s picture

I see many changes from 'TRUE' to 'true'.

Is that really part of the standard?
I cannot find anything related here:
http://drupal.org/coding-standards

beginner’s picture

Status: Needs review » Fixed

I reviewed the whole patch, and I notice with some satisfaction that it is both much shorter than the patch for 4.7, and especially much more readable! I remember I had fixed much of the coding style earlier.

I committed the patch: everything looked ok.

I am still puzzled by the TRUE -> true changes, though.
I prefer 'TRUE' and I don't see anything in the standards that say we should use 'true' instead. Maybe 'TRUE' is reserved for SQL, but it doesn't say so in the guidelines.

I'd like to know: were those changes suggested by coder? I also NEED to know, so that I code in the proper way later.

Anyway, in order not to waste time on minor issues, I have committed the whole lot.

beginner’s picture

And thanks a lot fgm for the patches. :)

fgm’s picture

Yes, I prefer TRUE, FALSE, NULL too, as these look like regular constants instead of language builtins, but coder.module suggests the change on performance grounds:

function _coder_performance_case_variabletype_warning() {
  return array(
    '#warning' => t('true is faster than TRUE, also applies to FALSE and NULL'),
    '#description' => t('This is because when looking for constants PHP does a hash lookup for the name as is. And since names are always stored lowercased, by using them you avoid 2 hash lookups.'),
  );
}

Zend Studio code completion always suggests the lower-case version too. Apparently, these are builtins, where as the upper-case form just happens to resolve to the (lower-case) builtin. But the main php doc uses the upper-case form. Go figure.

FWIW ZendFramework consistently uses the lower-case form.

beginner’s picture

Thanks for the feedback.

I added a comment to the coding standards page:
http://drupal.org/coding-standards#comment-262290

Anonymous’s picture

Status: Fixed » Closed (fixed)