/rubocop-auto-correct

Auto-correct ruby source code by using rubocop in Atom.

Primary LanguageCoffeeScriptMIT LicenseMIT

rubocop-auto-correct package Build Status

Auto-correct ruby source code by using rubocop in Atom.

rubocop-auto-correct:current-file

Prerequisites

You have rubocop installed.

$ gem install rubocop

Usage

  1. Run Rubocop Auto Correct: Current File from Command Palette
  2. Select Rubocop Auto-correct in Context menu
  3. Select [Packages] -> [Rubocop Auto-correct] -> [Current File] in menu bar

Commands

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

Keymap example

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'

Settings

rubocop-auto-correct setting panel

Auto Run

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.

Correct File

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.

Notification

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.

Rubocop Command Path

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

Debug Mode

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.

Contributing

  1. Fork it ( https://github.com/tomoya/rubocop-auto-correct/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request