• Stars
    star
    155
  • Rank 240,864 (Top 5 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 6 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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.

More Repositories

1

jekyll-toc

Jekyll plugin which generates a table of contents.
Ruby
302
star
2

nyan

Colored `cat` command.
Go
212
star
3

RailsTwitterClone

Simple Twitter clone using Ruby on Rails 6.
Ruby
118
star
4

auto-author-assign

GitHub Actions: Automatically assign pull request authors.
JavaScript
99
star
5

rubocop-rails

RuboCop configuration which has the same code style checking as official Ruby on Rails
Ruby
63
star
6

jekyll-tagging-related_posts

Jekyll `related_posts` function based on tags.
Ruby
56
star
7

hybrid-next-plus

VSCode Hybrid Next Plus Theme.
17
star
8

rack-simple_user_agent

Rack::SimpleUserAgent is stupidly simple UA detector
Ruby
13
star
9

hubot-hanakin

่Šฑ้‡‘ใ ใƒผใƒฏใƒƒใ‚ทใƒงใƒผใ‚ค๏ผใƒ†ใƒณใ‚ทใƒงใƒณAGEAGEใƒžใƒƒใ‚ฏ
CoffeeScript
11
star
10

hubot-docomochatter

A hubot plugin which allows you to chat with hubot via Docomo Zatsudan-Taiwa(้›‘่ซ‡ๅฏพ่ฉฑ) API. Japanese is recommended.
CoffeeScript
5
star
11

dotfiles

My dotfiles. Configure it!
Shell
5
star
12

backlog-pr-link-action

Link GitHub Pull Request to Backlog issue.
TypeScript
5
star
13

terraform-digitalocean-rails

A terraform simple sample on DigitalOcean for Ruby on Rails.
HCL
5
star
14

ec2-price

Retrieve the latest EC2 prices via command line.
JavaScript
5
star
15

delete-action-cache

Delete GitHub Actions Cache with ease.
4
star
16

ruby-short_url

Ruby implementation of python-short_url.
Ruby
4
star
17

blog.toshima.ru

My blog in English.
SCSS
3
star
18

factory-bot-the-right-way

Source code for Kaigi on Rails presentation. https://kaigionrails.org
Ruby
3
star
19

rdm-rails5.1

Ruby
3
star
20

jekyll-theme-classless-simple

Jekyll theme with simple.css, classless CSS framework.
SCSS
3
star
21

blog.toshimaru.net

My blog powered by Jekyll.
HTML
3
star
22

jekyll-include_sass

Jekyll include_sass tag which includes and converts SASS/SCSS file. Useful for Google AMP HTML!
Ruby
2
star
23

docomochatter

Docomo Zatsudan API Client
CoffeeScript
2
star
24

attribute_validation

Attributes Validation Extension for ActiveRecord/ActiveModel
Ruby
2
star
25

til.toshimaru.net

My TIL.
HTML
1
star
26

serverkit-vscode

Serverkit plug-in for VSCode.
Ruby
1
star
27

vagrant-digitalocean-puppet

Create a droplet on Digital Ocean with puppet.
Puppet
1
star
28

opsworks-rails

Rails 4.2.0 sample application on OpsWorks.
Ruby
1
star
29

rails_backbone_demo_app

Demo application for RoR and Backbone.js
Ruby
1
star
30

LeetCode

LeetCode Solutions.
Ruby
1
star
31

memcacher

Better memcache integration for Rails.
Ruby
1
star
32

toshimaru

My idea storage. Work it harder. Make it better. Do it faster. Makes me stronger.
1
star
33

go-network

Network programming in Go
Go
1
star
34

mitamae-ruby-setup

Setup Ruby environment via Mitamae.
Ruby
1
star
35

compilerbook

C
1
star
36

bundled_gems

Install gem specified in Gemfile.lock without `bundle install`.
Ruby
1
star
37

redirect_follow_get

redirect_follow_get is simple http get method following redirect.
Ruby
1
star
38

SimpleRequestDispatcher

PHP Simple Request Dispatcher dispatches URL to Controllers. No Models, No Views.
PHP
1
star
39

ratiocalculator

Ratio Calculator.
HTML
1
star
40

packer-digitalocean-sample

Create a snapshot on Digital Ocean with packer.
Shell
1
star
41

mitamae-plugin-recipe-ssh_users

SSH user setup for mitamae.
Ruby
1
star
42

kramdown-amp

Kramdown Converter for AMP. It works as a Jekyll-plugin.
Ruby
1
star
43

circleci-orb-bundle-install

[DEPRECATED]CircleCI Orb which runs Ruby `bundle install` command with cache handling.
1
star
44

capybara-screenshot_config

Provides better options for Capybara screenshot.
Ruby
1
star
45

DesignPattern

Learn design pattern in various languages.
C#
1
star
46

hubot-best-summer

ๆœ€้ซ˜ใฎๅคใซใ—ใ‚ˆใ†ใœ!!!
CoffeeScript
1
star
47

torch

`torch` = `mkdir` + `touch`. Written in Rust.
Rust
1
star
48

sublime-wakame

Wakame Color Scheme for Sublime Text 3/4.
1
star