Last active
January 4, 2016 01:08
-
-
Save metaskills/8545940 to your computer and use it in GitHub Desktop.
OS X Command To Clean All Whitespace From A Rails Project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find app config db spec test -type f -name '*.rb' -or -name '*.coffee' -or -name '*.erb' -or -name '*.jbuilder' -or -name '*.js' | xargs sed -i '' -E "s/[[:space:]]*$//" | xargs sed -i -E '$a\' |
Just added xargs sed -i -E '$a\'
to the end to make sure there is a new line at the end of the file too.
sweet. to enable this on Textmate 2, go here:
https://github.com/bomberstudios/Strip-Whitespace-On-Save.tmbundle
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make one big whitespace commit to avoid per developer settings. Then enable this in Sublime Text 2.
Add or remove both directories or file extensions that make sense for you.