Created
December 21, 2015 21:44
-
-
Save snarlysodboxer/7fc9a0f61d785bf2fbca to your computer and use it in GitHub Desktop.
White space police for Ruby files
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
#!/bin/bash | |
# remove trailing whitespace | |
find ./ -name '*.rb' -exec sed -i "s/\s\+$//g" {} + | |
# switch tabs for two spaces | |
find ./ -name '*.rb' -exec sed -i "s/\t/ /g" {} + | |
# auto indent with Vim | |
# open any file in Vim, then: | |
:args ~/code/myproject/**/*.rb | argdo execute "normal gg=G" | update |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment