Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Rails Style Guide | 6,365 | 2 months ago | 19 | |||||||
A community-driven Ruby on Rails style guide | ||||||||||
Rubocop Rails | 712 | 537 | 380 | 2 days ago | 63 | July 07, 2022 | 114 | mit | Ruby | |
A RuboCop extension focused on enforcing Rails best practices and coding conventions. | ||||||||||
Souls | 329 | 7 months ago | 733 | October 14, 2022 | 3 | apache-2.0 | Ruby | |||
SOULs 🔥 Build Serverless Apps faster like Rails. Powered by Ruby GraphQL, Active Record, RSpec, RuboCop, and Google Cloud. | ||||||||||
Rails Base | 189 | a year ago | 15 | Ruby | ||||||
Skeleton for new Rails based projects. | ||||||||||
Expertiza | 177 | a month ago | 135 | mit | Ruby | |||||
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 Server | 175 | 15 hours ago | 27 | apache-2.0 | Ruby | |||||
:steam_locomotive: Rails API server for Kitsu | ||||||||||
Granite | 158 | 1 | 2 months ago | 29 | January 31, 2023 | 3 | mit | Ruby | ||
Business Actions architecture for Rails apps | ||||||||||
Rubocop Rails_config | 149 | 64 | 63 | a month ago | 102 | January 14, 2023 | 2 | mit | Ruby | |
RuboCop configuration which has the same code style checking as official Ruby on Rails. | ||||||||||
Devise Doorkeeper Cancan Api Example | 124 | 6 years ago | Ruby | |||||||
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 Action | 81 | 3 years ago | n,ull | mit | Ruby | |||||
Rubocop Linter Action: A GitHub Action to run Rubocop against your code! |
RuboCop configuration which has the same code style checking as official Ruby on Rails.
Official RoR RuboCop Configuration
Add this line to your application's Gemfile
:
gem "rubocop-rails_config"
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
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.
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
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
.
The gem is available as open source under the terms of the MIT License.