Rails Best Practices

Web Sitehttps://rails-bestpractices.com/
LanguageRuby
Supported Version1.19.0

Getting Started

To start using Rails Best Practices, enable it in repository setting.

If you want some customization, add Rails Best Practices config file at config/rails_best_practices.yml.

Default Configuration

SideCI uses the below settings of Rails Best Practices if there is no config file in your repository.

Configuration via sideci.yml

Example settings for Rails Best Practices under rails_best_practices

linter:
  rails_best_practices:
    options:
      vendor: false
      spec: true
      test: true
      features: true
      exclude: foo
      only: bar

options

This option controls command line options given to rails_best_practices.

vendor

This option controls whether to include files of vendor directory. When option is declared true, the vendor files will be inspected.
The default value in SideCI is true.

spec

This option controls whether to include files of spec directory. When options is declared true, the spec files will be inspected.
The default value in SideCI is false.

test

This option controls whether to include files of test directory. When options is declared true, the test files will be inspected.
The default value in SideCI is false.

features

This option controls whether to include files of features directory. When options is declared true, the features files will be inspected.
The default value in SideCI is false.

exclude

This option controls files/directories to exclude from analysis. The default value in SideCI is nil.
If you would like to set plural files/directories, write ones under options like below:

linter:
  rails_best_practices:
    options:
      exclude: app/controllers/foo/,app/models/bar.rb

In case that your repository has app/models/baz/ directory and app/models/baz.rb, when you declare exclude: app/models/baz, SideCI excludes both of these from analysis object.

only

This option controls files/directories to analyze. When this option is declared, SideCI analyzes only matching a pattern. The default value in SideCI is nil.
If you would like to set plural files/directories, write ones under options like below:

linter:
  rails_best_practices:
    options:
      only: app/controllers/,app/models/,lib/foo.rb

In case that your repository has app/models/baz/ directory and app/models/baz.rb, when you declare exclude: app/models/baz, SideCI excludes both of these from analysis object.