Skip to content

Commit 8cee23f

Browse files
committed
Add rubocop-rails-omakase, autofix violations and turn on CI job
1 parent b0c5b39 commit 8cee23f

22 files changed

+394
-220
lines changed

.github/workflows/ci.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ on:
66
branches: [ main ]
77

88
jobs:
9-
# lint:
10-
# runs-on: ubuntu-latest
11-
# steps:
12-
# - name: Checkout code
13-
# uses: actions/checkout@v4
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
1414

15-
# - name: Set up Ruby
16-
# uses: ruby/setup-ruby@v1
17-
# with:
18-
# ruby-version: .ruby-version
19-
# bundler-cache: true
15+
- name: Set up Ruby
16+
uses: ruby/setup-ruby@v1
17+
with:
18+
ruby-version: .ruby-version
19+
bundler-cache: true
2020

21-
# - name: Lint code for consistent style
22-
# run: bin/rubocop -f github
21+
- name: Lint code for consistent style
22+
run: bin/rubocop -f github
2323

2424
test:
2525
runs-on: ubuntu-latest

.rubocop.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Omakase Ruby styling for Rails
2+
inherit_gem:
3+
rubocop-rails-omakase: rubocop.yml

Gemfile

+24-22
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,61 @@
1-
source 'https://rubygems.org'
1+
source "https://rubygems.org"
22
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
33

4-
ruby '3.1.4'
4+
ruby "3.1.4"
55

6-
gem 'rails', '~> 7.1.3'
6+
gem "rails", "~> 7.1.3"
77

8-
gem 'mysql2', '~> 0.5.6'
8+
gem "mysql2", "~> 0.5.6"
99
# Use Puma as the app server
10-
gem 'puma', '~> 6.4'
10+
gem "puma", "~> 6.4"
1111

1212
# Use Uglifier as compressor for JavaScript assets
13-
gem 'uglifier', '>= 1.3.0'
13+
gem "uglifier", ">= 1.3.0"
1414

15-
gem 'rollbar'
15+
gem "rollbar"
1616

1717
# See https://github.com/rails/execjs#readme for more supported runtimes
18-
gem 'execjs'
18+
gem "execjs"
1919

2020
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
21-
gem 'jbuilder', '~> 2.12'
21+
gem "jbuilder", "~> 2.12"
2222

2323
# Use ActiveStorage variant
24-
gem 'image_processing', '~> 1.12', '>= 1.12.2'
24+
gem "image_processing", "~> 1.12", ">= 1.12.2"
2525

26-
gem 'comfortable_mexican_sofa', github: 'restarone/comfortable-mexican-sofa', tag: '3.5'
26+
gem "comfortable_mexican_sofa", github: "restarone/comfortable-mexican-sofa", tag: "3.5"
2727

28-
gem 'friendly_id'
28+
gem "friendly_id"
2929

30-
gem 'htmlentities'
30+
gem "htmlentities"
3131
# Reduces boot times through caching; required in config/boot.rb
32-
gem 'bootsnap', '>= 1.4.2', require: false
32+
gem "bootsnap", ">= 1.4.2", require: false
3333

34-
gem 'webpacker', '~> 5.4'
34+
gem "webpacker", "~> 5.4"
3535

3636
gem "rdoc", ">= 6.6.3.1"
3737

3838
group :development, :test do
3939
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
40-
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
40+
gem "byebug", platforms: [ :mri, :mingw, :x64_mingw ]
4141
end
4242

4343
group :development do
44+
gem "rubocop-rails-omakase", require: false
45+
4446
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
45-
gem 'web-console', '>= 3.3.0'
47+
gem "web-console", ">= 3.3.0"
4648

47-
gem 'listen', '>= 3.0.5', '< 3.10'
49+
gem "listen", ">= 3.0.5", "< 3.10"
4850
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
49-
gem 'spring', '>= 3.0'
51+
gem "spring", ">= 3.0"
5052
end
5153

5254
group :test do
5355
# Adds support for Capybara system testing and selenium driver
54-
gem 'capybara', '>= 2.15'
55-
gem 'selenium-webdriver'
56+
gem "capybara", ">= 2.15"
57+
gem "selenium-webdriver"
5658
end
5759

5860
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
59-
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
61+
gem "tzinfo-data", platforms: [ :mingw, :mswin, :x64_mingw, :jruby ]

Gemfile.lock

+42-4
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ GEM
9898
tzinfo (~> 2.0)
9999
addressable (2.8.6)
100100
public_suffix (>= 2.0.2, < 6.0)
101+
ast (2.4.2)
101102
base64 (0.2.0)
102103
bigdecimal (3.1.8)
103104
bindex (0.8.1)
@@ -154,8 +155,10 @@ GEM
154155
rails-dom-testing (>= 1, < 3)
155156
railties (>= 4.2.0)
156157
thor (>= 0.14, < 2.0)
158+
json (2.7.2)
157159
kramdown (2.4.0)
158160
rexml
161+
language_server-protocol (3.17.0.3)
159162
listen (3.9.0)
160163
rb-fsevent (~> 0.10, >= 0.10.3)
161164
rb-inotify (~> 0.9, >= 0.9.10)
@@ -174,7 +177,6 @@ GEM
174177
rake
175178
mini_magick (4.12.0)
176179
mini_mime (1.1.5)
177-
mini_portile2 (2.8.6)
178180
minitest (5.22.3)
179181
msgpack (1.7.2)
180182
mutex_m (0.2.0)
@@ -189,9 +191,12 @@ GEM
189191
net-smtp (0.4.0.1)
190192
net-protocol
191193
nio4r (2.7.0)
192-
nokogiri (1.16.5)
193-
mini_portile2 (~> 2.8.2)
194+
nokogiri (1.16.5-x86_64-darwin)
194195
racc (~> 1.4)
196+
parallel (1.24.0)
197+
parser (3.3.1.0)
198+
ast (~> 2.4.1)
199+
racc
195200
psych (5.1.2)
196201
stringio
197202
public_suffix (5.0.4)
@@ -240,6 +245,7 @@ GEM
240245
rake (>= 12.2)
241246
thor (~> 1.0, >= 1.2.2)
242247
zeitwerk (~> 2.6)
248+
rainbow (3.1.1)
243249
rake (13.1.0)
244250
rb-fsevent (0.11.2)
245251
rb-inotify (0.10.1)
@@ -252,6 +258,36 @@ GEM
252258
rexml (3.2.8)
253259
strscan (>= 3.0.9)
254260
rollbar (3.5.2)
261+
rubocop (1.64.0)
262+
json (~> 2.3)
263+
language_server-protocol (>= 3.17.0)
264+
parallel (~> 1.10)
265+
parser (>= 3.3.0.2)
266+
rainbow (>= 2.2.2, < 4.0)
267+
regexp_parser (>= 1.8, < 3.0)
268+
rexml (>= 3.2.5, < 4.0)
269+
rubocop-ast (>= 1.31.1, < 2.0)
270+
ruby-progressbar (~> 1.7)
271+
unicode-display_width (>= 2.4.0, < 3.0)
272+
rubocop-ast (1.31.3)
273+
parser (>= 3.3.1.0)
274+
rubocop-minitest (0.35.0)
275+
rubocop (>= 1.61, < 2.0)
276+
rubocop-ast (>= 1.31.1, < 2.0)
277+
rubocop-performance (1.21.0)
278+
rubocop (>= 1.48.1, < 2.0)
279+
rubocop-ast (>= 1.31.1, < 2.0)
280+
rubocop-rails (2.25.0)
281+
activesupport (>= 4.2.0)
282+
rack (>= 1.1)
283+
rubocop (>= 1.33.0, < 2.0)
284+
rubocop-ast (>= 1.31.1, < 2.0)
285+
rubocop-rails-omakase (1.0.0)
286+
rubocop
287+
rubocop-minitest
288+
rubocop-performance
289+
rubocop-rails
290+
ruby-progressbar (1.13.0)
255291
ruby-vips (2.1.4)
256292
ffi (~> 1.12)
257293
rubyzip (2.3.2)
@@ -287,6 +323,7 @@ GEM
287323
concurrent-ruby (~> 1.0)
288324
uglifier (4.2.0)
289325
execjs (>= 0.3.0, < 3)
326+
unicode-display_width (2.5.0)
290327
web-console (4.2.1)
291328
actionview (>= 6.0.0)
292329
activemodel (>= 6.0.0)
@@ -307,7 +344,7 @@ GEM
307344
zeitwerk (2.6.13)
308345

309346
PLATFORMS
310-
ruby
347+
x86_64-darwin-21
311348

312349
DEPENDENCIES
313350
bootsnap (>= 1.4.2)
@@ -325,6 +362,7 @@ DEPENDENCIES
325362
rails (~> 7.1.3)
326363
rdoc (>= 6.6.3.1)
327364
rollbar
365+
rubocop-rails-omakase
328366
selenium-webdriver
329367
spring (>= 3.0)
330368
tzinfo-data

0 commit comments

Comments
 (0)