Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Style Improvements 2 #4873

Merged
merged 1 commit into from May 31, 2014
Merged

Code Style Improvements 2 #4873

merged 1 commit into from May 31, 2014

Conversation

zz85
Copy link
Contributor

@zz85 zz85 commented May 31, 2014

Code transforming mrdoob style second attempt See #4806, #4802

馃拠

cc @WestLangley @mrdoob

Scriptfu used.

git config git config --global core.autocrlf true
git reset --hard # clean state
cd src/
# run code painter
codepainter xform -j ../utils/codestyle/mrdoob_codepainter.json  "*/*.js"
# execute some custom regex
find ./ -type f -exec sed -i -e 's/( )/()/g;s/\[ \]/[]/g;s#{[ ]}#\{\}#g' {} \;
# remove backup files by sed. To undo, use find . -name "*-e" -exec sh -c 'mv -f $0 ${0%-e}' {} \;
find . -name "*.js-e*" -print0 | xargs -0 rm
jscs src -c mrdoob.json -r spaces # execute custom jscs for spaces before and after ++, --, !
git add -p # inspect changes

@zz85 zz85 mentioned this pull request May 31, 2014
@WestLangley
Copy link
Collaborator

Thanks, @zz85!

Just to document for later reference, here are a few remaining issues I see:

path.lineTo( x,y ); // space after comma

if (! startPoint.equals(endPoint)) // space after (

if ( (! holesFirst ) && ( newShapes[mainIdx] ) )        mainIdx ++;    // space after ( and [, extra tabs

if ( ! newShapes[0] )       return      toShapesNoHoles( subPaths ); // space after [, extra tabs

for (var sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) { // space between ( and var

mrdoob added a commit that referenced this pull request May 31, 2014
Code Style Improvements 2
@mrdoob mrdoob merged commit 90f4083 into mrdoob:dev May 31, 2014
@mrdoob
Copy link
Owner

mrdoob commented May 31, 2014

Thanks a ton! ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants