Exported fields instances have comments in this format, which are not compliant with the Drupal coding standards since they do not end with a period:

  // Exported field_instance: 'mymodule-myfield'
  $field_instances['mymodule-myfield'] = array(
    // ...
  );

This generates errors when scanning the source coding using PHP Codesniffer and the Drupal ruleset from the Coder module:

ERROR: Inline comments must end in full-stops, exclamation marks, colons, or question marks (Drupal.Commenting.InlineComment.InvalidEndChar)

We should simply append a period to the generated comments to satisfy the coding standards.

Comments

pfrenssen created an issue. See original summary.

pfrenssen’s picture

Status: Active » Needs review
StatusFileSize
new1.13 KB
pfrenssen’s picture

Title: Make sure comments of exported field instances end in a period » Coding standards: comments of exported field instances should end in a period
pfrenssen’s picture

StatusFileSize
new1.77 KB
new830 bytes

Fixing ending periods for both field instances and base fields now.

danepowell’s picture

Status: Needs review » Reviewed & tested by the community

Patch #4 looks good, works great.

danepowell’s picture

Title: Coding standards: comments of exported field instances should end in a period » Coding standards of exported items
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new3.03 KB
new825 bytes

Actually I found two other coding standards violations, in menu exports. I hate to hijack this issue, but since all of these are probably only being noticed now because of the release of Coder 8.2.4, I think it makes sense to fix them all at the same time.

pfrenssen’s picture

Good find, thanks!

  • mpotter committed a8b9dc5 on 7.x-2.x authored by Dane Powell
    Issue #2568161 by pfrenssen, Dane Powell: Coding standards of exported...
mpotter’s picture

Status: Needs review » Fixed

Committed to a8b9dc5.

Since we hadn't committed anything yet, it was ok to post a related patch. But in general we should be making separate issues for this. Otherwise a perfectly good RTBC patch can get missed and derailed.

Certainly any additional coder fixes should go into a new issue since this has now been committed here and closed. Do not re-open this issue with additional coder changes. Thanks for the help on this!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.