The code-clean.sh script will corrupt any binary files that do not have one of the following in their name :

".psp", ".gif", ".jpg", ".png", ".tgz", ".ico", "druplicon"

So, this script will currupt swf, mp3, etc.

This wouldn't be so bad if the script actually explained what it did. I presume the last two lines convert dos text files to unix ones.

Wouldn't a better solution be to use the 'file' command to determine which files are text?

Jonny

Comments

brianV’s picture

Version: 5.1 » 7.x-dev

This file removes temporary files left by editors. It also does some minor code cleanup by removing extraneous spaces, and converting tab characters into two space.

It is a script meant for developers. It's not meant to be run on a production site with anything other than core files.

I would recommend this file get pulled from release versions of Drupal.

Daniel Norton’s picture

It should be clearly and accurately documented, else it should be deleted.

brianV’s picture

Issue tags: +Documentation
StatusFileSize
new1.38 KB

Patch attached that adds some documentation and a warning to code-clean.sh.

brianV’s picture

Status: Active » Needs review
drifter’s picture

Status: Needs review » Reviewed & tested by the community

Certainly an improvement, the comments make the purpose of the script much clearer.

webchick’s picture

Status: Reviewed & tested by the community » Needs work

Well if you're going to put a BIG SCARY COMMENT in there, can you at least qualify why this is? The knowledge from this issue should be transferred into the comments.

Also, I'd like to see a reference to Coder module in here, as that is actually community-maintained.

grendzy’s picture

We could also consider moving this functionality into coder or drush projects, and remove the script from core. (code-style.pl has already been removed, and there seems to be some overlap here) #340940: code-style.pl should be removed from core

The editor / patch file removal is useful, I actually use the first half of that script. But the white space removal just seems like a nuisance (I use coder and eclipse for that).

Tor Arne Thune’s picture

Version: 7.x-dev » 8.x-dev
Status: Needs work » Needs review
StatusFileSize
new1.06 KB

Just a reroll of the patch in #4.

marvil07’s picture

Status: Needs review » Closed (won't fix)

code-clean.sh was removed from core some time ago #1282524: Remove scripts/code-clean.sh