Atom Packages Directory

a package directory for a text editor of the 21st Century

Rubocop Auto Correct

Install with:
    apm install rubocop-auto-correct
  

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 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

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:

coffee 'atom-text-editor[data-grammar~="ruby"]': 'alt-r': 'rubocop-auto-correct:current-file'

Settings

rubocop-auto-correct setting panel

If you have a custom .rubocop.yml, this package will search it on project’s root folder or on $HOME/.rubocop.yml

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.

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.

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.

You can enable/disable this option by Rubocop Auto Correct: Toggle Notification command at any time.

Only Fixes Notification

When this option is disabled, you will get all rubocop notifications appeared.

You can enable/disable this option by Rubocop Auto Correct: Toggle Only Fixes Notification command at any time.

Rubocop Command Path

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

Debug Mode

When this option is disabled, you can get log on console.

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
Keywords: ruby, rubocop, refactoring Suggest keywords
Fork me on GitHub