All Projects → toshimaru → Rubocop Rails_config

toshimaru / Rubocop Rails_config

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

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Rubocop Rails config

Administrate Field Belongs to search
Plugin that adds search capabilities to belongs_to associations for Administrate
Stars: ✭ 29 (-72.64%)
Mutual labels:  rails, gem
Counter culture
Turbo-charged counter caches for your Rails app.
Stars: ✭ 1,397 (+1217.92%)
Mutual labels:  rails, gem
Render async
render_async lets you include pages asynchronously with AJAX
Stars: ✭ 974 (+818.87%)
Mutual labels:  rails, gem
Bh
Bootstrap Helpers for Ruby
Stars: ✭ 834 (+686.79%)
Mutual labels:  rails, gem
Validates formatting of
Common Rails validations wrapped in a gem.
Stars: ✭ 91 (-14.15%)
Mutual labels:  rails, gem
Datagrid
Gem to create tables grids with sortable columns and filters
Stars: ✭ 921 (+768.87%)
Mutual labels:  rails, gem
Instagram api gem
A Ruby wrapper for the Instagram API
Stars: ✭ 100 (-5.66%)
Mutual labels:  rails, gem
Yt
The reliable YouTube API Ruby client
Stars: ✭ 674 (+535.85%)
Mutual labels:  rails, gem
Pager Api
Easy API pagination for Rails
Stars: ✭ 86 (-18.87%)
Mutual labels:  rails, gem
Bhf
Rails-Engine-Gem that offers an admin interface for trusted user
Stars: ✭ 81 (-23.58%)
Mutual labels:  rails, gem
Octicons
A scalable set of icons handcrafted with <3 by GitHub
Stars: ✭ 7,039 (+6540.57%)
Mutual labels:  rails, gem
Premailer Rails
CSS styled emails without the hassle.
Stars: ✭ 1,382 (+1203.77%)
Mutual labels:  rails, gem
Materialize Sass
Materializecss rubygem for Rails Asset Pipeline / Sprockets
Stars: ✭ 785 (+640.57%)
Mutual labels:  rails, gem
Adminpanel
This gem has the goal to act as the administration panel for your resources, so you can focus only on the public part of your app
Stars: ✭ 7 (-93.4%)
Mutual labels:  rails, gem
Rails Style Guide
A community-driven Ruby on Rails style guide
Stars: ✭ 6,178 (+5728.3%)
Mutual labels:  rubocop, rails
Ama
"Ask Me Anything" with Rails 5.2 Application
Stars: ✭ 61 (-42.45%)
Mutual labels:  rubocop, rails
Rubocop Rails
A RuboCop extension focused on enforcing Rails best practices and coding conventions.
Stars: ✭ 433 (+308.49%)
Mutual labels:  rubocop, rails
Motion
Reactive frontend UI components for Rails in pure Ruby
Stars: ✭ 498 (+369.81%)
Mutual labels:  rails, gem
Tabler Rubygem
Rubygem for https://tabler.github.io
Stars: ✭ 77 (-27.36%)
Mutual labels:  rails, gem
Lol dba
lol_dba is a small package of rake tasks that scan your application models and displays a list of columns that probably should be indexed. Also, it can generate .sql migration scripts.
Stars: ✭ 1,363 (+1185.85%)
Mutual labels:  rails, gem

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.4 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: 2.7

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

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].