GHOP #136: Improve coder_format checklist

Events happening in the community are now at Drupal community events on www.drupal.org.
You are viewing a wiki page. You are welcome to join the group and then edit it. Be bold!

This page is for tracking the findings of GHOP #136 in coder_format of the coder module.

Legend: See below.

includes/

File Function Issue Status
Remove spaces from lines with only whitespace FIXED
actions.inc Excessive spacing for assignment alignment BOGUS
batch.inc $var =& func() converted to $var = &func() OK
bootstrap.inc // Capitalize and punctuate inline comments. POSTPONED
bootstrap.inc watchdog Array spacing collapsed POSTPONED
cache.inc OK
cache-install.inc OK
common.inc drupal_urlencode // inside /* */ should not be triggered FIXED
common.inc drupal_urlencode // inside '' should not be triggered FIXED
common.inc drupal_common_theme Indent of closing parenthesis of an multi-line array should always have the same indent like the array key or the variable name, e.g.
<?php
$var
= array(
 
'install_page' => array(
   
'arguments' => array('content' => NULL),
  ),
);
?>

coder_preprocessor_ml_array_add_comma() should add a comma to multi-line array values, which required for case ')'.
FIXED
common.inc element_sort Hyphen in -1 should not be separated FIXED
database.inc OK
database.mysql.inc OK
database.mysql-common.inc OK
database.mysqli.inc db_error Wrong usage of inline comments /* */ (should be //) is moved below contextual line. BOGUS
database.pgsql.inc OK
file.inc file_save_upload Improper usage of inline comment in front of case statement. BOGUS
file.inc file_download Negative sign in parenthesis should not have whitespace FIXED
form.inc theme_image_button Long concatenated string merged to one line BOGUS
form.inc batch_get function &foo() should not contain space between ampersand and name FIXED
image.gd.inc OK
image.inc OK
install.inc drupal_rewrite_settings // inside // should not be triggered FIXED
install.mysql.inc OK
install.mysqli.inc OK
install.pgsql.inc OK
language.inc OK
locale.inc _locale_import_read_po Proper inline comment (containing a colon and comma) is placed below statement. FIXED
locale.inc _locale_get_predefined_list Improper usage of multiline comment as inline comment. BOGUS
mail.inc drupal_mail_send Closing parenthesis should have same indent like return statement. FIXED
menu.inc menu_tree_page_data Placements of while and while in a do ... while statement seem to be exchanged/corrupt. FIXED
module.inc OK
pager.inc OK
path.inc OK
session.inc OK
tablesort.inc OK
theme.inc OK
theme.maintenance.inc OK
unicode.inc OK
xmlrpc.inc OK
xmlrpcs.inc OK

modules/

File Function Issue Status
filter.module _filter_htmlcorrector Wrong formatting applied for accessing a single string character using the curly brace syntax. FIXED
node.module node_filter_form postprocessor multiple_vars() should not match multiple lines that are separated by a blank line. FIXED

Legend:
"BOGUS" means that the original code is considered wrong. coder_format follows a strict coding guideline and is not able to think like a human. This means that a developer has to write code (including comments) that is logically correct and basically follows these guidelines, too. For example, you should not wonder why something like

<?php
$foo
= 'Hello word,'
 
. 'this is some kind of'
 
. 'ugly string concatenation.';
?>

will be re-formatted to
<?php
$foo
= 'Hello word,' . 'this is some kind of' . 'ugly string concatenation.';
?>

If a developer really wanted to separate these strings onto multiple lines, a proper syntax should have been used:
<?php
$foo
= 'Hello word,';
$foo .= 'this is some kind of';
$foo .= 'ugly string concatenation.';
?>

Coding standards

Group organizers

Group categories

Status

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week