Skip to content

Commit e3990db

Browse files
committed
Add Rubocop
1 parent b626875 commit e3990db

8 files changed

+77
-9
lines changed

.rubocop.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
require:
3+
- rubocop-rake
4+
- rubocop-rspec
5+
6+
AllCops:
7+
NewCops: enable
8+
TargetRubyVersion: 3.1
9+
Exclude:
10+
- bin/*
11+
- gemfiles/*
12+
- test/**/*
13+
- lib/store_base_sti_class_for_*.rb
14+
15+
Gemspec/RequireMFA:
16+
Enabled: false
17+
18+
#########
19+
# STYLE #
20+
#########
21+
22+
Style/Documentation:
23+
Enabled: false
24+
25+
##########
26+
# LAYOUT #
27+
##########
28+
29+
Layout/LineLength:
30+
Max: 125

Appraisals

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ appraise 'activerecord_7.1.3' do
1717
gem 'activerecord', '7.1.3'
1818

1919
# Fix:
20-
# warning: logger was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.5.0.
20+
# warning: logger was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.5.0
2121
# Add logger to your Gemfile or gemspec.
2222
install_if '-> { Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0") }' do
2323
gem 'logger'

Gemfile

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# frozen_string_literal: true
22

3-
source "https://rubygems.org"
3+
source 'https://rubygems.org'
44

55
gemspec
66

7-
gem "appraisal", git: "https://github.com/n-rodriguez/appraisal.git", branch: "wip/combustion"
7+
gem 'appraisal', git: 'https://github.com/n-rodriguez/appraisal.git', branch: 'wip/combustion'
88

9-
gem "minitest"
10-
gem "minitest-reporters"
11-
gem "pg"
12-
gem "rake"
9+
gem 'minitest'
10+
gem 'minitest-reporters'
11+
gem 'pg'
12+
gem 'rake'
13+
gem 'rubocop'
14+
gem 'rubocop-rake'
15+
gem 'rubocop-rspec'

bin/rubocop

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
#
5+
# This file was generated by Bundler.
6+
#
7+
# The application 'rubocop' is installed as part of a gem, and
8+
# this file is here to facilitate running it.
9+
#
10+
11+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12+
13+
bundle_binstub = File.expand_path("bundle", __dir__)
14+
15+
if File.file?(bundle_binstub)
16+
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
17+
load(bundle_binstub)
18+
else
19+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21+
end
22+
end
23+
24+
require "rubygems"
25+
require "bundler/setup"
26+
27+
load Gem.bin_path("rubocop", "rubocop")

gemfiles/activerecord_7.0.8.gemfile

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ gem "minitest"
77
gem "minitest-reporters"
88
gem "pg"
99
gem "rake"
10+
gem "rubocop"
11+
gem "rubocop-rake"
12+
gem "rubocop-rspec"
1013
gem "activerecord", "7.0.8"
1114

1215
install_if -> { Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.3.0") } do

gemfiles/activerecord_7.1.3.gemfile

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ gem "minitest"
77
gem "minitest-reporters"
88
gem "pg"
99
gem "rake"
10+
gem "rubocop"
11+
gem "rubocop-rake"
12+
gem "rubocop-rspec"
1013
gem "activerecord", "7.1.3"
1114

1215
install_if -> { Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0") } do

gemfiles/activerecord_7.2.0.gemfile

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ gem "minitest"
77
gem "minitest-reporters"
88
gem "pg"
99
gem "rake"
10+
gem "rubocop"
11+
gem "rubocop-rake"
12+
gem "rubocop-rspec"
1013
gem "activerecord", "7.2.0"
1114

1215
gemspec path: "../"

store_base_sti_class.gemspec

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Gem::Specification.new do |s|
88
s.platform = Gem::Platform::RUBY
99
s.authors = ['Nicolas Rodriguez']
1010
s.email = ['[email protected]']
11+
s.license = 'MIT'
1112
s.homepage = 'https://github.com/jbox-web/store_base_sti_class'
1213
s.summary = <<~MSG
1314
Modifies ActiveRecord 5.0.x - 7.0.x with the ability to store the actual class (instead of the base class) in
@@ -21,8 +22,6 @@ Gem::Specification.new do |s|
2122
compatibility.'
2223
MSG
2324

24-
s.license = 'MIT'
25-
2625
s.required_ruby_version = '>= 3.1.0'
2726

2827
s.files = `git ls-files`.split("\n")

0 commit comments

Comments
 (0)