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 Only Fixed Notification |
Toggle only fixes 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'
If you have a custom .rubocop.yml
, this package will search it on project's root folder or on $HOME/.rubocop.yml
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.
When this option is disabled, you will get all rubocop notifications appeared.
- default value is
true
You can enable/disable this option by Rubocop Auto Correct: Toggle Only Fixes Notification
command at any time.
If you already installed rubocop, please check package setting at Rubocop Command Path
. For example ~/.rbenv/shims/rubocop
.
If you want to set arguments, please set arguments with command at here. For example rubocop --format simple
- 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