
For example, if you disable some checks for a specified cop department, the editor will not show corresponding offenses. RubyMine takes into account all settings specified in the. Go to the Editor | Inspections page and select the RuboCop inspection.Ĭonfigure how RuboCop severities map to inspection severities in the RuboCop Severities Mapping group. To change the default mapping, follow the steps below: Select the Run `rubocop -a` on save option to enable RuboCop autocorrection on save.īy default, RubyMine maps RuboCop severities and inspection severities in the following way: Select the RuboCop inspection under Ruby | Gems and gem management. In the Settings dialog ( Control+Alt+S), select Editor | Inspections. You can configure RubyMine to automatically launch RuboCop and autocorrect your code in safe mode every time you save your changes. You can also explore individual files and apply specific fixes by a class offense or cop department. In the Inspection Results tool window, you can explore RuboCop offenses and fix auto-correctable ones using the Fix all auto-correctable RuboCop offenses button. Wait until RubyMine analyzes your project. In the Run 'RuboCop' dialog, specify the scope of files that you want to analyze. In the popup, find RuboCop and press Enter.

To do this, follow the steps below:įrom the main menu, go to Code | Analyze Code | Run Inspection by Name… Control+Alt+Shift+I.

RubyMine enables you to find RuboCop offenses for the entire project by running a corresponding inspection. You can fix all suggested offenses in a file, or you can apply only specific fixes by a class offense or cop department. Place the caret at the highlighted area and press Control+F1. To see the warning description and fix it, do the following: When RuboCop inspections are enabled, RubyMine highlights its offenses in the code editor.

If necessary, enable the Use 'standard' gem option to use the Standard wrapper. Go to the Editor | Inspections page and enable/disable the RuboCop inspection under Ruby | Gems and gem management.

To enable or disable RuboCop and Standard inspections, do the following: Enable/Disable RuboCop and Standard inspections If you want to use Standard to analyze your project, add the 'standard' gem to your Gemfile and install it. If this gem is not installed, RubyMine will suggest doing this. The RuboCop inspection is enabled in RubyMine by default and requires the 'rubocop' gem to be installed in the project’s SDK. If necessary, you can enable the Standard wrapper and use it for analyzing project sources. You can also check the entire project and display all RuboCop warnings in a single report. RubyMine supports integration with RuboCop and enables you to fix its offenses right inside the IDE, for example, in the code editor.
