Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork22
RuboCop configuration which has the same code style checking as official Ruby on Rails.
License
toshimaru/rubocop-rails_config
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
RuboCop configuration which has the same code style checking as official Ruby on Rails.
Official RoR RuboCop Configuration
Add this line to your application'sGemfile
:
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
If you'd like to changeTargetRubyVersion
, seeCustomization.
cop | description |
---|---|
Rails/AssertNot | Prefer assert_not over assert |
Rails/RefuteMethods | Prefer assert_not_x over refute_x |
assert_not
andassert_not_xxx
methods are Rails assertion extension, so if you want to use these methods, requireactivesupport
gem and inheritActiveSupport::TestCase
.
classAssertNotTest <ActiveSupport::TestCasedeftest_assert_not_methodassert_not ...(code)...enddeftest_assert_not_nil_methodassert_not_nil ...(code)...endend
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 changeTargetRubyVersion
, you can do it like:
# .rubocop.ymlinherit_gem:rubocop-rails_config: -config/rails.yml# Override SettingAllCops:TargetRubyVersion:3.0
This overridesconfig/rails.yml
setting withTargetRubyVersion: 3.0
.
The gem is available as open source under the terms of theMIT License.
About
RuboCop configuration which has the same code style checking as official Ruby on Rails.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Contributors9
Uh oh!
There was an error while loading.Please reload this page.