Last active
February 12, 2018 13:10
-
-
Save gideao/1e46b62c17d2ad10549026c046bb3610 to your computer and use it in GitHub Desktop.
Auto format and correcting Ruby code using rubocop or rufo
This file contains 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
# Install entr and silversearcher-ag | |
sudo aptitude install entr silversearcher-ag | |
# Install rubocop and add "gem 'rubocop'" to Gemfile | |
gem install rubocop | |
# Add rubocop to Gemfile | |
echo "gem 'rubocop', require: false" >> Gemfile | |
# Watch for changes | |
ag --ruby -l | entr -c bundle exec rubocop -a |
This file contains 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
# Install entr and silversearcher-ag | |
sudo aptitude install entr silversearcher-ag | |
# Install rufo | |
gem install rufo | |
# Add rufo to Gemfile | |
echo "gem 'rufo'" >> Gemfile | |
# Waiting for changes in all files | |
ag -l | entr bundle exec rufo . | |
# or just ruby files | |
ag --ruby -l | entr -c bundle exec rufo lib spec |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment