Auto-correct ruby source code by using rubocop in Atom.
You have rubocop installed.
$ gem install rubocop
- Run
Rubocop Auto Correct: Current File
from Command Palette - Select
Rubocop Auto-correct
in Context menu - Select [Packages] -> [Rubocop Auto-correct] -> [Current File] in menu bar
Name | Description |
---|---|
RUbocop Auto Correct: Current File |
Run rubocop auto-correct to current file |
RUbocop Auto Correct: Toggle Notification |
Toggle notification option |
RUbocop Auto Correct: Toggle Auto Run |
Toggle auto run option |
RUbocop Auto Correct: Toggle Debug Mode |
Toggle debug-mode option |
This package does not provide default keymap.
If you want to use the commands from keybinding, please set up ~/.atom/keymap.cson
following the below:
'atom-text-editor[data-grammar~="ruby"]':
'alt-r': 'rubocop-auto-correct:current-file'
This package supports auto-run. When checked, it runs Rubocop auto correct. But, it does not run automatically unless you activate this package.
You can activate it by running manually Rubocop Auto Correct: Current File
once at Atom window.
- default value is
false
You can enable/disable this option by Rubocop Auto Correct: Toggle Auto Run
command at any time.
You can correct a file directly if you enable this option. You do not need to save file after correcting it.
- default value is
false
I recommend you to enable Auto Run
& Correct File
options. Then, all files are corrected automatically.
When this option is disabled, you do not receive any notifications even thought a file is corrected.
- default value is
true
You can enable/disable this option by Rubocop Auto Correct: Toggle Notification
command at any time.
If you do not install rubocop yet, run gem install rubocop
to install it!
If you already installed rubocop, please check package setting at Rubocop Command Path
.
For example ~/.rbenv/shims/rubocop
.
- default value is
rubocop
When this option is disabled, you can get log on console.
- default value is
false
You can enable/disable this option by Rubocop Auto Correct: Toggle Debug Mode
command at any time.
- Fork it ( https://github.com/tomoya/rubocop-auto-correct/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request