Closed (fixed)
Project:
CAS
Version:
5.x-3.0
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
10 Mar 2008 at 16:50 UTC
Updated:
26 Mar 2008 at 05:02 UTC
Jump to comment: Most recent file
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
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | cas-coder-full.diff | 42.55 KB | treksler |
| cas-coder.diff | 13.86 KB | treksler |
Comments
Comment #1
treksler commentedHey
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
Comment #2
metzlerd commentedThanks, 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
Comment #3
treksler commentedhey
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
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.