Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

toshimaru/rubocop-rails_config

Repository files navigation

Gem VersionTest

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'sGemfile:

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

If you'd like to changeTargetRubyVersion, seeCustomization.

Rails/AssertNot, Rails/RefuteMethods

copdescription
Rails/AssertNotPrefer assert_not over assert
Rails/RefuteMethodsPrefer 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

Customization

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.

License

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

Stars

Watchers

Forks

Sponsor this project

  •  
  •  

Contributors9

Languages


[8]ページ先頭

©2009-2025 Movatter.jp