Rubocop Rails_config

RuboCop configuration which has the same code style checking as official Ruby on Rails.
Alternatives To Rubocop Rails_config
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Rails Style Guide6,365
2 months ago19
A community-driven Ruby on Rails style guide
Rubocop Rails7125373802 days ago63July 07, 2022114mitRuby
A RuboCop extension focused on enforcing Rails best practices and coding conventions.
Souls329
7 months ago733October 14, 20223apache-2.0Ruby
SOULs 🔥 Build Serverless Apps faster like Rails. Powered by Ruby GraphQL, Active Record, RSpec, RuboCop, and Google Cloud.
Rails Base189
a year ago15Ruby
Skeleton for new Rails based projects.
Expertiza177
a month ago135mitRuby
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation.
Kitsu Server175
15 hours ago27apache-2.0Ruby
:steam_locomotive: Rails API server for Kitsu
Granite158
12 months ago29January 31, 20233mitRuby
Business Actions architecture for Rails apps
Rubocop Rails_config1496463a month ago102January 14, 20232mitRuby
RuboCop configuration which has the same code style checking as official Ruby on Rails.
Devise Doorkeeper Cancan Api Example124
6 years agoRuby
rails 4, rails-api, devise, doorkeeper, oauth, cancancan, rspec, puma, vcr, factory_girl, reqres_rspec, pg, dotenv, rack-cors, active_model_serializers, rubocop
Rubocop Linter Action81
3 years agon,ullmitRuby
Rubocop Linter Action: A GitHub Action to run Rubocop against your code!
Alternatives To Rubocop Rails_config
Select To Compare


Alternative Project Comparisons
Readme

rubocop-rails_config

Gem Version Test

RuboCop configuration which has the same code style checking as official Ruby on Rails.

Official RoR RuboCop Configuration

Installation

Add this line to your application's Gemfile:

gem "rubocop-rails_config"

Usage

Add this line to your application's .rubocop.yml:

inherit_gem:
  rubocop-rails_config:
    - config/rails.yml

Or just run:

$ rails generate rubocop_rails_config:install

Configuration

TargetRubyVersion

Although Rails 7 (edge) only supports Ruby 2.7 or more, rubocop-rails_config still supports Ruby 2.6 or more to support as many Ruby versions as possible.

If you'd like to change TargetRubyVersion, see Customization.

Rails/AssertNot, Rails/RefuteMethods

cop description
Rails/AssertNot Prefer assert_not over assert
Rails/RefuteMethods Prefer assert_not_x over refute_x

assert_not and assert_not_xxx methods are Rails assertion extension, so if you want to use these methods, require activesupport gem and inherit ActiveSupport::TestCase.

class AssertNotTest < ActiveSupport::TestCase
  def test_assert_not_method
    assert_not ...(code)...
  end

  def test_assert_not_nil_method
    assert_not_nil ...(code)...
  end
end

See also. ActiveSupport::Testing::Assertions

Customization

If you'd like to customize the rubocop setting on your project, you can override it.

For example, if you want to change TargetRubyVersion, you can do it like:

# .rubocop.yml
inherit_gem:
  rubocop-rails_config:
    - config/rails.yml

# Override Setting
AllCops:
  TargetRubyVersion: 3.0

This overrides config/rails.yml setting with TargetRubyVersion: 3.0.

License

The gem is available as open source under the terms of the MIT License.

Popular Rubocop Projects
Popular Ruby On Rails Projects
Popular Code Quality Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Ruby
Ruby On Rails
Code Style
Rubocop