Tiny code style fixes

Aron Novak - June 23, 2009 - 13:21
Project:FeedAPI
Version:6.x-1.x-dev
Component:Code feedapi (core module)
Category:task
Priority:normal
Assigned:Aron Novak
Status:closed
Description

Missing @file blocks, wrong styling at dot operator, misuse of db_query in hook_install() and a serious one: feedapi_install() ereased some variables, which is foolness, it should be done in _uninstall(), i assume.

AttachmentSize
feedapi_code_style.patch8.79 KB

#1

alex_b - June 23, 2009 - 18:49

Good cleanup. I fixed some minor issues:

- Use imparative instead of third person for comments - i. e. "Create new content type." instead of "Creates new content type."
- @file comments should be more generic in install files - I limited them all to a very generic "Install file for..." which I feel is in line with the comments for hook implementations.
- Cleaned up some language.
- Simplified drush @file comments.

Open question: there are three occasions where regexes have been changed? Was this on purpose? E. g.:

-      preg_match_all('/type\s*=\s*("|'. "'" .')([A-Za-z\/+]*)("|'. "'" .')/si', $link, $mime);
+      preg_match_all('/type\s*=\s*("|'."'".')([A-Za-z\/+]*)("|'."'".')/si', $link, $mime);

AttachmentSize
499730-1_code_style.patch 8.65 KB

#2

Aron Novak - June 24, 2009 - 09:12

#1: The content of the regexes have not been changed, it's code style question.
"string concatenation should be formatted without a space separating the operators (dot .) and a quote" - coder module
According to this: "." - this is the good :)

However this is changed in these days: http://drupal.org/coding-standards
"Always use a space between the dot and the concatenated parts to improve readability." - as I know this is for D7

However this is a really marginal question.

#3

alex_b - June 24, 2009 - 12:58

#2 : stupid me :) haven't read the string properly, didn't notice that these " where actually delimiting the very regex string. But it's weird how this is being used to excape quotes. Shouldn't we use the proper escaple character for this?

#4

Aron Novak - June 24, 2009 - 13:12

Rerolled.
In fact those different style quotes were really amigous :)

AttachmentSize
499730-2_code_style.patch 8.49 KB

#5

Aron Novak - June 24, 2009 - 13:16

One of the regular expressions was skipped from the update.

AttachmentSize
499730-3_code_style.patch 8.48 KB

#6

alex_b - July 2, 2009 - 15:20
Status:needs review» reviewed & tested by the community

Ready to be committed.

#7

Aron Novak - July 2, 2009 - 16:26
Status:reviewed & tested by the community» fixed

Committed.

#8

System Message - July 16, 2009 - 16:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.