I am developing an install pofile and I would like to check the coding style with coder module. There are no options to check install profiles at the moment.

Comments

stella’s picture

Assigned: Unassigned » stella
stella’s picture

Status: Active » Needs review
StatusFileSize
new6.39 KB

Try out the attached patch.

Cheers,
Stella

pp’s picture

I used the patch. It works good. I saw a new group(Select specific profiles) The group contains all installed profil. (I was install all 6.x profil, and my install profile)
I saw correct code review. ("Coder found 1 projects, 2 files, 114 normal warnings" Pasqualle said me, my coding style is dirty... I see now, and I will correct it! ;))
Thanks!

pp
(short: It works, Thanks)

pp’s picture

StatusFileSize
new30.51 KB

duplicate file, see the picture... (I saw it after I corrected all errors)

stella’s picture

Hmmm I can't reproduce this on my test site.

pp’s picture

sorry, sorry, sorry I'm stupid... I made some changes in coder.module on codesprint. I used this wrong version.
The patch is good.

pasqualle’s picture

Status: Needs review » Reviewed & tested by the community

t(' (core)')
should be:
' ('. t('core') .')'
string inside t() should not start or end with space, it is hard to translate correctly..
but this should be fixed with a different issue, as coder already uses this incorrectly

even created a new request for code style check: #304150: check string in t()

based on pp test, and my quick visual code review, this patch is ready to go

stella’s picture

StatusFileSize
new6.4 KB

Re-rolled the patch with the t() change suggested by Pasqualle.

Cheers,
Stella

douggreen’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new6.5 KB

The patch was malformed, so I re-rolled it.

I'm wondering, where do custom and contrib install profiles live? This patch looks from them in /profiles. Can they live in other places?

I'm also wondering if the munging the {system} table names with the profile names might cause problems. Can we have an install profile with the same name as a module.

stella’s picture

Well the installation instructions for the install profiles I downloaded (e.g. Drupalbin) said to put them in the profiles/ directory, alongside profiles/default/. I also checked where install.php looks for the installation profiles. The function install_find_profiles() just looks in the top level profiles/ directory :

file_scan_directory('./profiles', '\.profile$', array('.', '..', 'CVS'), 0, TRUE, 'name', 0);

Cheers,
Stella

stella’s picture

Yeah, I suppose there could be potential for name clashes between profiles and modules/themes. Maybe we could prepend the index name with 'coder_profile' or some such. Can take another look at it.

greggles’s picture

The patch still mostly applies and still mostly works.

I think it's impossible to have a module/theme/profile of the same name or at least it's not generally supported by Drupal.

klausi’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

Coder for Drupal 6 is now frozen and only security fixes will be applied. Feel free to update this issue and reopen against 7.x-2.x or 8.x-2.x.