RubyMine 2019.1 Help

RuboCop

RubyMine supports integration with RuboCop and enables displaying its offenses right inside the IDE. For instance, you can see and fix RuboCop offenses in the code editor.

RuboCop offense

You can also check the entire project and display the results along with other warnings.

RuboCop inspection results

Prerequisites

The RuboCop inspection is enabled in RubyMine by default and requires the RuboCop gem to be installed in the project’s SDK. If this gem is not installed, RubyMine will suggest doing this.

RuboCop Error

Disable RuboCop inspections

To disable RuboCop inspections, invoke the Settings/Preferences dialog (Ctrl+Alt+S ), open the Editor | Inspections page and uncheck the RuboCop inspection.

RuboCop inspection settings

Note that severity settings specified for the RuboCop inspection are not in effect when displaying inspection results. See Severity Settings to learn more.

Fix RuboCop offenses in the editor

When RuboCop inspections are enabled, RubyMine displays its offenses in the code editor.

RuboCop offense

You can use intention actions ( Alt+Enter ) to correct all suggested offenses in a file or you can apply only specific fixes by a class offense or cop department.

Fix RuboCop offense

Use RuboCop with code inspections

If you want to run RuboCop inspection for an entire project, select Code | Inspect Code. The Inspections Results window will display RuboCop warnings in the Ruby group.

RuboCop inspection results

You can apply fixes using the Fix all auto-correctable RuboCop offenses context menu command.

Fix RuboCop offenses

Severity Settings

Note that severity settings specified for the RuboCop inspection are not in effect when displaying inspection results. RubyMine uses the following severities for RuboCop inspections.

RuboCop Severity

RubyMine Severity

Refactor
Convention

Weak Warning

Warning

Warning

Error
Fatal

Error

Last modified: 8 May 2019

See Also