RuboCop
Supported Version | Language | Website |
---|---|---|
0.61.0+ (default: 1.10.0) | Ruby | https://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 the default configuration
including the MeowCop gem.
Configuration
Here is an example configuration via sider.yml
:
linter:
rubocop:
gems:
- rubocop-rspec
config: config/.rubocop.yml
safe: true
You can use the following options to make analysis fitter for your project.
Name | Type | Default |
---|---|---|
root_dir | string | - |
gems | string[] , hash[] | - |
config | string | - |
safe | boolean | false |
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
DEPRECATED: The option is ignored when using the version
0.72.0
or later, and will be removed in the future. Userubocop-rails
instead.
This option allows you to select whether using Rails cops or not. If omitted, Sider automatically determines it.