CAS module does not follow Drupal coding standards.
Here's a patch that was generated by running the cas module code through the coder module.

The patch is against the DRUPAL-5 branch

CommentFileSizeAuthor
#1 cas-coder-full.diff42.55 KBtreksler
cas-coder.diff13.86 KBtreksler

Comments

treksler’s picture

Version: 5.x-3.0-beta » 5.x-3.0
StatusFileSize
new42.55 KB

Hey

Looks like 5x-3.0 is the same thing as the DRUPAL-5 branch right now so this should apply to both
I accidentally ran 'cvs diff -uw cas.module' instead of 'cvs diff -u cas.module' so I missed all the white-space problems

I am attaching the full diff this time

metzlerd’s picture

Status: Needs review » Fixed

Thanks, This latest patch applied cleanly and I committed to the 5.x branch. Did you actually generate this diff from coder, or manually fix all this stuff? If it was automated how was it done? I downloaded coder, but didn't see a way to do this.

Dave

treksler’s picture

hey

coder ships with a file called coder_format.php
and a file called coder_format.inc

i made a folder called /usr/local/drupal_format/ and copied both files in there
now i made a script called /usr/local/bin/drupal_format.sh

#!/bin/bash
php /usr/local/drupal_format/coder_format.php $@

and i call it with:
drupal_format.sh inputfile outputfile

it's a little cumbersome to do a whole folder worth of files
and if it's an SVN or CVS checkout it would be easier to do the formatting "in place"
i.e. not having to specify the output file, because you can always svn/cvs revert the change.

so i have been meaning to elaborate on the one line script ;)
but so far this works

PS
something like this may work for cleaning a whole Drupal module

for file in $(find | egrep '(module|php|install|inc)'$)
do
php /usr/local/drupal_format/coder_format.php $file /tmp/outfile
mv /tmp/outfile $file
cvs diff -uw $file
done

PPS
sometimes the script gets it wrong
eg it turns var $whatever into var$whatever
so i always check the result with diff -uw

Cheers, Risto

Anonymous’s picture

Status: Fixed » Closed (fixed)

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