Skip to main content

RuboCop

Supported VersionLanguageWebsite
0.61.0+ (default: 1.18.3)Rubyhttps://rubocop.org

RuboCop is a pluggable static code analyzer and code formatter for Ruby. It has been community-driven developed and has many rules and plugins including third-party's ones.

Getting Started#

To start using RuboCop, enable it in your repository settings.

If you want to customize RuboCop, run the following command in your project' root directory:

$ rubocop --init

See also the user guide for details.

Default Configuration for RuboCop#

If a .rubocop.yml file does not exist in your repository, Sider uses our recommended ruleset for RuboCop. For more details, please visit Recommended Ruleset.

Configuration#

Here is an example configuration via sider.yml:

linter:  rubocop:    config: config/.rubocop.yml    safe: true

You can use the following options to make analysis fitter for your project.

NameTypeDefault
root_dirstring-
dependenciesstring[], map[]-
configstring-
safebooleanfalse

config#

This option allows you to specify your configuration file. If omitted, the RuboCop default configuration is used.

safe#

This option allows you to select whether running only safe cops or not. If confirming whether a cop is safe or not, see the cops' document.

rails#

caution

The option is ignored when using the version 0.72.0 or later, and will be removed in the future. Use rubocop-rails instead.

This option allows you to select whether using Rails cops or not. If omitted, Sider automatically determines it.